SetActiveWindow函数可以实现 。 现成的API函数哦。 参数直接写想要激活的窗体的句柄就可以The SetActiveWindow function activates a window. HWND SetActiveWindow( HWND hWnd // handle of window to activate ); ParametershWndIdentifies the top-level window to be activated. Return ValuesIf the function succeeds, the return value is the handle of the window that was previously active. ResThe SetActiveWindow function activates a window, but not if the application is in the background. The window will be brought into the foreground (top of Z order) if the application is in the foreground when it sets the activation. If the window identified by the hWnd parameter was created by the calling thread, the active window status of the calling thread is set to hWnd. Otherwise, the active window status of the calling thread is set to NULL.The SetForegroundWindow window function, on the other hand, activates a window and forces it into the foreground. An application should only call SetForegroundWindow if it needs to display critical errors or information that needs the user's immediate attention .
SetActiveWindow呢
参数直接写想要激活的窗体的句柄就可以The SetActiveWindow function activates a window. HWND SetActiveWindow( HWND hWnd // handle of window to activate
);
ParametershWndIdentifies the top-level window to be activated. Return ValuesIf the function succeeds, the return value is the handle of the window that was previously active. ResThe SetActiveWindow function activates a window, but not if the application is in the background. The window will be brought into the foreground (top of Z order) if the application is in the foreground when it sets the activation.
If the window identified by the hWnd parameter was created by the calling thread, the active window status of the calling thread is set to hWnd. Otherwise, the active window status of the calling thread is set to NULL.The SetForegroundWindow window function, on the other hand, activates a window and forces it into the foreground. An application should only call SetForegroundWindow if it needs to display critical errors or information that needs the user's immediate attention .
PostMessage(Ahandle,WM_SYSCOMMAND,SC_RESTORE,0);
不就行了
这第一次有用,用过后,那个程序就再也不响应最小化消息了 :(
那你换成SendMessage看一下呀。