cbwarz
3rd January 2003, 15:40
Hi,
I'm doing the same thing (in Visual Basic).
>1. Doubleclicking the file that has been loaded into the main CCE window in order to view the encode settings.
Can't find a way to do this, so i emulate a dobleclic over the filename.
For the next 2 you need (Visual Basic Code):
hWin = FindWindow("cctspt", vbNullString)
' Can't remember if the class name is "cctspt"
>2. Leftclicking the 'Encode' button at the bottom of the main window.
hItem = FindWindowEx(hWin, ByVal 0&, "Button", "Encode")
SendMessage hItem, BM_CLICK, 0, 0&
>3. Leftcliking the 'OK' button in the encode settings window.
hItem = FindWindowEx(hWin, ByVal 0&, "Button", "OK")
SendMessage hItem, BM_CLICK, 0, 0&
I got a question for you, how do you automate the "open file" process?
I send a WM_COMMAND, GetMenuItem to do this, but then i must find the "Open" window and feed the filename, and i wish a better way to do this :)
Hope it helps, and maybe we can share some code if we are doing same things
cbwarz
P.D. aahhh please change to Development forum
LB
31st January 2003, 06:44
Here is the script I use for CCE that auto encodes to whatever I want. ;)
Run, %CCE%
WinWaitActive, CCE
WinActivate, CCE
RightClick, 87,100
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.00.AVI
Send, {ENTER}
WinWaitActive, CCE
LeftClick, 71,73
LeftClick, 71,73
WinWaitActive, Encode
Send, {TAB 2}{ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.01.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.01.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.02.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.02.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.03.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.03.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.04.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.04.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.05.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.05.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.06.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.06.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.07.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.07.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.08.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.08.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.09.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.09.AVI
Send, {ENTER}
WinWaitActive, Ep
IfNotExist, %HSPA%%EPISODE%.10.AVI, Goto, BEGIN
RightClick, 295,219
Send, a
WinWaitActive, Open
Send, %HSPA%%EPISODE%.10.AVI
Send, {ENTER}
WinWaitActive, Ep
BEGIN:
Send, {TAB}{ENTER}
WinWaitActive, Encode
Send, {TAB 3}
Send, %HSPA2%%EPISODE%.MPV
Send, {TAB}{TAB}
Send, %HSPA2%%EPISODE%.MPV
Send, {TAB 9}
Send, ^v
Send, {TAB 6}{ENTER}
WinWaitActive, CCE
Send, {TAB}{ENTER}
Sleep, 1000
Send, {ENTER}
WinWaitActive, Save
Send, %HSPA2%%EPISODE%.ECL
Send, {ENTER}
SetTitleMatchMode, 2
WinWaitActive, Ep,Saving
WinWaitClose, Ep,Saving
Sleep, 5000
WinWaitActive, Ep,Saving
WinWaitClose, Ep,Saving
Sleep, 3000
WinActivate, CCE
WinClose, CCE
As you can see it's made for HUFFY segmented avi's but works perfect for regular avi files too (non segmented). Note my three? variables. HSPA, EPISODE, HSPA2. Just dir locations. What else... Oh yeah, if you get anything outta this doc, pay attention to the last part with the two sleeps. Took me a bit to figure out the path correctly since on a VBR encode it's difficult to notice the transition between the first pass and subsequent ones. Other than that, it's pretty much straightforward. Oh, and your mouseclicks are used up top. And also to the best of my knowledge screen rez doesn't matter i *think for autoit. If not, you can just implement a quick CHOICE option at the start of the program and the user will input their current screen rez. and the program will pull out which numbers to use for the mouse clicks. (Just pre-test it on all the various resolutions to get those numbers) because remember, it's relative to the existing screen, so if the numbers do change with regard to the resolution, a simplie CHOICE input option at the start can correct that.
enjoy. ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.