Sign in to follow this  
Followers 0
michael2t

mplayer -wid (windows handle)

4 posts in this topic

#1 ·  Posted (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 by michael2t

Share this post


Link to post
Share on other sites



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);

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 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

Share this post


Link to post
Share on other sites

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=87461

Thanks a bunch m8... Danke :lmao:...

Gruss

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0