Solved

Window On Top question

Posted on 1998-11-23
9
170 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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