c# - How to detect if SetForegroundWindow changes screen resolution? -


i writing alt+tab replacement in c#, , have trouble fullscreen applications.

is there way detect if setforegroundwindow(hwnd) call going change screen resolution? or equivalently, if hwnd fullscreen application? wait until resolution change done, or if there no change, proceed immediately.

the screen resolution change done asynchronously, function call returns before happens, code runs prematurely, , draws application onto surface of fullscreen application, wrong dimensions, after resolution change, looks ugly.

source of application @ https://bitbucket.org/frigocoder/frigotab/src if interested.

to clarify, more interested in knowing beforehand if resolution change occurs detecting later. know half-solution call setforegroundwindow() on getdesktopwindow() or other window , watch systemevents.displaysettingschanging , displaysettingschanged. gives me late asynchronous notification if resolution change occurs, , not tell me if not.

perhaps winforms event sizechanged can you.

you use event continuation of sorts rest of code. in case event doesn't fire due no resizing, have secondary continuation run after specified timeout. it's not perfect, may meet needs.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -