

Private Const WS_EX_TRANSPARENT As Long = &H20& Private Const WS_EX_TOPMOST As Long = &H8& Private Const WS_EX_NOPARENTNOTIFY As Long = &H4& Private Const WS_EX_DLGMODALFRAME As Long = &H1& Private Const WS_EX_ACCEPTFILES As Long = &H10& Private Const WS_DLGFRAME As Long = &H400000 Private Const WS_DISABLED As Long = &H8000000 Private Const WS_CLIPSIBLINGS As Long = &H4000000 Private Const WS_CLIPCHILDREN As Long = &H2000000 Private Const WS_CHILDWINDOW As Long = (WS_CHILD) Private Const WS_CHILD As Long = &H40000000 Private Const WS_CAPTION As Long = &HC00000 ' WS_BORDER Or WS_DLGFRAME Private Const WS_BORDER As Long = &H800000 Private Const WS_SYSMENU As Long = &H80000 Private Const WS_MINIMIZEBOX As Long = &H20000 Private Const WS_MINIMIZE As Long = &H20000000 Private Const WS_MAXIMIZEBOX As Long = &H10000 Private Const WS_MAXIMIZE As Long = &H1000000 Private Const WS_THICKFRAME As Long = &H40000 Private Const WS_TABSTOP As Long = &H10000 Private Const WS_VSCROLL As Long = &H200000 Private Const WS_VISIBLE As Long = &H10000000 RgbReserved(32) As Byte 'this was declared incorrectly in VB API viewer Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long Private Declare Function GetClientRect Lib "user32" (ByVal lhwnd As Long, lpRect As RECT) As Long Private Declare Function EndPaint Lib "user32" (ByVal lhwnd As Long, lpPaint As PAINTSTRUCT) As Long Private Declare Function BeginPaint Lib "user32" (ByVal lhwnd As Long, lpPaint As PAINTSTRUCT) As Long Private Declare Sub PostQuitMessage Lib "user32" (ByVal nExitCode As Long) Private Declare Function DispatchMessage Lib "user32" Alias "DispatchMessageA" (lpMsg As MSG) As Long Private Declare Function TranslateMessage Lib "user32" (lpMsg As MSG) As Long Private Declare Function GetMessage Lib "user32" Alias "GetMessageA" (lpMsg As MSG, ByVal lhwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long Private Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (ByVal lhwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal lhwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Declare Function SetFocus Lib "user32" (ByVal lhwnd As Long) As Long Private Declare Function UpdateWindow Lib "user32" (ByVal lhwnd As Long) As Long Private Declare Function ShowWindow Lib "user32" (ByVal lhwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function RegisterClassEx Lib "user32" Alias "RegisterClassExA" (pcWndClassEx As WNDCLASSEX) As Integer

Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As String) As Long Private Declare Function LoadIcon Lib "user32" Alias "LoadIconA" (ByVal hInstance As Long, ByVal lpIconName As String) As Long Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
#API VBA SHOWWINDOW CODE#
The code demonstrates several useful techiques including subclassing. Note, on NT/2000 machines VBA programmers can replace App.hInstance with the value 0&.
#API VBA SHOWWINDOW HOW TO#
The following code demonstrates how to create a form and a two labels using only API calls.
#API VBA SHOWWINDOW WINDOWS#
Visual Basic Programming Code Examples Visual Basic > API and Miscellaneous Code Examples Creating windows and controls using API calls Creating windows and controls using API calls
