yucatan Posted June 2, 2009 Share Posted June 2, 2009 hi i wanne make a autoit .exe and that opens a layer and in that layer he opens another aplication so that i can record all input that is given to that aplication? Link to comment Share on other sites More sharing options...
monoceres Posted June 2, 2009 Share Posted June 2, 2009 Define layer. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
yucatan Posted June 2, 2009 Author Share Posted June 2, 2009 Define layer. i want that my .exe start and start another second.exe and i wanne show second.exe in a window but without a windows title bar u understand? Link to comment Share on other sites More sharing options...
oMBRa Posted June 2, 2009 Share Posted June 2, 2009 for window without titlebar apply the style $WS_POPUP. for the process thing I dont understand, what means show a process in a window? Link to comment Share on other sites More sharing options...
yucatan Posted June 2, 2009 Author Share Posted June 2, 2009 for window without titlebar apply the style $WS_POPUP.for the process thing I dont understand, what means show a process in a window?i wanne create a windowsand then i just wanne run a program for a exaple windows media playerand i wanne show windows media player in my window Link to comment Share on other sites More sharing options...
oMBRa Posted June 2, 2009 Share Posted June 2, 2009 you can do it embedding the object... wich ''process'' do you have to embed? Link to comment Share on other sites More sharing options...
Inverted Posted June 2, 2009 Share Posted June 2, 2009 He wants a generic solution ... a program that will have a "input capturing window" Link to comment Share on other sites More sharing options...
yucatan Posted June 3, 2009 Author Share Posted June 3, 2009 (edited) expandcollapse popup#include <GUIConstants.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1); Change to OnEvent mode $mainWindow = GUICreate("Embed Cmd", 500, 500, 10, 10) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetState (@SW_SHOW) GUIRegisterMsg(0xF, "WM_PAINT") $pid = run("C:\Program Files\Windows Media Player\wmplayer.exe /prefetch:1") ProcessWait ($pid) ; get the handle of the cmd window as i cannot be certain that there will be only one instance of the cmd running with the same window title or class $cmdHandle = _ProcessGetHWnd($pid, 2) Local $hWndChild = $cmdHandle[1][1] DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hWndChild, "hwnd", $mainWindow) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hWndChild, "int", -20, "long", 0x80000000 + 0x40000000 + 0x40000) GuiSetStyle(BitOr($WS_POPUP, $WS_BORDER), '', $hWndChild) WinSetState($hWndChild, '', @SW_SHOW) WinMove($hWndChild, '', 1, 300, 498, 200) ; inifinite event loop While 1 ; sleep for 100 milliseconds (to not hog the cpu) sleep(100) ; end of event loop WEnd Func CLOSEClicked() ; take care of things to do when exiting exitCleanup() Exit EndFunc Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) Sleep(100) DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0) EndFunc ;==>WM_PAINT ;=============================================================================== ; ; Function Name: _ProcessGetHWnd ; Description: Returns the HWND(s) owned by the specified process (PID only !). ; ; Parameter(s): $iPid - the owner-PID. ; $iOption - Optional : return/search methods : ; 0 - returns the HWND for the first non-titleless window. ; 1 - returns the HWND for the first found window (default). ; 2 - returns all HWNDs for all matches. ; ; $sTitle - Optional : the title to match (see notes). ; $iTimeout - Optional : timeout in msec (see notes) ; ; Return Value(s): On Success - returns the HWND (see below for method 2). ; $array[0][0] - number of HWNDs ; $array[x][0] - title ; $array[x][1] - HWND ; ; On Failure - returns 0 and sets @error to 1. ; ; Note(s): When a title is specified it will then only return the HWND to the titles ; matching that specific string. If no title is specified it will return as ; described by the option used. ; ; When using a timeout it's possible to use WinWaitDelay (Opt) to specify how ; often it should wait before attempting another time to get the HWND. ; ; ; Author(s): Helge ; ;=============================================================================== Func _ProcessGetHWnd($iPid, $iOption = 1, $sTitle = "", $iTimeout = 2000) Local $aReturn[1][1] = [[0]], $aWin, $hTimer = TimerInit() While 1 ; Get list of windows $aWin = WinList($sTitle) ; Searches thru all windows For $i = 1 To $aWin[0][0] ; Found a window owned by the given PID If $iPid = WinGetProcess($aWin[$i][1]) Then ; Option 0 or 1 used If $iOption = 1 OR ($iOption = 0 And $aWin[$i][0] <> "") Then Return $aWin[$i][1] ; Option 2 is used ElseIf $iOption = 2 Then ReDim $aReturn[UBound($aReturn) + 1][2] $aReturn[0][0] += 1 $aReturn[$aReturn[0][0]][0] = $aWin[$i][0] $aReturn[$aReturn[0][0]][1] = $aWin[$i][1] EndIf EndIf Next ; If option 2 is used and there was matches then the list is returned If $iOption = 2 And $aReturn[0][0] > 0 Then Return $aReturn ; If timed out then give up If TimerDiff($hTimer) > $iTimeout Then ExitLoop ; Waits before new attempt Sleep(Opt("WinWaitDelay")) WEnd ; No matches SetError(1) Return 0 EndFunc ;==>_ProcessGetHWnd i found this example and i tested it with windows media player and it does what i want opent another aplication in my autoit gui but there are some things wrong the autoit exe has it own titelbar i dont want that.. Edited June 3, 2009 by yucatan Link to comment Share on other sites More sharing options...
oMBRa Posted June 3, 2009 Share Posted June 3, 2009 (edited) look here: Windows Media Player udf EDIT: fixed link Edited June 3, 2009 by oMBRa Link to comment Share on other sites More sharing options...
Inverted Posted June 3, 2009 Share Posted June 3, 2009 look here: http://www.autoitscript.com/forum/index.php?s=&showtopic=17327&view=findpost&p=119631Link directs to missing post ? Link to comment Share on other sites More sharing options...
oMBRa Posted June 3, 2009 Share Posted June 3, 2009 I fixed the link in my last post 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