c# - Resize window without showing window contents -
in windows have setting "show window contents while dragging". when off instead resizing outline of window.
my wpf application has many controls on it, extremely slow resize. there way make application resize showing window outline instead of updating contents?
i found question regarding winforms unfortunately i'm not able adapt wpf. can hook onto hwndsource
, message numbers may have changed in windows 10, if
statement in answer never entered... or there may other things @ work.
also, inside if
calls wndproc
base after has changed system parameter, resetting system parameter when has finished calling it. calling method not option in wpf window
object not have way forward message.
public void onviewloaded() { hwndsource source = hwndsource.fromhwnd( new windowinterophelper(this).handle); source?.addhook(wndproc); } private static intptr wndproc(intptr hwnd, int msg, intptr wparam, intptr lparam, ref bool handled) { if (msg == wm_syscommand && (wparam.toint32() & 0xfff0) == sc_size) { // if never entered int isdragfullwindow; getsystemparametersinfo(spi_getdragfullwindows, 0, out isdragfullwindow, 0); if (isdragfullwindow != 0) setsystemparametersinfo(spi_setdragfullwindows, 0, 0, 0); // how call this? base.wndproc(ref m); if (isdragfullwindow != 0) setsystemparametersinfo(spi_setdragfullwindows, 1, 0, 0); } }
Comments
Post a Comment