Re: SetWindowsHookEx and external thread problem
From: sklett (asasd_at_asdfasdfsd.com)
Date: 11/11/04
- Next message: Jeff Partch: "Re: Control(s) ID missing from ClassWizard"
- Previous message: Jonathan Wood: "Re: Owner Draw STATIC Window with XP Themes"
- In reply to: sklett: "SetWindowsHookEx and external thread problem"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Nov 2004 10:27:19 -0800
Now I have the hook installed, but the handler never fires. This stuff is
crazy. Basically, I have it working fine when I pass NULL for the threadID,
but when I pass a valid, external threadID it stops working.
//
// insert into another process
//
HWND HmbWindow = FindWindow(NULL, "Untitled - Notepad");
if(HmbWindow == NULL)
{
OutputDebugString("Failed getting window handle\n");
}
long threadID = GetWindowThreadProcessId(HmbWindow, NULL);
hKeyHook = SetWindowsHookEx (WH_KEYBOARD, lpfnHookProc, hInstance,
threadID/*NULL*/);
"sklett" <asasd@asdfasdfsd.com> wrote in message
news:uIM$sUByEHA.3844@TK2MSFTNGP09.phx.gbl...
> ** This is a continuation of an older thread, but I thought starting over
> would be better as things have been tidied up...
>
> I have created a dll to install and handle my hook and I have created a
test
> application that will utilize this new hook. The call to SetWindowHookEx
> works fine when the threadID parameter is NULL, but when I specify a
> specific thread ID obtained from a call to GetWindowThreadProcessId the
call
> to SetWindowHookEx returns NULL.
>
> I have NO idea where to start debuggin this, Does anyone have any ideas?
>
>
> Thanks,
> Steve
>
>
- Next message: Jeff Partch: "Re: Control(s) ID missing from ClassWizard"
- Previous message: Jonathan Wood: "Re: Owner Draw STATIC Window with XP Themes"
- In reply to: sklett: "SetWindowsHookEx and external thread problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|