[vb6.0/vba] [vb6.0/vba] 창 최대화 - Maximize the window
하나를하더라도최선을
2020-02-20 19:35
3,752
0
본문
Private Const SW_MAXIMIZE As Long = 3
#If VBA7 Then
Private Declare PtrSafe Function ShowWindow Lib "USER32" _
(ByVal hwnd As LongPtr, ByVal nCmdShow As Long) As Boolean
Private Declare PtrSafe Function FindWindow Lib "USER32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
#Else
Private Declare Function ShowWindow Lib "USER32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Boolean
Private Declare Function FindWindow Lib "USER32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
#End If
Public Sub MaximizeWindow(ByVal WindowTitle As String)
#If VBA7 Then
Dim hwnd As LongPtr
#Else
Dim hwnd As Long
#End If
hwnd = FindWindow(vbNullString, WindowTitle)
If hwnd <> 0 Then
Call ShowWindow(hwnd, SW_MAXIMIZE)
End If
End Sub
댓글목록0