Sign in to follow this  
Followers 0
hermanthegerman

Q: How to keep the mainwindow in the forground to avoid flickering ?

6 posts in this topic

Hi,

I have a fine working script, who gets a bitmap from an external device every second and displays it on the PC screen.

The bitmap is gathered by an external program, which I call via runwait, and hide all it's displays via the @SW_HIDE flag.

Unfortunately, for the quarter second this program is running, the mainwindow of my script goes to the background, and when it displays the freshly gathered bitmap, comes back to the foreground, therefore the window borders are flickering.

Is there a way how I can avoid that ?

Thanks in advance for any hints or tips, Herman

Share this post


Link to post
Share on other sites



I forgot to mention that I already used controlstyle $DS_SETFOREGROUND and extendedstyle $WS_EX_TOPMOST, but it doesn't help.

The main window, though staying on top, still loses focus and gets it back again.

One of my colleagues said, it is not possible to handle that with AUTOIT, and meant, I should write a C program instead.

That's what I was trying to avoid, but it looks like it would be really necessary.

Is there nobody, who already had solved a comparable problem ?

Regards, Herman

Share this post


Link to post
Share on other sites

I forgot to mention that I already used controlstyle $DS_SETFOREGROUND and extendedstyle $WS_EX_TOPMOST, but it doesn't help.

The main window, though staying on top, still loses focus and gets it back again.

One of my colleagues said, it is not possible to handle that with AUTOIT, and meant, I should write a C program instead.

That's what I was trying to avoid, but it looks like it would be really necessary.

Is there nobody, who already had solved a comparable problem ?

Regards, Herman

WinSetOnTop ?

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

WinSetOnTop ?

Hi,

no this doesn't help, I already tried that.

This does not help, because the external program I call via RunWait, opens by itself a secondary window, which always steals the focus.

Though I can hide this disturbing window of the external program by calling it with @SW_HIDE, this does not affect the focus.

Though my mainwindow stays on top, if I use WinSetOnTop, it loses focus, and therefore the windowsborders flicker.

/Herman

Edited by hermanthegerman

Share this post


Link to post
Share on other sites

WinActivate may help steal the focus ?


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

WinActivate may help steal the focus ?

Unfortunately not, because while the external program is called via RunWait, AutoIt must of course wait until the program ends.

During this time the external program steals the focus, then it ends, and my program gets back the focus.

The only solution would be to prevent the secondary window of the external program from getting the focus, and I don't see a way how to do that, I tried a lot of flags already.

But possibly not the one and only which is the correct one ?

Regards, Herman

Edited by hermanthegerman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0