c# - How to use EVENT_SYSTEM_MOVESIZESTART with WinEventProc as global window locationchange/resize event? -
i'm trying catch move , resize event globally. found way use event_system_movesizestart event via win32 api wineventproc (actually i'm using c# p/invoke). couldn't find detail information it. have questions:
q1. there way distinguish move or resize when raised event_system_movesizestart event, without polling window size/location.
public static void __wineventdelegate(intptr hwineventhook, native.event eventtype, intptr hwnd, native.objid idobject, native.childid idchild, uint dweventthread, uint dwmseventtime) { if (eventtype == native.event.system_movesizestart) { switch (__something__) { case __this_event_is_move: dosomethingwhenmovestarted(); break; case __this_event_is_resize: dosomethingwhenresizestarted(); break;(imho, windows not distinguish them internally...?)
q2. there event or way event_system_movingresizing, raised continuously, mousemove event on javascript/dom?
if have way q1,q2, let me know please! thanks.
the event specified event_system_movesizestart sent system.
i doubt event recognized defwindowproc.
but during scenario, guess window receives wm_entersizemove.
then can handle in case statement of overridden window procedure function.
the wparam specifies sc_move or sc_size value, identify whether move or resize.
below pseudo code:
lresult callback wndproc(hwnd hwnd, uint message, wparam wparam, lparam lparam) { switch (message) { case wm_entersizemove: if(wparam == sc_move) { //move } else { //resize } default: //call default winproc } } as saying c#, there events associated wm_entersizemove , wm_exitsizemove in system.windows.forms. resizebegin , resizeend. little unsure if these events can handle move.
Comments
Post a Comment