HMODULE hModule=LoadLibrary("Drive:\\folder\\sth.dll"); if(!hModule) { MessageBox("Load sth.dll failed!); return; } FARPROC address= GetProcAddress(hModule, ("Drive:\\folder\\sth.dll"); if(!address) { MessageBox("GetProcAddress failed!); return; }
anminxin
Posts
-
DLL preferred load address -
how to set journal hook?hello everyone, I want to write a program to record the event of keyboard, sb advise me to use journal hook. //g_hLogHook is a global hook if (g_hLogHook==NULL) g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD, (HOOKPROC)JournalLogProc,AfxGetInstanceHandle(),0); It will not return until I press Ctrl-Alt-Del to cancel the hook. It then has a valid handle for g_hLogHook.I'm at a loss as to why this hangs? can anyone give me a answer? ps:msdn Unlike most other global hook procedures, the JournalRecordProc and JournalPlaybackProc hook procedures are always called in the context of the thread that set the hook. now,now that JournalProc is always called in the context of the thread that set the hook,why all the threads on the desktop are hanging before I press Ctrl-Alt-Del ? thanks for your answer
-
I/O, fread.fread returns the number of full items actually read, which may be less than count if an error occurs or if the end of the file is encountered before reaching count. Use the feof or ferror function to distinguish a read error from an end-of-file condition. If size or count is 0, fread returns 0 and the buffer contents are unchanged.