Jump to content

Recommended Posts

Posted

Never worked with VB or its derivatives, How would i inbed a running process inside my GUI (its easy to start something using the GUI but how would i start it INSIDE the GUI is the question)

Posted

I think the world you are looking for is 'embed', as in "adding an embedded program" yes?

If I understand you correctly, this is... impossible. An AutoIt3 script is executed via sourcecode that you already have, but "embedding another EXE" cannot be done because the EXE is ALREADY COMPILED and as such you cannot provide interfacing with it except for what the EXE already supports. You would need the program you want to embed in its raw souce code....

...or am i way off?? I think you need to give a little more info - tell us what you're trying to do exactly? I MIGHT be able to help you, as I am currently working on a MediaCentre-slash-PVR completely written in AutoIt3, and I use DScaler and MPlayerC to handle all the video and stuff [AutoIt3-built frontend].... but I had to modify the source-code for MPlayerC to acheive this, and DScaler... well I don't want reveal what my current method for that is because it is closed source and i had to reverse-engineer it which is illegal... it was only a P.O.C. to demonstrate to my students and has since been trashed for obvious reasons; but I have some ideas im working on ;D...

Erm... sorry off topic, but yeah give us a bit more detail.

Posted

...or am i way off??

Yep.

He wants exactly what AdmiralAlkex said. _WinApi_SetParent or the user32.dll call "SetParent". Either will do.

Posted

Hi, you mean like for example embedding windows calculator in your autoit gui?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Constants.au3>

$hGUI2 = GUICreate('Embed Calc.exe', 500, 300, 0, 0, BitOr($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN))
$pID = Run("Calc.exe")
WinWait("Calculator")
$hChild = WinGetHandle("Calculator")
_WinAPI_SetParent($hChild, $hGUI2)
_WinAPI_SetWindowLong($hChild, $GWL_STYLE, $WS_CLIPSIBLINGS) 
_WinAPI_SetWindowLong($hChild, $GWL_HWNDPARENT, $hGUI2)
_WinAPI_SetWindowPos($hChild, 0, 0, 0, 0, 0, BitOr($SWP_SHOWWINDOW, $SWP_NOSIZE))
GUiSetState(@SW_SHOW, $hGUI2)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ProcessClose($pID)
            Exit
        Case Else

    EndSwitch
WEnd

Posted

Variant without a _WinAPI_SetWindowPos() func. :P

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Constants.au3>

$hGUI2 = GUICreate('Embed Calc.exe', 500, 300, 0, 0, BitOr($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN))

$pID = Run("Calc.exe")

WinWait("[Class:SciCalc]")

$hChild = WinGetHandle("[Class:SciCalc]")

_WinAPI_SetParent($hChild, $hGUI2)
_WinAPI_SetWindowLong($hChild, $GWL_STYLE, BitOR($WS_CLIPSIBLINGS, $WS_VISIBLE))
_WinAPI_SetWindowLong($hChild, $GWL_HWNDPARENT, $hGUI2)
WinMove($hChild, "", 0, 0)

GUiSetState(@SW_SHOW, $hGUI2)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ProcessClose($pID)
            Exit
    EndSwitch
WEnd

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