Solved

forms that stay always on top

Posted on 1998-08-03
2
188 Views
Last Modified: 2010-05-03
How do I create a form that is always on top, even when other applications (e.g. MSWord) have the focus ?
I have tried the "MyForm.Show 0, ParentForm" but this, of course, works only with its parent form.

Any ideas ?
Thanks in advance.
0
Comment
Question by:HiThere
2 Comments
 

Accepted Solution

by:
luvbox earned 50 total points
ID: 1467550
Declare Function SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal
hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal
cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer


Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2

'Put global constants in bas module.

'To set the form XXXX to TOPMOST, use the following code:

success% = SetWindowPos (XXXX.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
success% <> 0 When Successful

'To reset the form XXXX to NON-TOPMOST, use the following

success% = SetWindowPos (XXXX.hWnd,HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
success% <> 0 When Successful




0
 
LVL 1

Author Comment

by:HiThere
ID: 1467551
Many thanks !
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…

758 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

24 Experts available now in Live!

Get 1:1 Help Now