michael2t Posted January 2, 2009 Share Posted January 2, 2009 (edited) Hello All ... mplayer has a option -wid that you can pass it a window handle ... But I can not get it to work ... I want mplayer in a autoit window ... $trailerplay = "trailer.avi" $mplayerpid = Run(@WorkingDir&'\MPlayer\mplayer.exe -nomouseinput -slave -quiet -noborder -ontop "'&$trailerplay&'"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD + $STDIN_CHILD) thanks all Michael T. Edited January 2, 2009 by michael2t Link to comment Share on other sites More sharing options...
SeanJanis Posted January 22, 2009 Share Posted January 22, 2009 On Windows XP, with a Sample MFC application, the following basic example command line sequence embeds Mplayer into an HWND. The following code snippet is called within some derived CView class instance (notice the this->m_hWnd reference): // // Mplayer executable Path // string strProcessPath = "C:\\mplayer.exe"; string strCommandLine = ""; strCommandLine += " -slave -identify -noquiet -vo directx:noaccel "; char achNumBuffer[256]; memset(achNumBuffer, '\0', sizeof(achNumBuffer)); sprintf(achNumBuffer, "-wid %d", (int)this->m_hWnd); strCommandLine += " "; strCommandLine += (string)achNumBuffer; strCommandLine += " -colorkey 0x000000 -framedrop "; // // Playable Video Path // strCommandLine += "C:\\testvideo.m4v"; SHELLEXECUTEINFO shExecInfo; shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); shExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; shExecInfo.hwnd = NULL; shExecInfo.lpVerb = "open"; shExecInfo.lpDirectory = NULL; shExecInfo.nShow = SW_SHOW; shExecInfo.hInstApp = NULL; shExecInfo.lpFile = strProcessPath.c_str(); shExecInfo.lpParameters = strCommandLine.c_str(); ShellExecuteEx(&shExecInfo); ::CloseHandle(shExecInfo.hProcess); Link to comment Share on other sites More sharing options...
ProgAndy Posted January 22, 2009 Share Posted January 22, 2009 (edited) In AutoIt this should be this: Local $strCommandLine = ""; $strCommandLine &= " -slave -identify -noquiet -vo directx:noaccel "; $strCommandLine &= " "; $strCommandLine &= "-wid " & Number($m_hWnd); $strCommandLine &= " -colorkey 0x000000 -framedrop "; ;------ $strCommandLine &= '"C:\\Your_Path\video.avi"' I think, your problem was you forgot to convert the hWnd to an Integer. Edited January 22, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
KaFu Posted January 22, 2009 Share Posted January 22, 2009 I think, your problem was you forgot to convert the hWnd to an Integer.Fantastic , that's the piece of info which I missed to solve this one:http://www.autoitscript.com/forum/index.php?showtopic=87461Thanks a bunch m8... Danke ...Gruss OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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