Solved

"Always On Top" API Call

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
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 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…

815 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

9 Experts available now in Live!

Get 1:1 Help Now