Sign in to follow this  
Followers 0
Naufuge

Convert this code to C++

10 posts in this topic

can anyone who is experienced with autoit and c++, convert this code from autoit to c++?

opt("TrayIconHide", 1)

$WINDOW_NAME = "Diablo II"
$SPLASH_TITLE = "Image_Version"
$SPLASH_IMAGE = "Version.bmp"
$SPLASH_WIDTH = 160
$SPLASH_HEIGHT = 20

If Not WinExists($WINDOW_NAME) Then
    SplashOff()
    Exit
Else
    SoundPlay(@ScriptDir & "\Attach.wav")
    $IMAGE_SPLASH = WinGetPos($WINDOW_NAME)
    SplashImageOn($SPLASH_TITLE, $SPLASH_IMAGE, $SPLASH_WIDTH, $SPLASH_HEIGHT , ($IMAGE_SPLASH[2] - $SPLASH_WIDTH) / 2 + $IMAGE_SPLASH[0], $IMAGE_SPLASH[1]+ ($SPLASH_HEIGHT * 1.45), 1)
EndIf
While 1
    $IMAGE_SPLASH2 = WinGetPos($WINDOW_NAME)
    If Not WinExists($WINDOW_NAME) Then
        SplashOff()
        Exit
    Else
        If $IMAGE_SPLASH[0] = $IMAGE_SPLASH2[0] Then
        Else
            $IMAGE_SPLASH = WinGetPos($WINDOW_NAME)
            SplashImageOn($SPLASH_TITLE, $SPLASH_IMAGE, $SPLASH_WIDTH, $SPLASH_HEIGHT , ($IMAGE_SPLASH[2] - $SPLASH_WIDTH) / 2 + $IMAGE_SPLASH[0], $IMAGE_SPLASH[1]+ ($SPLASH_HEIGHT * 1.45), 1)
        EndIf
        
        If $IMAGE_SPLASH[1] = $IMAGE_SPLASH2[1] Then
        Else
            $IMAGE_SPLASH = WinGetPos($WINDOW_NAME)
            SplashImageOn($SPLASH_TITLE, $SPLASH_IMAGE, $SPLASH_WIDTH, $SPLASH_HEIGHT , ($IMAGE_SPLASH[2] - $SPLASH_WIDTH) / 2 + $IMAGE_SPLASH[0], $IMAGE_SPLASH[1]+ ($SPLASH_HEIGHT * 1.45), 1)
        EndIf
    EndIf
WEnd

if you want to test it, you need these three files, you diablo ii has to be run first with -w.

if you need help testing, PM me. ill do my best to help. Thank you.

d2.Screenhook.au3

Attach.wav

Version.bmp

Share this post


Link to post
Share on other sites



Why C++?...

Share this post


Link to post
Share on other sites

Because the files are smaller i guess?

Share this post


Link to post
Share on other sites

because the actual program im making will be C++ and its easier to have that be part of the source code instead of running it as an external program.

Share this post


Link to post
Share on other sites

Sorry to be off topic but is "EJR" what that "binary" spells ? :P (I got mixed up on the middle one "J"...)


FootbaG

Share this post


Link to post
Share on other sites

Sorry to be off topic but is "EJR" what that "binary" spells ? :P (I got mixed up on the middle one "J"...)

close, its BJR, my initials... lol

Share this post


Link to post
Share on other sites

That makes sense. I asked because I may have been able to help you with another language if you didn't really have just one in mind.

Share this post


Link to post
Share on other sites

well...what languages do you know?

Share this post


Link to post
Share on other sites

There is a problem... in the AutoItX there is no function for SplashImageOn(), and i don't know how to do that in C++.

All the rest i can translate.

Share this post


Link to post
Share on other sites

i can translate some of it to C++ but what is AutoItX...

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