Solved

always on top form?

Posted on 2002-06-27
5
196 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
[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
5 Comments
 
LVL 6

Accepted Solution

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

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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.
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…
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…

705 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