void WINAPI SwitchToThisWindow ( HWND hWnd, // Handle to the window that should be activated BOOL bRestore // Restore the window if it is minimized ); typedef void (WINAPI *LPSWITCHTOTHISWINDOW)(HWND, BOOL); LPSWITCHTOTHISWINDOW lpfnSwitchToThisWindow;lpfnSwitchToThisWindow = (LPSWITCHTOTHISWINDOW) GetProcAddress( GetModuleHandle(_T("user32")), _T("SwitchToThisWindow") );
SetForefroundWindow()
吧
但并没有active
怎么办?
HWND hWnd, // Handle to the window that should be activated
BOOL bRestore // Restore the window if it is minimized
); typedef void (WINAPI *LPSWITCHTOTHISWINDOW)(HWND, BOOL); LPSWITCHTOTHISWINDOW lpfnSwitchToThisWindow;lpfnSwitchToThisWindow = (LPSWITCHTOTHISWINDOW) GetProcAddress( GetModuleHandle(_T("user32")), _T("SwitchToThisWindow") );
SetWindowPos(&wndTopMost,0,0,0,0,SW_NOSIZE|SW_NOMOVE);