I need help keeping my form ontop, I know code is pretty much similar but I can't get the difference. What sucks is I had it, and said im never gonna use vb3.0 again so erased it!!! Arghhh, if ya can help drop a reply. Thanks!
Printable View
I need help keeping my form ontop, I know code is pretty much similar but I can't get the difference. What sucks is I had it, and said im never gonna use vb3.0 again so erased it!!! Arghhh, if ya can help drop a reply. Thanks!
I had to use Strings instead of Booleans because I dont think VB3 supports Boolean Variables.Code:' in a module
Declare Sub SetWindowPos Lib "User" (ByVal hWnd%, ByVal hWndInsertAfter%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal wFlags%)
Const HWND_NOTOPMOST = -2
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOACTIVATE = &H10
Const HWND_TOPMOST = -1
Sub OnTop(frm As Form, blnTF$)
If blnTF = "True" Then
SetWindowPos frm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE
Else
SetWindowPos frm.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE
End If
End Sub
' in form_load
ontop Me, "True"