简体   繁体   中英

Win32/Gdigrab - How to set another process window as borderless?

I am currently using GDIGRAB to capture a window. The problem is, because of the border, the mouse cursor has an offset on its position.

The idea is to put a window as borderless so the offset won't appear anymore. Given the handle of the aimed process, how can I change a window from windowed to borderless ?

Don't tinker with another process' windows. Instead, get the border offset.

HWND window = ...;
RECT wndRect, clientRect;
GetWindowRect(window,&wndRect);
GetClientRect(window,&clientRect);
POINT borderOffset={clientRect.left,clientRect.top};
ClientToScreen(window,&borderOffset);
borderOffset.x-=wndRect.left;
borderOffset.y-=wndRect.top;
// borderOffset now contains the x and y offsets for the window

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM