From www.move2008.com
// Hard RESET!
#include
#define ioctl_hal_reboot ctl_code (file_device_hal, 15, method_buffered, file_any_access)
EXTERN "C" __DECLSPEC (DLLIMPORT) Void SetCleanRebootflag (Void);
Extern "C" __declspec (dllimport) Bool KernelioControl (DWORD DWIOCONTROLCODE, LPVOID LPINBUF, DWORD NINBUFSIZE, LPVOID LPOUTBUF, DWORD NOUTBUFSIZE, LPDWORD LPBYTESRETURNED);
Bool hardresetpocketpc () {setCleanRebootflag (); return kerioControl (ioctl_hal_reboot, null, 0, null, 0, null);}
Fullscreen // void FullScreen (HWND hDlg) {RECT rc; GetWindowRect (hDlg, & rc); SHFullScreen (hDlg, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON); MoveWindow (hDlg, rc.left, rc.top, rc.right, rc.bottom , TRUE);
// That is to pay attention to the SHFS_HIDetaskbar hide is hidden, show is displayed.
// Winsdk programming hidden cursor
INT nwaitcursorcount; // cursor
/ ************************************************** ****** Show hidden cursor ncode = 1 is displayed, -1 is hidden ******************************* ********************* / VOID SHCURSOR (int Ncode) {static hcursor cur; static bool bo = true; if (bo) {cur = :: loadingCursor (NULL, IDC_WAIT); bo = false;} m_nWaitCursorCount = nCode; if (m_nWaitCursorCount> 0) {HCURSOR hcurPrev = :: SetCursor (cur); if (nCode> 0 && m_nWaitCursorCount == 1) m_hcurWaitCursorRestore = hcurPrev;} else {// Turn Everything OFF M_NWAITCURSORCOUNT = 0; // Prevent Underflow :: SetCursor (m_hcurwaitcursorrest);}}
/ ************************************************** ****** Start display cursor **************************************************************************************************************************************************************************************************************************************************************************************** ************ / VOID BEGINCURSOR () {m_nwaitcursorcount = 0; shcursor (1);
/ ************************************************** ****** End the display cursor ************************************************************* ************ / VOID EndCursor () {m_nwaitcursorcount = 0; shcursor (-1);} //
// Call other programs
/ ************************************************** ****** Open other applications *********************************************** ************ / VOID shell (hwnd hwnd, lptstr propath) {int Ret; lptstr exec = (lptstr) malloc (MAX_PATH); shellexecuteInfo shi; exec = propath; shi.cbsize = sizeof (SHELLEXECUTEINFO); shi.lpverb = text ("open"); shi.lpfile = exec; shi.nshow = sw_shownormal; ret= shellexecuteEx (& shi);}
// WinsDK pop-up menu
/ ************************************************** ****** Pop-up menu **************************************************** ********** / VOID APIENTRY POPUPMENU (HWND HWND, POINT, INTM) {HMENU HMENU; HMENU HMENUTRACKPOPUP; // Get pop-up menu resource HMENU = LoadMenu (Ghinst, makeintResource (IDM)); IF (! hmenu) return;
HMenutrackPopup = GetSubmenu (HMENU, 0); ClientToscreen (HWnd, (LPPOINT) & Point; TrackPopupMenu (HMenutrackPopup, 0, Point.x, Point.y, 0, Hwnd, Null); DestroyMenu (HMENU);}