www.pudn.com > DLL.rar > DLL.CPP, change:2009-08-17,size:601b


#include "windows.h" 
BOOL WINAPI  DllMain( 
    HINSTANCE  hModule, 
    DWORD  dwReason, 
    LPVOID  lpvReserved 
) 
{ 
	::MessageBox(NULL,"已连接到DLL,根据条件执行操作!","",MB_OK); 
	switch(dwReason) 
	{ 
		case DLL_PROCESS_ATTACH: 
			::MessageBox(NULL,"PROCESS_ATTACH","提示",MB_OK); 
			break; 
		case DLL_PROCESS_DETACH: 
			::MessageBox(NULL,"PROCESS_DETACH","提示",MB_OK); 
			break; 
		case DLL_THREAD_ATTACH: 
			::MessageBox(NULL,"THREAD_ATTACH","提示",MB_OK); 
			break; 
		case DLL_THREAD_DETACH: 
			::MessageBox(NULL,"THREAD_DETACH","提示",MB_OK); 
			break; 
	} 
	 
	return TRUE; 
}