|
SetWindowDisplayAffinity(hWnd, WDA_EXCLUDEFROMCAPTURE);
使用此API 可以禁止指定窗口被截图, 普通窗口或者透明窗口 都可以;
经过测试, QQ截图无法截取到窗口, 截取的是窗口背后地内容;
- int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
- {
- XInitXCGUI(TRUE);
- HWINDOW hWindow = XWnd_Create(0, 0, 300, 300, L"炫彩界面库窗口", NULL);
- XWnd_ShowWindow(hWindow, SW_SHOW);
- HIMAGE hImage1 = XImage_LoadFile(L"image\\bk.png");
- XWnd_AddBkImage(hWindow, window_state_flag_leave, hImage1);
- XWnd_SetTransparentType(hWindow, window_transparent_shaped);
- HWND hWnd = XWnd_GetHWND(hWindow);
- SetWindowDisplayAffinity(hWnd, WDA_EXCLUDEFROMCAPTURE); //禁止截图
- XRunXCGUI();
- XExitXCGUI();
- return 0;
- }
复制代码
|
|