I'm trying to make an intro form like in the progs of the MS Office Suite. But the intro form is sent to the back.
How do i get it to show up on top instead??
Printable View
I'm trying to make an intro form like in the progs of the MS Office Suite. But the intro form is sent to the back.
How do i get it to show up on top instead??
or you can do thisCode:Form.Show vbModal
Code:Private Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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 Sub Form_Load()
Call SetWindowPos(Me.hWnd, (-1), 0,0,0,0, 3)
End Sub
[Edited by denniswrenn on 09-01-2000 at 10:20 PM]
Use the SetWindowPos API:
Put this in a module:
And this in the Form_Load() event:Code:Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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 SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const HWND_TOPMOST = -1
Public Sub MakeAlwaysOnTop(ByVal hWindow As Long)
SetWindowPos hWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
Hope this helps.Code:Private Sub Form_Load()
MakeAlwaysOnTop Me.hWnd
End Sub