Xtian Posted June 27, 2012 Share Posted June 27, 2012 is it possible to run executable files inside gui? for example, i want to put the yahoo messenger inside my gui so i dont need to switch tab all the time? i always have lots of window tabs open when im online so i was just thinking if i can put them and run them all inside 1 window. sorry if its sounds confusing hope you can understand. thanks. Sorry for being noob but... thanks to you im learned something new. Link to comment Share on other sites More sharing options...
Autolaser Posted June 27, 2012 Share Posted June 27, 2012 (edited) Yes this is possible I found this post from user "eukalyptus" in german autoit forum.I hope this help you.http://www.autoit.de/index.php?page=Thread&postID=60950#post60950This code starts notepad.exe into a autoit gui as a child window.#include <WindowsConstants.au3> Opt("TrayIconDebug",1) $hGui = GUICreate("Test GUI", 320, 240) GUISetState(@SW_HIDE, $hGui) $hPid=Run(@SystemDir & 'notepad.exe',"", @SW_HIDE) WinWait("[CLASS:Notepad]", "", 5) $hChild = WinGetHandle("[CLASS:Notepad]", "") $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD)) DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui) WinMove($hChild, "", 0, 0,320,240) GUISetState(@SW_SHOW, $hGui) WinSetState($hChild,"",@SW_SHOW) While GUIGetMsg()<>-3 Sleep(1) WEnd Func OnAutoItExit() ProcessClose($hPid) EndFunc Edited June 27, 2012 by Autolaser Regards Autolaser Link to comment Share on other sites More sharing options...
Maffe811 Posted June 27, 2012 Share Posted June 27, 2012 Yes this is possible I found this post from user "eukalyptus" in german autoit forum. I hope this help you. http://www.autoit.de/index.php?page=Thread&postID=60950#post60950 This code starts notepad.exe into a autoit gui as a child window. #include Opt("TrayIconDebug",1) $hGui = GUICreate("Test GUI", 320, 240) GUISetState(@SW_HIDE, $hGui) $hPid=Run(@SystemDir & 'notepad.exe',"", @SW_HIDE) WinWait("[CLASS:Notepad]", "", 5) $hChild = WinGetHandle("[CLASS:Notepad]", "") $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD)) DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui) WinMove($hChild, "", 0, 0,320,240) GUISetState(@SW_SHOW, $hGui) WinSetState($hChild,"",@SW_SHOW) While GUIGetMsg()<>-3 Sleep(1) WEnd Func OnAutoItExit() ProcessClose($hPid) EndFunc You forgot the include... #include <WindowsConstants.au3> Opt("TrayIconDebug",1) $hGui = GUICreate("Test GUI", 320, 240) GUISetState(@SW_HIDE, $hGui) $hPid=Run(@SystemDir & 'notepad.exe',"", @SW_HIDE) WinWait("[CLASS:Notepad]", "", 5) $hChild = WinGetHandle("[CLASS:Notepad]", "") $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD)) DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui) WinMove($hChild, "", 0, 0,320,240) GUISetState(@SW_SHOW, $hGui) WinSetState($hChild,"",@SW_SHOW) While GUIGetMsg()<>-3 Sleep(1) WEnd Func OnAutoItExit() ProcessClose($hPid) EndFunc [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Autolaser Posted June 27, 2012 Share Posted June 27, 2012 You forgot the include...hmmm, copy & paste error or magic? Regards Autolaser Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted June 27, 2012 Share Posted June 27, 2012 (edited) I think the copy include is something wrong with this forum, I have been seeing it a lot lately. /hijack Edited June 27, 2012 by DicatoroftheUSA Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
Maffe811 Posted June 27, 2012 Share Posted June 27, 2012 As usual, AutoIt code tags have been broken. I'll look into it.Jon, after upgrading the forum.Thats 10 days ago, not sure if stuff still messed up. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler] Link to comment Share on other sites More sharing options...
Xtian Posted June 28, 2012 Author Share Posted June 28, 2012 thanks again for help Sorry for being noob but... thanks to you im learned something new. Link to comment Share on other sites More sharing options...
dersiniar Posted February 13, 2019 Share Posted February 13, 2019 Hi, i try to use this code to make my own program. Coppy - Paste (copy paste is way i study code, to see what does what.) Gui Test will open, but notepad wont. Is there any error with it? #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ScrollbarConstants.au3> #include <GuiRichEdit.au3> #include <GuiEdit.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> #include <Misc.au3> #include <ColorConstants.au3> #include <WINAPI.au3> #include <sendmessage.au3> #include <FontConstants.au3> #include <WindowsConstants.au3> Opt("TrayIconDebug",1) $hGui = GUICreate("Test GUI", 320, 240) GUISetState(@SW_HIDE, $hGui) $hPid=Run(@SystemDir & 'notepad.exe',"", @SW_HIDE) WinWait("[CLASS:Notepad]", "", 5) $hChild = WinGetHandle("[CLASS:Notepad]", "") $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD)) DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui) WinMove($hChild, "", 0, 0,320,240) GUISetState(@SW_SHOW, $hGui) WinSetState($hChild,"",@SW_SHOW) While GUIGetMsg()<>-3 Sleep(1) WEnd Func OnAutoItExit() ProcessClose($hPid) EndFunc Link to comment Share on other sites More sharing options...
Nine Posted February 13, 2019 Share Posted February 13, 2019 (edited) Using old code (without checking it) and resurrecting old thread will hardly give the right results Try this instead and check help file to understand the changes I applied. #include <Constants.au3> #include <GUIConstants.au3> #include <WinAPISysWin.au3> #include <WinAPIGdi.au3> $hGui = GUICreate("Test GUI", 320, 240) $idButton = GUICtrlCreateButton ("Quit", 130, 210, 60, 20) Run('notepad.exe',"", @SW_HIDE) $hChild = WinWait("[CLASS:Notepad]", "", 5) _WinAPI_SetWindowLong ($hChild, $GWL_STYLE,$WS_BORDER) _WinAPI_SetWindowLong ($hChild, $GWL_EXSTYLE, $WS_EX_MDICHILD) _WinAPI_SetParent($hChild, $hGui) WinMove($hChild, "", 0, 0,320,200) GUISetState(@SW_SHOW, $hGui) WinSetState($hChild,"",@SW_SHOW) _WinAPI_RedrawWindow ($hGUI) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton ExitLoop EndSwitch WEnd GUIDelete ($hGui) Edited February 13, 2019 by Nine BigDaddyO 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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