1. First you need to register your key here
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows]
"AppInit_DLLs"="AppInitDLL.dll"
"LoadAppInit_DLLs"=dword:00000001
2. Open VC++ create a Win32 DLL Project
Source below just to test if it works
#include
BOOL APIENTRY DllMain( HINSTANCE hInstance, DWORD reason, LPVOID reserved )
{
switch( reason )
{
case DLL_PROCESS_ATTACH:
MessageBoxA( NULL, "Hey! It works!", "Calling", 0 );
break;
default:
break;
}
return TRUE;
}
3. Build project in Release mode then put the DLL file into C:\Windows\
4. Try to run any application
[*] Evaluation:
- It's very incovenient since the DLL will be called by every single process which imported from user32.dll
Have fun!@
August 9, 2009 at 9:47 PM
Hi, đúng cái đại ka đang cần. Tìm ví dụ trên NET hem có