Solved

"Always On Top" API Call

Posted on 1999-01-25
2
344 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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