CodeItBetter Programming Another VB Programming Blog

How to maximize the screen regardless of the resolution changes.

Posted on December 18, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'System & API - How to maximize the screen regardless of the resolution changes.
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" _
    (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
 
Private Const SPI_GETWORKAREA As Long = 48
 
Private Type RECT
    lLeft As Long
    lTop As Long
    lRight As Long
    lBottom As Long
End Type
 
Private Sub Form_Load()
    Dim deskRECT As RECT
    Call SystemParametersInfo(SPI_GETWORKAREA, 0&, deskRECT, 0&)
    With deskRECT
        Me.Move .lLeft * Screen.TwipsPerPixelX, .lTop * Screen.TwipsPerPixelX, _
            (.lRight - .lLeft) * Screen.TwipsPerPixelX, (.lBottom - .lTop) * Screen.TwipsPerPixelX
    End With
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.