Solved

always on top form?

Posted on 2002-06-27
5
192 Views
Last Modified: 2010-05-02
how can i create form which is displaied always on top
no other application can not hide any part of this form

like winamp and winzip
0
Comment
Question by:Bhawin
5 Comments
 
LVL 6

Accepted Solution

by:
marconovaro earned 20 total points
ID: 7115699
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7115701
See this:
Creating a 'Topmost' Window:
http://www.mvps.org/vbnet/faq/main/topmost.htm

cheers
0
 

Expert Comment

by:Lasseman
ID: 7115704
Hi there!

The API-call 'SetWindowPos' can take care of this for you.

This function is declared as follows:

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

What you do here is send the handle to the form (its hwnd property) to the function and along with the constant HWND_TOPMOST for the hWndInsertAfter parameter.

Const HWND_TOPMOST = -1

The x, y, cx and cy values takes care of positioning and sizing, respectively. wFlags handles flags for positioning and resizing. For instance, the constant:

Const SWP_SHOWWINDOW = &H40

merely shows the window. The constant

Const SWP_NOSIZE = &H1

ignores the values of cx and cy, and keeps the original size of the window.

Enjoy

//Lasseman

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7964644
Hi Bhawin,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept marconovaro's comment(s) as an answer.

Bhawin, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 8014899
Per recommendation, force-accepted.

Netminder
EE Admin
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

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 …
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

808 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