Log in

View Full Version : Anyone know CCE operation using keystrokes??


tyee
2nd January 2003, 19:08
I'm looking for the equivalent keyboard keystrokes for a few CCE commands such as --

1. Doubleclicking the file that has been loaded into the main CCE window in order to view the encode settings.
2. Leftclicking the 'Encode' button at the bottom of the main window.
3. Leftcliking the 'OK' button in the encode settings window.

I can't find any info anywhere and playing with the keyboard leads me nowhere.

tyee

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

tyee
4th January 2003, 04:06
cbwarz
I'm not a coder but I am using a small program called AutoIt which enables me to do the functions I asked about by writing a simple script. I just wanted to do them without mouseclicks because if a user has a different screen resolution then the coordinates for the mouse clicks will be wrong as far as I can tell.

I haven't tried the 'open file' yet. Never had a need to do that.

tyee

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

Ntsita
31st January 2003, 15:44
...because if a user has a different screen resolution then the coordinates for the mouse clicks will be wrong as far as I can tell.
Changing screen resolution, the coordinates of CCE don't change (at least for me).
Do you have tried it with CCE (and not with other sample windows)?

P.S. The autoit left-click mouse works very well...

Hi :D

tyee
31st January 2003, 19:07
Ntsita
I haven't tried it yet. I'll try today. Thanks for the info.

LB
Thanks for your script. It could help in the future. It's funny why pushing the enter key after you've tabbed to a button in CCE does not simulate a keypress. Usually in any program it does. Weird.

tyee