Click here to Skip to main content
16,011,743 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Some MFC Process Checking ??? Pin
28-Feb-01 11:25
suss28-Feb-01 11:25 
GeneralRe: Some MFC Process Checking ??? Pin
Ariel28-Feb-01 19:45
Ariel28-Feb-01 19:45 
GeneralRe: Some MFC Process Checking ??? Pin
1-Mar-01 0:47
suss1-Mar-01 0:47 
AnswerRe: Some MFC Process Checking ??? Pin
markkuk28-Feb-01 21:48
markkuk28-Feb-01 21:48 
GeneralPropertySheet in CFrameWnd do not look like a Dlg Pin
HL123428-Feb-01 6:48
professionalHL123428-Feb-01 6:48 
GeneralProblems with hooking events!! HELP !! Pin
TomK27-Feb-01 21:51
TomK27-Feb-01 21:51 
GeneralRe: Problems with hooking events!! HELP !! Pin
28-Feb-01 0:21
suss28-Feb-01 0:21 
GeneralRe: Problems with hooking events!! HELP !! Pin
TomK28-Feb-01 2:21
TomK28-Feb-01 2:21 
Of course!!
In my dll, i've coded the methods called by SetWindowsHookEx():

extern "C" LRESULT CALLBACK
SpyGetMsgProc(INT hCode, WPARAM wParam, LPARAM lParam)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
...
// Windows messages are taken here

return CallNextHookEx(NULL, hCode, wParam, lParam);
}

extern "C" LRESULT CALLBACK
SpyCallWndProc(INT hCode, WPARAM wParam, LPARAM lParam)
{
// like SpyGetMsgProc()
}

and in my program i coded a method SetSpyHook() which use SetWindowsHookEx():

BOOL SetSpyHook(BOOL bSet)
{
static HHOOK hhkGetMessage = NULL;
static HHOOK hhkCallWndProc = NULL;
static HMODULE hmodHook = NULL;

hmodHook = LoadLibrary("Hook");
...
hhkGetMessage = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)GetProcAddress(hmodHook, "SpyGetMsgProc"), hmodHook, 0);
...
hhkCallWndProc = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC)GetProcAddress(hmodHook, "SpyCallWndProc"), hmodHook, 0);
...
}

My application works, but it catch only its messages!! I can't catch all messages from the others windows (like Spy++)!!
Thanks for your help...
Confused | :confused:
GeneralRe: Problems with hooking events!! HELP !! Pin
28-Feb-01 4:32
suss28-Feb-01 4:32 
GeneralTray icon and a popup menu bug Pin
27-Feb-01 21:21
suss27-Feb-01 21:21 
GeneralRe: Tray icon and a popup menu bug Pin
Daniel Ferguson28-Feb-01 3:37
Daniel Ferguson28-Feb-01 3:37 
GeneralRe: Tray icon and a popup menu bug Pin
3-Mar-01 9:23
suss3-Mar-01 9:23 
GeneralFile Handling Pin
27-Feb-01 19:53
suss27-Feb-01 19:53 
GeneralRe: File Handling Pin
l a u r e n27-Feb-01 19:58
l a u r e n27-Feb-01 19:58 
GeneralPrinter Context Menu Pin
27-Feb-01 19:22
suss27-Feb-01 19:22 
GeneralRe: Printer Context Menu Pin
Jason De Arte28-Feb-01 7:14
Jason De Arte28-Feb-01 7:14 
GeneralRe: Printer Context Menu Pin
12-Mar-01 12:05
suss12-Mar-01 12:05 
GeneralUnable to log on to Oracle?!!! Pin
27-Feb-01 16:14
suss27-Feb-01 16:14 
GeneralRe: Unable to log on to Oracle?!!! Pin
l a u r e n27-Feb-01 20:12
l a u r e n27-Feb-01 20:12 
QuestionFindinf my CFrameWnd ? Pin
Ariel27-Feb-01 15:23
Ariel27-Feb-01 15:23 
AnswerRe: Findinf my CFrameWnd ? Pin
Christian Graus27-Feb-01 16:31
protectorChristian Graus27-Feb-01 16:31 
GeneralRe: Findinf my CFrameWnd ? Pin
Ariel27-Feb-01 17:51
Ariel27-Feb-01 17:51 
GeneralCScrollView Pin
27-Feb-01 14:15
suss27-Feb-01 14:15 
GeneralRe: CScrollView Pin
l a u r e n27-Feb-01 20:03
l a u r e n27-Feb-01 20:03 
QuestionCan CListCtrl select all the row (not only the iSubItem=0 part)? Pin
Ariel27-Feb-01 14:09
Ariel27-Feb-01 14:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.