Getting windows Handle or process Id of the Premiere CEP panel

Participant ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Dear Ppro fellows,

I have a quick question.

I created a CEP panel which starts my independent exe process (with its own UI).

It is desirable to get the handle of the CEP panel or process ID. How can I do this from my index.js 

 

Yaroslav

TOPICS
SDK, User interface or workspaces

Views

540

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 3 Correct Answers

Adobe Employee , Jun 11, 2021 Jun 11, 2021
From CEP documentation (search page for 'process id'): var result = window.cep.process.createProcess(“/bin/ls”); if (result.err == 0) { //no error var pid = result.data; //get process ID isRunning = window.cep.process.isRunning(pid); if (true == isRunning.data){ // do something clever } }

Likes

Translate

Translate
Participant , Jun 11, 2021 Jun 11, 2021
I agree. I just like my UI from c++. Spent a lot of time learning how to do it and finally made it similar to ppro style. And it has a lot of functions.So it's precious to me. Have a look)

Likes

Translate

Translate
Participant , Jun 15, 2021 Jun 15, 2021
Actually, I figured ou how to extract this handle.What I noticed using visual studio spy tool is that the CEP panel window belongs to the class of  "DroverLord - Window Class" of premiere.exe windows. There are many of them on the screen when you edit inside adobe Premiere. However when you launch your CEP panel this panel will be the top window of this class. Therefore, you can figure out your hanle with a single  (!) simple command:HWND hTopWindow = FindWindowA("DroverLord - Window Class", NUL...

Likes

Translate

Translate
Adobe Employee ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

From CEP documentation (search page for 'process id'):

var result = window.cep.process.createProcess(“/bin/ls”);
 if (result.err == 0) {     //no error
    var pid = result.data; //get process ID
    isRunning = window.cep.process.isRunning(pid);
    if (true == isRunning.data){
        // do something clever
    }
}

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Dear Bruce,

thank you for the quick reply.

I also saw this piece of code in documentation. However, I'm a bit confused. 

As far as I understand:

First, the window of the CEP panel is created and only then they suggest to start a process (with path = "/bin/ls" in this case)

However, the creation of initial window panel (with its own window handle) is also a process with its own id. (do I understand it right?)

Suppose, I got the id of this "secondary" process (result.data), then if I try to retrieve the window handle from this id (using c++ code) will I get the handle of the initial CEP panel?

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

> However, the creation of initial window panel (with its own window handle) is also a process with its own id.

Correct. PPro owns that window, and process; those are unavailable to the panel, running within that window. 

I'm not sure what you're attempting to do, but I know that no PPro panel developer has ever asked for that information (since 2013, when CEP started), which leads me to believe you're headed down an unsupported path.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Thanks! 

Probably, I'll survive without this handle, at least I know how to extract PPro handle, since it has "Premiere Pro" class name.)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

Why do you need a handle, at all? 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

I need it because it is suitable to have my custom ui window (my app.exe)  to be a child of cep panel. When cep panel window terminates, its child window is terminated as well. I think having a handle of cep panel window is a nice channel of communication between my custom exe and cep panel. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

You're definitely sailing into uncharted waters; I hope it works.

 

Any reason you couldn't do a UI in your panel...like every other panel developer, ever?

Might be simpler. 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 11, 2021 Jun 11, 2021

Copy link to clipboard

Copied

I agree. I just like my UI from c++. Spent a lot of time learning how to do it and finally made it similar to ppro style. And it has a lot of functions.

So it's precious to me. Have a look)anytex_preview.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 15, 2021 Jun 15, 2021

Copy link to clipboard

Copied

LATEST

Actually, I figured ou how to extract this handle.

What I noticed using visual studio spy tool is that the CEP panel window belongs to the class of  "DroverLord - Window Class" of premiere.exe windows. 

There are many of them on the screen when you edit inside adobe Premiere. However when you launch your CEP panel this panel will be the top window of this class. Therefore, you can figure out your hanle with a single  (!) simple command:

HWND hTopWindow = FindWindowA("DroverLord - Window Class", NULL)

And that is it. It is very handy. For example, your external exe process may generate some window, and you want this window to be positioned next to your CEP panel window. If you know the handle, you can easily get the position of the window of CEP panel on your desktop. Like this:

RECT rect;
GetWindowRect(hTopWindow, &rect);

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines