Jump to content

Convert this code to C++


Recommended Posts

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

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.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...