VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



With very few lines of code you can make any form go full-screen covering all other applications, t

by Joshua Carroll (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 26th September 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

With very few lines of code you can make any form go full-screen covering all other applications, the task-bar, etc.

API Declarations



Public 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
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_INSERTONLY = SWP_NOMOVE Or SWP_NOSIZE
Public Const SWP_SHOWWINDOW = &H40
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const HWND_BOTTOM = 1
Public Const HWND_TOP = 0

Public Enum enmPosition
posTop = HWND_TOP
posBottom = HWND_BOTTOM
posTopMost = HWND_TOPMOST
posNoTopMost = HWND_NOTOPMOST
End Enum


Rate With very few lines of code you can make any form go full-screen covering all other applications, t



    Me.OnTop = posTopMost
    Me.Height = Screen.Height
    Me.Width = Screen.Width
    Me.Top = 0
    Me.Left = 0
End Sub

Public Property Let OnTop(Setting As enmPosition)
  SetWindowPos hwnd, Setting, 0, 0, 0, 0, SWP_SHOWWINDOW Or SWP_INSERTONLY
End Property

Download this snippet    Add to My Saved Code

With very few lines of code you can make any form go full-screen covering all other applications, t Comments

No comments have been posted about With very few lines of code you can make any form go full-screen covering all other applications, t. Why not be the first to post a comment about With very few lines of code you can make any form go full-screen covering all other applications, t.

Post your comment

Subject:
Message:
0/1000 characters