Click here to Skip to main content
15,921,113 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLPSAFEARRAY issues Pin
Axonn Echysttas4-Nov-05 9:46
Axonn Echysttas4-Nov-05 9:46 
AnswerRe: LPSAFEARRAY issues Pin
Mircea Puiu4-Nov-05 23:31
Mircea Puiu4-Nov-05 23:31 
GeneralRe: LPSAFEARRAY issues Pin
Axonn Echysttas5-Nov-05 10:51
Axonn Echysttas5-Nov-05 10:51 
GeneralRe: LPSAFEARRAY issues Pin
Axonn Echysttas5-Nov-05 21:23
Axonn Echysttas5-Nov-05 21:23 
QuestionLinker Error Pin
Maskarat4-Nov-05 7:54
Maskarat4-Nov-05 7:54 
AnswerRe: Linker Error Pin
Blake Miller4-Nov-05 10:49
Blake Miller4-Nov-05 10:49 
GeneralRe: Linker Error Pin
Maskarat6-Nov-05 4:01
Maskarat6-Nov-05 4:01 
QuestionHelp me :What is wrong here???? Pin
Member 18584504-Nov-05 7:26
Member 18584504-Nov-05 7:26 
I wrote a hook message to record all the messages on the choosen windows(it is choose by the first mouse click)but it did not do right.
//////////globle variable///////////////
#pragma data_seg(".SHARDAT")
static HHOOK hkb=NULL;
FILE *f1;
BOOL bfist=FALSE;
HWND m_handlechoosen;
#pragma data_seg()
//////////////////////////

LRESULT __declspec(dllexport)__stdcall CALLBACK MessageProc(int nCode,WPARAM wParam,LPARAM lParam)
{


PMSG mesg = (PMSG)lParam;
if (nCode>0) {
//get the first window handle choosen
if (bfist==FALSE&&mesg->message==WM_LBUTTONDOWN) {
bfist=TRUE;
m_handlechoosen=mesg->hwnd;
}
//recorder message belong to the handle choosen
if (bfist==TRUE&&mesg->hwnd==m_handlechoosen) {
f1=fopen("c:\\report.txt","a+");
int nLen = ::GetWindowTextLength(mesg->hwnd);
TCHAR *tszWindowName = new TCHAR;
::GetWindowText(mesg->hwnd, tszWindowName, nLen + 1);

if (nLen>0) {
fprintf(f1, "code=0x%X wParam=0x%X lParam=0x%X | msg->hwnd(Window name)=%s msg->message=0x%X msg->wParam=0x%X msg->lParam=0x%X\n",
nCode,
wParam,
lParam,
tszWindowName,
mesg->message,
mesg->wParam,
mesg->lParam
);
}
else
{

fprintf(f1, "code=0x%X wParam=0x%X lParam=0x%X | msg->hwnd(Window name)=Desktop Window msg->message=0x%X msg->wParam=0x%X msg->lParam=0x%X\n",
nCode,
wParam,
lParam,
mesg->message,
mesg->wParam,
mesg->lParam
);
}

delete tszWindowName;
fclose(f1);
}

}

else
{

CallNextHookEx( hkb, nCode, wParam, lParam );

return 0;
}
return CallNextHookEx( hkb, nCode, wParam, lParam );

}

->The result are all the messages....

...Please help me ...
QuestionRe: Help me :What is wrong here???? Pin
David Crow4-Nov-05 7:51
David Crow4-Nov-05 7:51 
QuestionA different registry question - edit offline? Pin
charlieg4-Nov-05 7:24
charlieg4-Nov-05 7:24 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 7:50
David Crow4-Nov-05 7:50 
AnswerRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:03
charlieg4-Nov-05 8:03 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 8:08
David Crow4-Nov-05 8:08 
AnswerRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:20
charlieg4-Nov-05 8:20 
QuestionRe: A different registry question - edit offline? Pin
David Crow4-Nov-05 9:01
David Crow4-Nov-05 9:01 
AnswerRe: A different registry question - edit offline? Pin
Maximilien4-Nov-05 7:56
Maximilien4-Nov-05 7:56 
GeneralRe: A different registry question - edit offline? Pin
charlieg4-Nov-05 8:05
charlieg4-Nov-05 8:05 
AnswerFrom were do i learn WinCE Pin
vikas amin5-Nov-05 1:29
vikas amin5-Nov-05 1:29 
GeneralRe: From were do i learn WinCE Pin
charlieg5-Nov-05 3:57
charlieg5-Nov-05 3:57 
QuestionSNMP informs (assured-delivery traps?) Pin
BambooMoon4-Nov-05 5:56
BambooMoon4-Nov-05 5:56 
AnswerRe: SNMP informs (assured-delivery traps?) Pin
David Crow4-Nov-05 7:23
David Crow4-Nov-05 7:23 
GeneralRe: SNMP informs (assured-delivery traps?) Pin
BambooMoon4-Nov-05 7:26
BambooMoon4-Nov-05 7:26 
QuestionRe: SNMP informs (assured-delivery traps?) Pin
David Crow4-Nov-05 7:52
David Crow4-Nov-05 7:52 
AnswerRe: SNMP informs (assured-delivery traps?) Pin
BambooMoon4-Nov-05 8:15
BambooMoon4-Nov-05 8:15 
Questionsubversion API Pin
Anehl4-Nov-05 4:08
Anehl4-Nov-05 4:08 

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.