[MPlayer-users] Re: Fast recompress

Tobias Diedrich ranma at gmx.at
Wed Aug 6 22:57:48 CEST 2003


Erik Slagter wrote:

> Great. Can I use it non-interactively (including wine or wine cross
> over)?

Not easily.
If you reverse engineer the config file format you can.
I have this little program which works reasonably well (compile with
mingw):

-----------------cut---------------------
#include <windows.h>
#include <stdio.h>
#include <process.h>

int main(int argc, char **argv)
{
	HWND main;
	HWND toppanel;
	HWND bottompanel;
	HWND audio;
	HWND video;
	HWND output;
	HWND start;
	int i;
	if (argc != 4) {
		printf("Usage: %s: <tpr> <source> <output>\n", argv[0]);
		exit(1);
	}
	puts("Hello world!");
	spawnl(_P_NOWAIT, "y:\\download\\tmpgenc\\tmpgenc.exe", "tmpgenc.exe", argv[1], NULL);
	for (i=0; i<100 && (main = FindWindow("TMainForm", "TMPGEnc")) == 0; i++) Sleep(100);
	printf("main=%d\n", main);
	Sleep(20000);
	if (main == 0) {
		puts("Could not find main window!");
		exit(1);
	}
	bottompanel = FindWindowEx(main, NULL, "TPanel", NULL);
	printf("bottompanel=%d\n", bottompanel);
	toppanel = FindWindowEx(main, bottompanel, "TPanel", NULL);
	toppanel = FindWindowEx(main, toppanel, "TPanel", NULL);
	printf("toppanel=%d\n", toppanel);
	audio = FindWindowEx(bottompanel, NULL, "TEdit", NULL);
	audio = FindWindowEx(bottompanel, audio, "TEdit", NULL);
	printf("audio=%d\n", audio);
	video = FindWindowEx(bottompanel, audio, "TEdit", NULL);
	printf("video=%d\n", video);
	output = FindWindowEx(bottompanel, video, "TEdit", NULL);
	printf("output=%d\n", output);
	start = FindWindowEx(toppanel, NULL, "TButton", "Start");
	printf("start=%d\n", start);
	SendMessage(video, WM_SETTEXT, 0, (LPARAM) argv[2]);
	SendMessage(output, WM_SETTEXT, 0, (LPARAM) argv[3]);
	SendMessage(start, WM_LBUTTONDOWN, 0, 0);
	printf("encoding start\n");
	SendMessage(start, WM_LBUTTONUP, 0, 0);
	printf("encoding done\n");
	SendMessage(main, WM_CLOSE, 0, 0);
	return 0;
}
-------------------cut-----------------------

-- 
Tobias						PGP: http://9ac7e0bc.2ya.com
This mail is made of 100% recycled bits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20030806/513a0feb/attachment.pgp>


More information about the MPlayer-users mailing list