Sign in to follow this  
Followers 0
XxxKills

Question regarding opening prog inside of Guibox

13 posts in this topic

#1 ·  Posted (edited)

Ok so I've gotten this far but cant seem to open a program (Diablo II) inside of it. I quess im a lil slow lol, I've been reading the help me files and what not, but I quess i'm really not sure what to be looking for as far as what I need to do.

This is the code I have so far.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Owner\Desktop\MyNewGui\forms\New Form.kxf
$Form1_1 = GUICreate("Diablo II", 802, 675, 233, 51, -1, -1)
GUISetIcon("D:\003.ico")
$GroupBox1 = GUICtrlCreateGroup("", -8, 1, 801, 601, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Graphic1 = GUICtrlCreateGraphic(0, 0, 796, 604)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pause = GUICtrlCreateButton("Pause", 641, 611, 75, 25, $WS_BORDER)
$UnPause = GUICtrlCreateButton("UnPause", 722, 611, 75, 25, $WS_BORDER)
$Button1 = GUICtrlCreateButton("Play", 16, 611, 75, 25, $WS_BORDER)
$Button2 = GUICtrlCreateButton("Stop", 95, 611, 75, 25, $WS_BORDER)
$Button3 = GUICtrlCreateButton("Back", 176, 611, 75, 25, $WS_BORDER)
$Button4 = GUICtrlCreateButton("Next", 258, 611, 75, 25, $WS_BORDER)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Pause
        Case $UnPause
        Case $Button1
        Case $Button2
        Case $Button3
        Case $Button4
    EndSwitch
WEnd

Eventually what I plan on doing with this is opening D2 in the window. Then useing the pause/unpause button for the scripts while in game. and also the play button, etc to controll my winamp for music while playing.

Any Help in this matter would be greatly apprieciated. and as always Thank you in advance for takeing the time to read and hopefully respond.

Edited by XxxKills

Share this post


Link to post
Share on other sites



There are hundreds, if not thousands, of scripts and questions for Diablo 2 in this forum. You only need to search the forum to find ready-made stuff.

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Ok, spent the last 4 hours searching the forums, and havnt found what I was looking for. again. which is what I did before i posted in the first place. But I had seen something on here a few days ago. but havent been able to find it again. Im not realy sure what Im looking for is called. can some one point me in the right direction.

Thanks in advance.

Share this post


Link to post
Share on other sites

I dont uderstand your question, you want to embed Diablo II in your gui?

Share this post


Link to post
Share on other sites

If its possible. I want to create a frame around the D2 screen with a pause button and such for pauseing the script i would be runnig.

try the script i have in the first post and you will get a better idea of what I mean.

Share this post


Link to post
Share on other sites

Ok, let me be more specific, I want my script to run in the screen part of the gui that is created, basically Diablo in a non minimizing screen:

Here is the code for the screen.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Owner\Desktop\MyNewGui\forms\New Form.kxf
$Form1_1 = GUICreate("Diablo II", 802, 675, 233, 51, -1, -1)
GUISetIcon("D:\003.ico")
$GroupBox1 = GUICtrlCreateGroup("", -8, 1, 801, 601, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Graphic1 = GUICtrlCreateGraphic(0, 0, 796, 604)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pause = GUICtrlCreateButton("Pause", 641, 611, 75, 25, $WS_BORDER)
$UnPause = GUICtrlCreateButton("UnPause", 722, 611, 75, 25, $WS_BORDER)
$Button1 = GUICtrlCreateButton("Play", 16, 611, 75, 25, $WS_BORDER)
$Button2 = GUICtrlCreateButton("Stop", 95, 611, 75, 25, $WS_BORDER)
$Button3 = GUICtrlCreateButton("Back", 176, 611, 75, 25, $WS_BORDER)
$Button4 = GUICtrlCreateButton("Next", 258, 611, 75, 25, $WS_BORDER)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Pause
        Case $UnPause
        Case $Button1
        Case $Button2
        Case $Button3
        Case $Button4
    EndSwitch
WEnd

and part of the script that I want to run in the screen.

Func Diablo()
    Run($Path & $argument)
    WinWaitActive("Diablo II")
    WinMove("Diablo II", "", 0, 0)
    Sleep(1000)
    Send("{ENTER}")

So does tht help. still ant fiqure it out, been searching for hours.eyes hurt and burn.

Share this post


Link to post
Share on other sites

Ok, obviously I'm doing this wrong. Could some body please point me in the right direction. now I'm just lost.lol. and by the way. Thank You to every one who has helped me to learn this far.

Share this post


Link to post
Share on other sites

Ok, obviously I'm doing this wrong. Could some body please point me in the right direction. now I'm just lost.lol. and by the way. Thank You to every one who has helped me to learn this far.

Share this post


Link to post
Share on other sites

Do you mean this?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Owner\Desktop\MyNewGui\forms\New Form.kxf
$Form1_1 = GUICreate("Diablo II", 802, 675, 233, 51, -1, -1)
GUISetIcon("D:\003.ico")
$GroupBox1 = GUICtrlCreateGroup("", -8, 1, 801, 601, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Graphic1 = GUICtrlCreateGraphic(0, 0, 796, 604)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pause = GUICtrlCreateButton("Pause", 641, 611, 75, 25, $WS_BORDER)
$UnPause = GUICtrlCreateButton("UnPause", 722, 611, 75, 25, $WS_BORDER)
$Button1 = GUICtrlCreateButton("Play", 16, 611, 75, 25, $WS_BORDER)
$Button2 = GUICtrlCreateButton("Stop", 95, 611, 75, 25, $WS_BORDER)
$Button3 = GUICtrlCreateButton("Back", 176, 611, 75, 25, $WS_BORDER)
$Button4 = GUICtrlCreateButton("Next", 258, 611, 75, 25, $WS_BORDER)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Pause
        Case $UnPause
        Case $Button1
            Diablo()
        Case $Button2
        Case $Button3
        Case $Button4
    EndSwitch
WEnd

Func Diablo()
    Run($Path & $argument)
    WinWaitActive("Diablo II")
    WinMove("Diablo II", "", 0, 0)
    Sleep(1000)
    Send("{ENTER}")
EndFunc   ;==>Diablo

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Sort of, what I'm really trying to fiqure out is how to attach the Diablo screen to the Gui screen tho. but that was crazy nice.

Share this post


Link to post
Share on other sites

This should do it!!! ...

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>




#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Owner\Desktop\MyNewGui\forms\New Form.kxf
$Form1_1 = GUICreate("Diablo II", 802, 675, 233, 51, -1, -1)
GUISetIcon("D:\003.ico")
$GroupBox1 = GUICtrlCreateGroup("", 1, 1, 801, 601, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Graphic1 = GUICtrlCreateGraphic(0, 0, 796, 604)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pause = GUICtrlCreateButton("Pause", 641, 611, 75, 25, $WS_BORDER)
$UnPause = GUICtrlCreateButton("UnPause", 722, 611, 75, 25, $WS_BORDER)
$Button1 = GUICtrlCreateButton("Play", 16, 611, 75, 25, $WS_BORDER)
$Button2 = GUICtrlCreateButton("Stop", 95, 611, 75, 25, $WS_BORDER)
$Button3 = GUICtrlCreateButton("Back", 176, 611, 75, 25, $WS_BORDER)
$Button4 = GUICtrlCreateButton("Next", 258, 611, 75, 25, $WS_BORDER)
GUISetState()
#EndRegion ### END Koda GUI section ###

;*** Example.....
Run("notepad.exe")
WinWait("")
$handle = WinGetHandle("")
XSkinRun($Form1_1, $handle, 0, 0, 796, 600)
; *** end example....


While WinExists($handle) ; change to whatever
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Pause
        Case $UnPause
        Case $Button1
            Diablo()
        Case $Button2
        Case $Button3
        Case $Button4
    EndSwitch
WEnd

Func Diablo()
    ;Run($Path & $argument)
    WinWaitActive("Diablo II")
    WinMove("Diablo II", "", 0, 0)
    Sleep(1000)
    Send("{ENTER}")
    ; for you.......
    $handle = WinGetHandle("Diablo II")
    XSkinRun($Form1_1, $handle, 0, 0, 796, 600)
EndFunc   ;==>Diablo

Func XSkinRun($XPID2, $XhWnd, $X, $Y, $XX, $YY)
    $oxStyle = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $XPID2, "int", -16)
    DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $XPID2, "int", -16, "long", BitOR($oxStyle[0], $WS_CLIPCHILDREN))
    $ostyle = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $XhWnd, "int", -16)
    DllCall("user32.dll", "int", "SetParent", "hwnd", $XhWnd, "hwnd", $XPID2)
    DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $XhWnd, "int", -16, "long", BitOR($WS_POPUP, $WS_CHILD, $WS_VISIBLE, $WS_CLIPSIBLINGS))
    GUISetState()
    WinMove($XhWnd, "", $X, $Y, $XX, $YY)
    WinSetState($XhWnd, "", @SW_SHOW)
    WinActivate($XhWnd)
    Return 1
EndFunc   ;==>XSkinRun

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

OMG!!!!!!!!!!!!!! I love you , if I was a dog I think I would hump your leg. Thank You so much. I've been trying it with parent and sibling but couldnt get it to work, I had almost given up on it.

Thank you very,very much sir.

Thanks to this I understand how some of the functions are used(quite a bit better) and how they are called.

Edited by XxxKills

Share this post


Link to post
Share on other sites

Can GUI_DockAuto be used to make everything resize when entering the game? When you actually enter the game the screen size changes to a bit smaller.

Just wondering if there was a way to do it without haveing to rewrite the whole script.

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