AzKay Posted July 20, 2007 Posted July 20, 2007 I had this script somewhere before, I saw it posted. I cant seem to find it anymore though, I believe Larry posted it. I believe, What it did was, You have the GUI, And the application ran INSIDE the GUI, You can move the app, via its title bar, etc. But it cant be moved out of the GUI. Any ideas? # MY LOVE FOR YOU... IS LIKE A TRUCK- #
AzKay Posted July 20, 2007 Author Posted July 20, 2007 Here, It was like this:#343485Except, Instead of it being another GUI, Its the program. # MY LOVE FOR YOU... IS LIKE A TRUCK- #
PsaltyDS Posted July 20, 2007 Posted July 20, 2007 I had this script somewhere before, I saw it posted. I cant seem to find it anymore though, I believe Larry posted it. I believe, What it did was, You have the GUI, And the application ran INSIDE the GUI, You can move the app, via its title bar, etc. But it cant be moved out of the GUI. Any ideas? If you can open it as an object, you can embed it in a control. Run the help file demo for _IECreateEmbedded(). I suspect this can be done with ANY app you can open as an object, because the code inside IE.au3 for _IECreateEmbedded() is just: Func _IECreateEmbedded() Local $o_object = ObjCreate("Shell.Explorer.2") ; ...error handling snipped SetError($_IEStatus_Success) Return $o_object EndFunc ;==>_IECreateEmbedded Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
AzKay Posted July 20, 2007 Author Posted July 20, 2007 If you can open it as an object, you can embed it in a control. Run the help file demo for _IECreateEmbedded(). I suspect this can be done with ANY app you can open as an object, because the code inside IE.au3 for _IECreateEmbedded() is just: Func _IECreateEmbedded() Local $o_object = ObjCreate("Shell.Explorer.2") ; ...error handling snipped SetError($_IEStatus_Success) Return $o_object EndFunc ;==>_IECreateEmbedded Though, Not every program is an object, With his script, you could run ANY executable. :3 It was like, Running it like normal, except, it was inside the gui, You couldnt move the window out of the gui and the program didnt show in the task bar. # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Emperor Posted July 20, 2007 Posted July 20, 2007 (edited) I don't believe I've seen that script before, but I have my own version that I made a while ago. Local $hWndMain = GUICreate("Example") GUISetState(@SW_SHOW, $hWndMain) GUIRegisterMsg(0xF, "WM_PAINT") Local $hWndChild = WinGetHandle("Untitled - Notepad") DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hWndChild, "hwnd", $hWndMain) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWndChild, "int", -20, "long", 0x80000000+0x40000000+0x40000) WinSetState($hWndChild, "", @SW_MAXIMIZE) Do Sleep(100) Local $Msg = GUIGetMsg() Until $Msg = -3 Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) Sleep(100) DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0) EndFunc Edited July 20, 2007 by Emperor
AzKay Posted July 20, 2007 Author Posted July 20, 2007 (edited) Hmm, All that did, was a maximized GUI. EDIT:: Nevermind. But, I would still prefer the other one xP This one, I dont like. When I move the window, It leaves lines everywhere. Edited July 20, 2007 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Emperor Posted July 20, 2007 Posted July 20, 2007 I've edited my above post, it should fix the "line" problem, but at the expense of a little flickering. I'm sure there is a better way to fix it, but I can't think of one right now.
PsaltyDS Posted July 20, 2007 Posted July 20, 2007 I've edited my above post, it should fix the "line" problem, but at the expense of a little flickering. I'm sure there is a better way to fix it, but I can't think of one right now. Cool! I like that. Couldn't resist tweaking it just enough to make a practical demo (make sure notepad is available): Local $hWndMain = GUICreate("Example", 600, 400) GUISetState(@SW_SHOW, $hWndMain) GUIRegisterMsg(0xF, "WM_PAINT") If Not WinExists("Untitled - Notepad") Then Run("notepad.exe") WinWait("Untitled - Notepad") Local $hWndChild = WinGetHandle("Untitled - Notepad") DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hWndChild, "hwnd", $hWndMain) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWndChild, "int", -20, "long", 0x80000000 + 0x40000000 + 0x40000) WinSetState($hWndChild, "", @SW_MAXIMIZE) Do Sleep(100) Local $Msg = GUIGetMsg() Until $Msg = -3 Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) Sleep(100) DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0) EndFunc ;==>WM_PAINT Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
DW1 Posted July 20, 2007 Posted July 20, 2007 Wow thats pretty cool... now just get the windows called by notepad to only open inside the gui window too.... good luck AutoIt3 Online Help
AzKay Posted July 20, 2007 Author Posted July 20, 2007 Mmm, Still gonna wait for the other one xD # MY LOVE FOR YOU... IS LIKE A TRUCK- #
DW1 Posted July 20, 2007 Posted July 20, 2007 please post it when you find it... Also, please post to Auotit Snippets (SEE MY SIG) AutoIt3 Online Help
AzKay Posted July 23, 2007 Author Posted July 23, 2007 (edited) I fixed the line flickering, If anyones interested :3 #include <GUIConstants.au3> Local $hWndMain = GUICreate("Example", 500, 500, -1, -1, $WS_CLIPCHILDREN) ;Seemed to fix the flickering ;3 GUISetState(@SW_SHOW, $hWndMain) Local $hWndChild = WinGetHandle("Untitled - Notepad") DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hWndChild, "hwnd", $hWndMain) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWndChild, "int", -20, "long", 0x80000000+0x40000000+0x40000) WinSetState($hWndChild, "", @SW_MAXIMIZE) Do Sleep(100) Local $Msg = GUIGetMsg() Until $Msg = -3 Edited July 23, 2007 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
AcidCorps Posted August 7, 2007 Posted August 7, 2007 Could someone make it so that this would work inside of a tab?
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