Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_THICKFRAME = &H40000
Private Const WS_EX_STATICEDGE = &H20000
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOSIZE = &H1
SetWindowLong Control.hwnd, GWL_STYLE, GetWindowLong(Control.hwnd, GWL_STYLE) Or WS_THICKFRAME
SetWindowLong Control.hwnd, GWL_EXSTYLE, GetWindowLong(Control.hwnd, GWL_EXSTYLE) Or WS_EX_STATICEDGE
SetWindowPos Control.hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_FRAMECHANGED
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_THICKFRAME = &H40000
Private Const WS_EX_STATICEDGE = &H20000
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOSIZE = &H1
Dim Flag As Boolean
Private Sub Form_Load()
' align the pictureboxes inside the big one.
Picture2.Top = 0
Picture2.Left = 0
Picture2.Height = Picture1.ScaleHeight
Picture2.Width = Picture1.ScaleWidth / 2
Picture3.Top = 0
Picture3.Left = Picture1.ScaleWidth - Picture2.Width
Picture3.Height = Picture1.ScaleHeight
Picture3.Width = Picture2.Width
' set the 2 boxes to be sizeable
SetWindowLong Picture2.hwnd, GWL_STYLE, GetWindowLong(Picture2.hwnd, GWL_STYLE) Or WS_THICKFRAME
SetWindowLong Picture2.hwnd, GWL_EXSTYLE, GetWindowLong(Picture2.hwnd, GWL_EXSTYLE) Or WS_EX_STATICEDGE
SetWindowPos Picture2.hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_FRAMECHANGED
SetWindowLong Picture3.hwnd, GWL_STYLE, GetWindowLong(Picture3.hwnd, GWL_STYLE) Or WS_THICKFRAME
SetWindowLong Picture3.hwnd, GWL_EXSTYLE, GetWindowLong(Picture3.hwnd, GWL_EXSTYLE) Or WS_EX_STATICEDGE
SetWindowPos Picture3.hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_FRAMECHANGED
' set the flag
Flag = True
End Sub
Private Sub Picture2_Resize()
If Flag = False Then Exit Sub
' If they changed the wrong part of the window, run the other resize routine to cancel.
If Not (Picture2.Left = 0) Or Not (Picture2.Top = 0) Or Not (Picture2.Height = Picture1.ScaleHeight) Then
Call Picture3_Resize
Exit Sub
End If
' Resize Picture 3 to fit. Set the flag to keep pic3 resize from firing and going into a loop.
Flag = False
Picture3.Top = 0
Picture3.Height = Picture1.ScaleHeight
Picture3.Left = Picture2.Width
Picture3.Width = Picture1.ScaleWidth - Picture2.Width
' reset the flag
Flag = True
End Sub
Private Sub Picture3_Resize()
If Flag = False Then Exit Sub
' If they changed the wrong part of the window, run the other resize routine to cancel.
If Not (Picture3.Left = Picture1.ScaleWidth - Picture3.Width) Or Not (Picture3.Top = 0) Or Not (Picture3.Height = Picture1.ScaleHeight) Then
Call Picture2_Resize
Exit Sub
End If
' Resize Picture 2 to fit. Set the flag to keep pic2 resize from firing and going into a loop.
Flag = False
Picture2.Left = 0
Picture2.Top = 0
Picture2.Height = Picture1.ScaleHeight
Picture2.Width = Picture1.ScaleWidth - Picture3.Width
' reset the flag
Flag = True
End Sub