Sign in to follow this  
Followers 0
Naufuge

C/C++ Screenhooks

7 posts in this topic

does anyone know how to do screenhooks with C or C++, or do u have a link to a tutorial?

Thank you.

Naufuge

Share this post


Link to post
Share on other sites



I mean like displaying a image, with txt over it, hooked to a certin point on a window. Like the version part of d2jsp. It displays a bmp, at the top of the screen, then displays the text of the version number on it.

Share this post


Link to post
Share on other sites

somewhat like that, except when the window is moved, so is the splash, and if the window is minimized, the splash is off.

Share this post


Link to post
Share on other sites

$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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

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