Open N3verL4nd opened 7 years ago
因为你没有初始化 gdiplus,链接时加上 gdiplus.lib
#include "pch.h"
#include <iostream>
#include <Windows.h>
#include <gdiplus.h>
using namespace Gdiplus;
int (__cdecl *PrScrn) ();
int main()
{
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
HMODULE PrScrnLib = LoadLibraryA("PrScrn.dll");
PrScrn = (int(*)())GetProcAddress(PrScrnLib, "PrScrn");
PrScrn();
FreeLibrary(PrScrnLib);
GdiplusShutdown(gdiplusToken);
return 0;
}
`#include
include
typedef int (*fun)(void);
int main() { HINSTANCE hDll = LoadLibrary("PrScrn.dll"); fun f = (fun)GetProcAddress(hDll, "PrScrn"); f(); FreeLibrary(hDll); return 0; } `
rundll32 PrScrn.dll PrScrn 也是一样