Solved

"Always On Top" API Call

Posted on 1999-01-25
2
345 Views
Last Modified: 2010-05-18
Anyone know a "Always On Top" API Call?
0
Comment
Question by:VBKid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
String manipulation in Visual Basic 7 84
Determine Range to Select 5 56
Set WorkSheet  not Working 9 52
how to loop through and process two columns in excel 8 53
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

726 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