Create your own spy ++

xiaoxiao2021-03-06  56

Bool Apientry MAINDLGPROC (HWND HDLG, // Dialog Handle Uint Message, // Message Type WPARAM WPARAM, // Message Attached Information LParam LPARAM) // Message Information {Point MousePoint; Char Str [256]; hwnd hwnd; // Storage window handle Switch (message) // message processing {copy wm_initdialog: // dialog initialization message {// Make the window home SETWINDOWPOS (HDLG, HWND_TOPMOST, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); SetTimer HDLG, 1,100, null; m_hwnd = hdlg; return (true);} case wm_close: {enddialog (hdlg, true); return (true);} case wm_timer: {getCursorpos (& mousepoint); // Take the mouse position hWnd = WindowFromPoint (MousePoint); // Get the location window of the mouse pointer (hwnd, wm_gettext, 255, (long) Str); setdlgitemtext (hdlg, idc_caption, str); // Get window class name getClassName (HWnd, STR, 255) ); Setdlgitemtext (HDLG, IDC_CLASSNAME, STR); // Get window class value LTOA (GetClasslong (GCW_ATOM), STR, 10); setdlgitemtext (HDLG, IDC_CLASSATOM, STR); // Get window style LTOA (GetWindowlong (hwnd " , GWL_EXSTYLE, STR, 2); SETDLGITEMTEXT (HDLG, IDC_EXTSTYLE, STR); // Get window ID LTOA (GetWindowlong (hwnd, gwl_id), STR, 10); setdlgitemt EXT (HDLG, IDC_ID, STR); Return (True);} Case WM_DESTROY: {KillTimer (HDLG, 1); // Taskbardeleteicon (GetsafehWnd (), 100, M_HICON, _T ("Hi!")); Return (TRUE );} Case WM_COMMAND: // Command button message {if (WPARAM) == idc_quit) enddialog (hdlg, true); return (true);}}} return (false);} int Winst, Hinstance HinstPREV, LPSTR SZCMDLINE, INT NCMDSHOW) {DialogBox (HinSt, // Application Strength Handle MakeintResource (IDD_MAINDLG), // Dialog Resource Identifies NULL, // Dialog Box Associated Father Window Handle (DLGPROC) MAINDLGPROC); // Dialog Box Process function pointer return (0);

转载请注明原文地址:https://www.9cbs.com/read-117228.html

New Post(0)