Make a Form Stay on Top

Make a Form Stay on Top

You can make a form always remain above others, even when it does not have focus. Use this code in a BAS module:

 #If Win16 Then	Declare Sub SetWindowPos Lib "User" ( _		ByVal hWnd As Integer, _		ByVal hWndInsertAfter As Integer, _		ByVal X As Integer, ByVal Y As Integer, _		ByVal cx As Integer, ByVal cy As Integer, _		ByVal wFlags As Integer)#Else	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#End IfPublic Const SWP_NOMOVE = &H2Public Const SWP_NOSIZE = &H1Public Const HWND_TOPMOST = -1Public Const HWND_NOTOPMOST = -2

Use this code to make the form stay on top in the form module:

 SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, _	SWP_NOMOVE + SWP_NOSIZE

Use this code to make the form no longer stay on top in the form module:

 SetWindowPos Parent.hwnd, HWND_NOTOPMOST, _	 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE

In 16-bit systems, use the 16-bit equivalents.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved