Solved

always on top form?

Posted on 2002-06-27
5
187 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 49

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

760 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

20 Experts available now in Live!

Get 1:1 Help Now