Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

Winpopup Plus

Browsing WindowOnTopMod.bas (737 B)

Attribute VB_Name = "WindowOnTopMod"
Option Explicit

Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2

Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1

Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40

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

Public Sub AlwaysOnTop(frmObject As Form, bOnTop As Boolean)
Dim wFlag As Long
If bOnTop Then
wFlag = HWND_TOPMOST
Else
wFlag = HWND_NOTOPMOST
End If
SetWindowPos frmObject.hwnd, wFlag, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_NOMOVE Or SWP_NOSIZE
End Sub


Download WindowOnTopMod.bas

Back to file list


Back to project page