In this article we will explain how to keep an application window on top of other applications with VB6.
How to keep application window on top of other apps in a general module?
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 HWND_TOPMOST = -1 Public Const HWND_NOTOPMOST = -2 Public Const SWP_NOACTIVATE = &H10 Public Const SWP_SHOWWINDOW = &H40 Public Const SWP_NOMOVE = 2 Public Const SWP_NOSIZE = 1
How to keep application window on top of other apps in the form?
Private Sub Form_Load() Dim R as long R = SetWindowPos(SheetName.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) end sub
How to call the function?
The function must call upon the activation of the form. It will allow the program to resume the function if the form is selected (as the function may be used by other application).
Private Sub Form_Activate() Dim R as long R = SetWindowPos(SheetName.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) end sub
How to remove priority?
Private sub SuppPriority() Dim R as long R= SetWindowPos(NomFeuille.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) End sub
- Vb6 form always on top
- Vb6 always on top
- Vb6 setwindowpos
- Facebook's official investigation form > Guide
- We can’t give you access to this account or help with your request until we receive an accepted form of id that matches the info > Forum - Facebook
- Facebook id confirmation [solved] > Forum - Facebook
- Login approvals code issues facebook form [solved] > Forum - Facebook
- Security checks preventing login form > Forum - Facebook
- What are Accessors and Mutators C++
- My Documents + Environment Variables in VBA/VB6
- Programming: quotation marks, apostrophes and strings
- C++ open url: in default browser
- Remove the underline from links in HTML, CSS
- How to draw a human face using code?
- VB6 RGB color: chart, codes
- How to calculate square root in C programming
- How to write and read CSV files in Python
- The best free online programming courses