Blahbots Posted July 31, 2008 Share Posted July 31, 2008 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) Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 1, 2008 Share Posted August 1, 2008 Sounds like you're talking about _WinAPI_SetParent() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Blahbots Posted August 1, 2008 Author Share Posted August 1, 2008 ahh would this function change the resolution of the child window or inbed it asis? Link to comment Share on other sites More sharing options...
CosmicDan Posted August 6, 2008 Share Posted August 6, 2008 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. CosmicDan.com Link to comment Share on other sites More sharing options...
NELyon Posted August 6, 2008 Share Posted August 6, 2008 ...or am i way off??Yep.He wants exactly what AdmiralAlkex said. _WinApi_SetParent or the user32.dll call "SetParent". Either will do. Link to comment Share on other sites More sharing options...
smashly Posted August 6, 2008 Share Posted August 6, 2008 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 Link to comment Share on other sites More sharing options...
rasim Posted August 6, 2008 Share Posted August 6, 2008 smashlyVery nice example, thank you Link to comment Share on other sites More sharing options...
rasim Posted August 6, 2008 Share Posted August 6, 2008 Variant without a _WinAPI_SetWindowPos() func. #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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now