Getdlgitem (idc_button1)-> showwindow (sw_hide );
Getdlgitem: get the window handle by ID Getdlgitem Function
Applies:Desktop apps only
Retrieves a handle to a control in the specified dialog box.
Syntax C ++
Hwnd winapi getdlgitem (_ in_opt _ hwnd hdlg, _ in _ int niddlgitem );
Parameters
-
Hdlg[IN, optional]
-
Type:Hwnd
A handle to the dialog box that contains the control.
-
Niddlgitem[In]
-
Type:Int
The identifier of the control to be retrieved.
Return Value
Type:Hwnd
If the function succeeds, the return value is the window handle of the specified control.
If the function fails, the return value isNull, Indicating an invalid dialog box handle or a nonexistent control. To get extended error information, callGetlasterror.
Showwindow Function
Applies:Desktop apps only
Sets the specified window's show state.
Syntax C ++
Bool winapi showwindow (_ in _ hwnd, _ in _ int ncmdshow );
Parameters
-
-
Hwnd[In]
-
-
Type:Hwnd
A handle to the window.
-
-
Ncmdshow[In]
-
Type:Int
Controls how the window is to be shown. this parameter is ignored the first time an application CILSShowwindow, If the program that launched the application providesStartupinfoStructure. Otherwise, the first timeShowwindowIs called, the value shocould be the value obtained byWinmainFunction in itsNcmdshowParameter. In subsequent CILS, this parameter can be one of the following values.
Value |
Meaning |
-
Sw_forceminimize
- 11
|
Minimizes a window, even if the thread that owns the window is not responding. This flag shoshould only be used when minimizing windows from a different thread. |
-
Sw_hide
- 0
|
Hides the window and activates another window. |
-
Sw_maximize
- 3
|
Maximizes the specified window. |
-
Sw_minimize
- 6
|
Minimizes the specified window and activates the next top-level window in the Z order. |
-
Sw_restore
- 9
|
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application shocould specify this flag when restoring a minimized window. |
-
Sw_show
- 5
|
Activates the window and displays it in its current size and position. |
-
Sw_showdefault
- 10
|
Sets the show state based on the SW _ value specified inStartupinfoStructure passed toCreateProcessFunction by the program that started the application. |
-
Sw_showmaximized
- 3
|
Activates the window and displays it as a maximized window. |
-
Sw_showminimized
- 2
|
Activates the window and displays it as a minimized window. |
-
Sw_showminnoactive
- 7
|
Displays the window as a minimized window. This value is similarSw_showminimized, Cannot the window is not activated. |
-
Sw_showna
- 8
|
Displays the window in its current size and position. This value is similarSw_show, Could t that the window is not activated. |
-
Sw_shownoactivate
- 4
|
Displays a window in its most recent size and position. This value is similarSw_shownormal, Could t that the window is not activated. |
-
Sw_shownormal
- 1
|
Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application shocould specify this flag when displaying the window for the first time. |
Return Value
Type:
Type:Bool
If the window was previusly visible, the return value is nonzero.
If the window was previusly hidden, the return value is zero.