#include <windows.h>
#include <iostream>
typedef BOOL(*CaptureRegionFn)(int, int, int, int, const char*);
typedef BOOL(*CaptureWindowFn)(HWND, const char*);
int main() {
HMODULE hDll = LoadLibrary("ScreenCaptureDLL.dll");
if (!hDll) return -1;
CaptureRegionFn fn = (CaptureRegionFn)GetProcAddress(hDll, "CaptureRegion");
if (fn) {
BOOL ok = fn(100, 100, 400, 400, "test.bmp");
if (ok) {
MessageBox(NULL, "截图成功!", "提示", MB_OK);
}
}
FreeLibrary(hDll);
return 0;
}
import ctypes
dll = ctypes.CDLL("ScreenCaptureDLL.dll")
dll.CaptureRegion.argtypes = [ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_char_p]
dll.CaptureRegion.restype = ctypes.c_bool
ok = dll.CaptureRegion(100, 100, 400, 400, b"test.bmp")
print("成功:", ok)
5.87 KB, 下载次数: 1, 下载积分: 精币 -2 枚
5.87 KB, 下载次数: 2, 下载积分: 精币 -2 枚




| 欢迎光临 精易论坛 (https://bbs.ijingyi.com/) | Powered by Discuz! X3.4 |