Jump to content

C/C++ Screenhooks


Naufuge
 Share

Recommended Posts

$WINDOW_NAME = "MyGUI"
$SPLASH_TITLE = "Splash"
$SPLASH_IMAGE = "image.bmp"
$SPLASH_WIDTH = 100
$SPLASH_HEIGHT = 100
while 1
   if not WinExists($WINDOW_NAME) Then 
      SplashOff()
   else
      $loc = WinGetPos ( $WINDOW_NAME )
      SplashImageOn ( $SPLASH_TITLE, $SPLASH_IMAGE , $SPLASH_width , $SPLASH_height ,($loc[2]-$SPLASH_WIDTH)/2+$loc[0], ($loc[3]-$SPLASH_HEIGHT)/2+$loc[1])
  endif
  sleep (2000)
wend

AutoIt is simple, subtle, elegant.

Then you create the GUI in C++, and enter the name into the $WINDOW_NAME variable.

Link to comment
Share on other sites

That Works Great!!!

only is there a way to cut down the flicker, and still have it work fast...

as in Sleep(100), it flickers more, but reacts faster and Sleep(5000) it flickers less, but reacts slower.

can this be fixed.

like,

$loc2 = WinGetPos($WINDOW_NAME)
If $loc2[0] = $loc[0] Then
 ;;; Do Nothing
Else
   SplashImageOn ( $SPLASH_TITLE, $SPLASH_IMAGE , $SPLASH_width , $SPLASH_height ,($loc[2]-$SPLASH_WIDTH)/2+$loc[0],$loc[1]+($SPLASH_HEIGHT*1.45),1)
EndIf
If $loc2[1] = $loc[1] Then
 ;Do Nothing
Else
   SplashImageOn ( $SPLASH_TITLE, $SPLASH_IMAGE , $SPLASH_width , $SPLASH_height ,($loc[2]-$SPLASH_WIDTH)/2+$loc[0],$loc[1]+($SPLASH_HEIGHT*1.45),1)
EndIf

would this work?

Yes it does, i just tryed it... Works Great. Thank you

Edited by Naufuge
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...