Click to See Complete Forum and Search --> : Always on Top
Cs30Man
May 2nd, 2001, 12:38 PM
How do i get my program fullscreen and on top of the startmenu?? (without useing directx)
Vlatko
May 2nd, 2001, 01:25 PM
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)
Private Sub Form_Activate()
'Set the window position to topmost
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub
Megatron
May 2nd, 2001, 04:59 PM
You can shorten your code down to:
Private Declare Sub 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)
Private Sub Form_Activate()
'Set the window position to topmost
SetWindowPos Me.hWnd, -1, 0, 0, 0, 0, 3
End Sub
Megatron
May 2nd, 2001, 05:02 PM
I'm not sure with regard to full screen apps, but what you could do is set the BorderStyle to 0-None and set the WindowState to 2-Maximized.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.