Jump to content

Label redraw flickering reduction (_WinAPI_RedrawWindow help)


Recommended Posts

Hi, everyone

Short disclaimer:

Spoiler

Sory for bad code, I am a newbie
Sory for bad english. Please tell, if anything is unclear
I know everything I've done is pointless, it is for fun and learning.

One day I was a little bored and decided to redraw default windows MsgBox button with labels, after that I redraw the button in the pressed state and got a little caried away, so I ended up with a whole responsive Gui that consists of nothing but labels.

This Gui reacts user clicks, redraws buttons when cursor hovers them, redraws buttons when corresponding numpud key is pressed (even when cursor hovers any button, but not when LMB is down) and what is most important it looks fun.
You can use RMB to move window, ESC to exit.

However I couldnt fix all the flickering/glitches mistakes. So wonder if anyone skilled enough could spend a moment and read the code to give me some clues. (some SendMessage-DllStruct-thing, would be great, but I am looking for a simple solutions too)

I added cooments to every important line of code so that you didnt have to puzzle out my code style, but please tell me if anything is still unclear.

There are two files attached:
RainbowCalcGui_glitchy.au3 - the main one
RainbowCalcGui_flickery.au3 - the second one as flicker example. In this file I just commented out $WS_CLIPCHILDREN and every _WinAPI_RedrawWindow()

Short Postscript

Spoiler

I did a lot of googling. If you will just post a link to another post or help file, it wont probably help, sense I've already seen that and couldn't apply or understand.

 

RainbowCalcGui_flickery.au3 RainbowCalcGui_glitchy.au3

Link to comment
Share on other sites

I did not dig much but there is a bug (few times) that needs to be fixed. 

Case Not $sCurrHover = ''

Not applies only to $sCurrHover and not to the whole $sCurrHover = ''.  You would need to do :

Case Not ($sCurrHover = '')

or better :

Case $sCurrHover <> ''

or just :

Case $sCurrHover

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...