#include <windows.h>
typedef int(__stdcall *pMessageBoxA)(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
using pFnMessageBoxA = int(__stdcall *)(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType);
int main()
{
pMessageBoxA MessageBoxA1 = (pMessageBoxA)GetProcAddress(LoadLibraryA("User32.dll"), "MessageBoxA");
pFnMessageBoxA MessageBoxA2 = (pFnMessageBoxA)GetProcAddress(LoadLibraryA("User32.dll"), "MessageBoxA");
MessageBoxA1(NULL, "test1", "test", 0);
MessageBoxA2(NULL, "test2", "test", 0);
return 0;
}
原文地址:https://www.cnblogs.com/Lnju/p/10666794.html
时间: 2024-10-05 18:19:44