Sprinto Posted July 10, 2009 Share Posted July 10, 2009 Hello Guys. I know how to run a IE in a GUI window, but is there a way to run ex. solitaire in a gui window? - Sprinto Link to comment Share on other sites More sharing options...
Michel Claveau Posted July 10, 2009 Share Posted July 10, 2009 (edited) Hi! Sorry, I do not have Solitaire. But, I have Calculator. Therefore, a exemple of code:#include<guiconstants.au3> #include<WindowsConstants.au3> ;opt("WinTitleMatchMode",3) $hGui1 = GUICreate("GUI Embedder",400,400,-1,-1,BitOr($GUI_SS_DEFAULT_GUI ,$WS_CLIPCHILDREN)) GUISetState(@SW_SHOW) $title="Calculatrice" ;french $title="Calculator" ;english ShellExecute("calc.exe") WinWait($title,"",4) $Handle = WinGetHandle($title) $origParent = DllCall("user32.dll", "int", "SetParent", "hwnd", $Handle, "hwnd",$hGui1) sleep(24) WinSetState($Handle,"",@SW_MAXIMIZE) While 1 $nMSG = GUIGetMsg() Switch $nMSG Case $GUI_EVENT_CLOSE ;set child back To Original parent or it will be destroyed with ouyr window DllCall("user32.dll", "int", "SetParent", "hwnd", $Handle, "hwnd", $origParent[0]) Sleep(24) WinClose($Handle) Exit EndSwitch sleep(12) WEnd Edited July 10, 2009 by Michel Claveau Link to comment Share on other sites More sharing options...
Sprinto Posted July 11, 2009 Author Share Posted July 11, 2009 This works fine .. But any way to start the calc inside the GUI so it does not have to move it first? Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted July 11, 2009 Share Posted July 11, 2009 (edited) This works fine .. But any way to start the calc inside the GUI so it does not have to move it first?Haven't tested it but Run calc with @SW_HIDE flag Edited July 11, 2009 by Emiel Wieldraaijer Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted July 17, 2009 Share Posted July 17, 2009 Haven't tested it but Run calc with @SW_HIDE flagI've tried it and Calc isn't a good example ... use another program.. sol.exe for example The shellexecute command should be like this ShellExecute("sol.exe", "", @TempDir, "open", @SW_HIDE) Best regards,Emiel Wieldraaijer 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