(1)设置鼠标的所在的Wnd:
函数定义(window.h文件中定义的):
MG_EXPORT HWND GUIAPI GetCapture(void); //Retrives the handle to the window (if any) that has captured the mouse.return The handle to the window that has captured the mouse, 0 for no window captures the mouse.
Only one window at a time can capture the mouse; this window receives mouse input whether or not the cursor is within its borders.
MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd);//Sets the mouse capture to the specified window. param hWnd The handle to the window.return The old capture window. Once a window has captured the mouse, all mouse input is directed to that window, regardless of whether the cursor is within the borders of that window. Only one window at a time can capture the mouse.
MG_EXPORT void GUIAPI ReleaseCapture(void); //Releases the mouse capture from a window and restores normal mouse input processing
例如:
printf("hjhe--hwnd=%x\n",hWnd);
printf("hjhe--getCapture=%x\n",GetCapture());
SetCapture(hWnd);
printf("hjhe--1 getCapture=%x\n",GetCapture());
返回值为:
hjhe--hwn