[vb6.0/vba] 창 최대화 - Maximize the window

하나를하더라도최선을 2020-02-20 19:35:33 30,396 0 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 StringByVal lpWindowName As StringAs 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 StringByVal lpWindowName As StringAs 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개

첫 번째 댓글을 작성해보세요!