这个函数怎么用??(50分)

  • 主题发起人 主题发起人 咪咪富翁
  • 开始时间 开始时间

咪咪富翁

Unregistered / Unconfirmed
GUEST, unregistred user!
&nbsp;我用 findwindow和setforegroundwindow已经做到了防止运用程序二次运行,<br>但是怎么样让获得焦点我的程序,重新弹出呢??像金山词霸那样
 
用ShowWindow就可以啦...<br>BOOL ShowWindow(<br><br>&nbsp; &nbsp; HWND hWnd, // handle of window<br>&nbsp; &nbsp; int nCmdShow // show state of window<br>&nbsp; &nbsp;); <br>&nbsp;<br><br>Parameters<br><br>hWnd<br><br>Identifies the window. <br><br>nCmdShow<br><br>Specifies how the window is to be shown. This parameter is ignored the first time an application calls ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinMain function in its nCmdShow parameter. In subsequent calls, this parameter can be one of the following values: <br><br>Value Meaning<br>SW_HIDE Hides the window and activates another window.<br>SW_MAXIMIZE Maximizes the specified window.<br>SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order.<br>SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.<br>SW_SHOW Activates the window and displays it in its current size and position. <br>SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. <br>SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.<br>SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.<br>SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.<br>SW_SHOWNA Displays the window in its current state. The active window remains active.<br>SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.<br>SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
 
接受答案了.
 
后退
顶部