I was reading the topic
http://www.vbforums.com/showthread.php?t=588169
by RobDogg888 but I'm unable to get this code to work with my applications.
I am often confused as to where to place this code. I placed:
In my Module file and place the rest of the code in the actual Userform, is this correct or incorrect?Code:Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long 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 HWND_TOPMOST = -1 Private Const HWND_NOTOPMOST = -2 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private mlHwnd As Long
I'm just trying to make a very basic program to help me at work but need it to be able to toggle always on top.
Any help would be great!




Reply With Quote