winapi - Hooking in win32 -
I have any window like the mouse moves in the form of a mouse on the clone button on its non-client area. I set using WH_GETMESSAGE in WindowsHookEx wm_ncmousemove and then try to decide using SendMessage to send a message WM_DESTROY specific window, but the window has not closed. Any help ????
Letllt callback Colvandprok (Int code, Waram W Piaaram, Elapiarm Elpiaarm) {MSG * msg = (MSG *) Elpiamm; If (code == Acsi_aktisn) {if (msg- & gt; message == WM_NCMOUSEMOVE) {if (msg- & gt; wParam == HTCLOSE} {SendMessage (Acdbluditij, Dbluem_destro, Dblupiamm, Elpiamm);}}} return CallNextHookEx (g_hkMsg, code, wParam, lParam);} INT WINAPI InstallW (Acdbludblu Acdblud, Hinsstain instance, Elpeedbluti Elpisimdeelain, Int Ansimdi show) {DWORD dwTarget = 0; points point; GetCursorPos (& amp; point); HwndTarget = WindowFromPoint (point ); DwTarget = GetWindowThreadProcessId (hwndTarget, NULL); G_hkMsg = SetWindowsHookEx (WH_GETMESSAGE, Colvandprkr, g_hInstance, 0); If (g_hkMsg) {message Box (NULL, L "message hook up, press OK to fix.", L "Acelacketst" Mbi_konaksklameshn); UnhookWindowsHookEx (g_hkMsg);} and messageBox (zero, L "hook installation failed.", L "HL Hookestest ", MB_coreion); return 0;}
either WM_CLOSE < / Code> or WM_SYSCOMMAND with wParam = SC_CLOSE instead. Ask to close the window
WM_CLOSE and WM_SYSCOMMAND / SC_CLOSE . The WM_DESTROY window indicates that it has been closed saying that "you have closed" will not be closed in a window.
Comments
Post a Comment