Answer 6
LRESULT CALLBACK _stdcall MouseJi(int code,WPARAM w,LPARAM l)
{
if(code==HC_ACTION)
{
MSLLHOOKSTRUCT *m=(MSLLHOOKSTRUCT *)l;
ofstream fout("D:\\a.txt",ios::app);
fout<<m->pt.x<<"\t"<<m->pt.y<<"\t"<<w<<"\n";
fout.close();
}
return CallNextHookEx(ms,code,w,l);
}
But setwindowshookex() will be in vb6 code.
so my problem is each time mouse event occurs and file will be opened/closed and all.
and if i open the file in dll_process_attach,it will be opened/closed each time the new process is attached/deattached to the dll.
but i want to do it only once when dll loads/unloads.how?