?
Solved

always on top form?

Posted on 2002-06-27
5
Medium Priority
?
211 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 80 total points
ID: 7115699
0
 
LVL 54

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

807 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