Solved

Makeing a form always on top.

Posted on 1998-10-04
6
148 Views
Last Modified: 2010-04-30
I want to have a form that is always ontop... like icq or winamp. how do i do this
0
Comment
Question by:hess
6 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 10 total points
ID: 1438044
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

SetWindowPos frmTools.hwnd, -1, 0, 0, 0, 0, 3
0
 

Author Comment

by:hess
ID: 1438045
where do i put this code
0
 

Author Comment

by:hess
ID: 1438046
where do i put this code
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Expert Comment

by:viktornet
ID: 1438047
How about this ???

SetForegroundWindow(Me.hWnd) 'API call...find it in the help file...

Maybe try putting it in a Timer's OnTimer() event...
0
 

Expert Comment

by:janeausten
ID: 1438048
Hess,

put it in your Form_Load, like so

Private Sub Form_Load()
    'sets form to be always on top
    'SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
   
End Sub


hope this helps
0
 

Author Comment

by:hess
ID: 1438049
got it thanx
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now