Solved

Window On Top question

Posted on 1998-11-23
9
167 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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