DLL基础(2) 参数传递
//msgbox_arg.cpp
#include<windows.h>
extern "C" _declspec(dllexport) void __cdecl msgbox(HWND hwnd,HINSTANCE hinst, LPSTR lpszCmdLine,int nCmdShow);
void msgbox(HWND hwnd,HINSTANCE hinst, LPSTR lpszCmdLine,int nCmdShow)
{
MessageBox(NULL,lpszCmdLine,"test",MB_OK);
}
//rundll32.exe msgbox_arg.dll,msgbox 123
DLL入口(DllMain entry point)
DllMain
原型
BOOL WINAPI DllMain(
_In_ HINSTANCE hinstDLL