用COleClientItem::GetInPlaceWindow();获得激活的窗口。再用GetWindowThreadProcessId The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. DWORD GetWindowThreadProcessId( HWND hWnd, // handle to window LPDWORD lpdwProcessId // process identifier );取得进程ID.
函数的第四个参数是GetCurrentThreadID(),如要取得WORD的消息的话,我应该得到word 的 线程ID。。
怎么样得到这个ID 呢??
The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. DWORD GetWindowThreadProcessId(
HWND hWnd, // handle to window
LPDWORD lpdwProcessId // process identifier
);取得进程ID.
SetWindowsHookEx(WH_MOUSE,(HOOKPROC)MouseProc,(HINSTANCE)NULL,NULL);