Reputation: 33
Basically what my program does is search through window handles by comparing text from GetWindowText win32 api call. It then creates and saves that window to image. It's all working correctly; however the window I need must be in a maximized or normal state. The program can capture it even if the window is open in the background or off screen. My question is, is there a way to open a windows based on the handle, but keep the window in the background? I've been able to return the required window to normal state with ShowWindow(int handle, int state) but that sets focus to the window too.
Just had the thought... Good idea to save current active handle, call ShowWindow() and then return focus to saved window?
Upvotes: 0
Views: 583
Reputation: 941208
Not that clear, let's focus on ShowWindow(). Use the SW_SHOWNOACTIVATE option to prevent the window from getting activated.
Upvotes: 1