|
-
Oct 30th, 2000, 09:55 AM
#1
Thread Starter
Lively Member
Can anyone help me make my program be on the top of all the other programs?
Windows XP Professional
Microsoft Visual Basic 6.0 Professional
-
Oct 30th, 2000, 10:01 AM
#2
Fanatic Member
Option Explicit
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 SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_SHOWWINDOW = &H40
Private Const SWP_NOACTIVATE = &H10
Public Enum WindowPos
vbtopmost = -1&
vbNotTopMost = -2&
End Enum
Public Sub SetFormPosition(hWnd As Long, Position As WindowPos)
Const wFlags As Long = SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW Or SWP_NOACTIVATE
If Position = vbtopmost Or Position = vbNotTopMost Then
SetWindowPos hWnd, Position, 0, 0, 0, 0, wFlags
End If
End Sub
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Oct 31st, 2000, 06:58 PM
#3
Lively Member
SetForegroundWindow
I know two ways of doing that.
1. Me.Zorder
2. Public Declare Function SetForegroundWindow lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
SetForegroundWindow(Me.Hwnd)
Hope will be helpful..
While YourAge<=40
Live(YourLife)
Wend
-
Oct 31st, 2000, 07:50 PM
#4
Re: SetForegroundWindow
Originally posted by iataman
I know two ways of doing that.
1. Me.Zorder
2. Public Declare Function SetForegroundWindow lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As Long) As Long
SetForegroundWindow(Me.Hwnd)
Hope will be helpful..
Me.ZOrder will only putit on top of other forms and not other programs. This won't keep it on top.
SetForegroundWindow api function will only give the program focus putting it on top, but will not keep it on top either.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|