Solved

"Always On Top" API Call

Posted on 1999-01-25
2
342 Views
Last Modified: 2010-05-18
Anyone know a "Always On Top" API Call?
0
Comment
Question by:VBKid
2 Comments
 
LVL 2

Accepted Solution

by:
sbmc earned 50 total points
ID: 1470639
Option Explicit
                Public Const SWP_NOMOVE = 2
                Public Const SWP_NOSIZE = 1
                Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
                Public Const HWND_TOPMOST = -1
                Public Const HWND_NOTOPMOST = -2

                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 Function SetTopMostWindow(hwnd As Long,  Topmost As Boolean) As Long
If Topmost = True Then 'Make the window topmost
  SetTopMostWindow =  SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, _ 0, FLAGS) Else
  SetTopMostWindow = SetWindowPos(hwnd,  HWND_NOTOPMOST, 0, 0, 0, 0,FLAGS)   SetTopMostWindow = False
End If
End Function
0
 

Author Comment

by:VBKid
ID: 1470640
I'm pretty sure that your answer will work I just want to know how you use it!
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’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

11 Experts available now in Live!

Get 1:1 Help Now