Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Window On Top question

Posted on 1998-11-23
9
Medium Priority
?
172 Views
Last Modified: 2010-04-04
Is there a better way to alter a form between 'StayOnTop' and 'Normal'. I ams setting the forms formstyle property to fsstayontop or fsnormal but I get an anoying flicker when I do this.... Anyone know of a way to toggle between states without flicker?
0
Comment
Question by:davegreen
[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
  • 6
  • 2
9 Comments
 

Author Comment

by:davegreen
ID: 1347720
I just read in the Delphi help that it is inadvisable to alter formstyle at runtime. Many programs let you change between stayontop and normal at run time... Whats the best way?

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1347721
Try using LockWindowUpdate(Form.Handle) before changing it and LockWindUpdate(0) after changing it.

I am not 100% sure if this will work but its worth a try...

Cheers,

Raymond.
0
 

Author Comment

by:davegreen
ID: 1347722
I tried this one... this on win98 has the side effect of making all icons flash on the desktop, plus the form still flashes :(

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 20

Expert Comment

by:Madshi
ID: 1347723
Try using SetWindowPos with HWND_NOTOPMOST and HWND_TOPMOST...

Regards, Madshi.
0
 

Author Comment

by:davegreen
ID: 1347724
Thanks Madshi... any idea what unit I need to include in the uses clause?
0
 

Author Comment

by:davegreen
ID: 1347725
Madshi, have you got an example of its use. I tried SetWindowPos(hwnd,HWND_TOPMOST,1,1,1,1,SWP_NOMOVE + SWP_NOSIZE) but it fails to compile... any ideas?

0
 

Author Comment

by:davegreen
ID: 1347726
Madshi,
Well, I'm stupid.. as you can see I should have used handle instead of hwnd and it would have compiled.

Anyway.. it WORKS!  .. no flicker!
Answer the question... the points are yours.
Thanks Matshi for pointing me in this direction. :)

0
 
LVL 20

Accepted Solution

by:
Madshi earned 400 total points
ID: 1347727
Great, that it works. Was not sure about it...  :-)

Thanx for the points...

Regards, Madshi.
0
 

Author Comment

by:davegreen
ID: 1347728
Thanks again Madshi :)

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

704 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