Return to Index
created by gbSnippets
'There are essentially 5 parts to creating a window:
'A data structure is filled out with the window properties and the CreateWindowEx
'API is used to register the window, then the ShowWindow/UpdateWindow API are used
'to display the window. A message loop keeps the window on the screen and a message
'function is used to respond to messages sent to the window (including sending a
'PostQuitMessage() to end the message loop and close the application.
4. Message Loop
5. Message Response
'Once the window has been defined and registered, it does not become visible. Use the
'ShowWindow API to specify how the window will be shown, and the UpdateWindow causes
'the window to be drawn on the screen.
ShowWindow hWnd, iCmdShow 'set display mode
UpdateWindow hWnd 'display the window on the screen
'Updates the client area by sending a WM_PAINT message to the window.
'The return value of ShowWindow is zero, if the window was previously hidden, or nonzero
'if the window was previously visible. The following iCmdShow values are supported.
SW_FORCEMINIMIZE - Minimizes a Window, even If the Thread that owns the Window is Not responding
SW_HIDE - Hides the Window AND activates another Window.
SW_MAXIMIZE - Maximizes the specified Window.
SW_MINIMIZE - Minimizes the specified Window AND activates the Next top-level Window in the Z order
SW_RESTORE - Activates AND displays the Window. If minimized Or maximized, is restored to original Size AND position
SW_SHOW - Activates the Window AND displays it in its current Size AND position
SW_SHOWDEFAULT - Sets Show State using SW_ value specified in the STARTUPINFO structure passed to CreateProcess
SW_SHOWMAXIMIZED - Activates the Window AND displays it as a maximized Window
SW_SHOWMINIMIZED - Activates the Window AND displays it as a minimized Window
SW_SHOWMINNOACTIVE - Displays the Window as a minimized Window. Window is Not activated
SW_SHOWNA - Displays the Window in its current Size AND position. Window is Not activated
SW_SHOWNOACTIVATE - Displays a Window in its most recent Size AND position. Window is Not actived
SW_SHOWNORMAL - Activates AND displays a Window. If minimized Or maximized, is resotred to original Size AND position
created by gbSnippets