Quantcast
Channel: Adobe Community : Popular Discussions - After Effects SDK
Viewing all articles
Browse latest Browse all 73444

Modal dialog in Premiere Pro (using AE SDK)

$
0
0

Hello all,

 

I have a plugin that does some long, intensive processing inside a single render call. I show my own progress bar in a modal dialog while this happens.

 

This is working fine in After Effects, but it's causing a crash in Premiere Pro. I get a few messages through the WndProc but then they just stop coming. I've attached some code below. Does anyone have any idea what might be going on there?

 

many thanks for any help,

 

Hugh

 

Here's the code that creates the dialog:

 

//assume host window is foregrounded

hostWindow = GetForegroundWindow();

// also tried HWND hwnd; PF_GET_PLATFORM_DATA(PF_PlatData_MAIN_WND, &hwnd);


hDlg = CreateDialog(theDLL, MAKEINTRESOURCE(IDD_PROGRESS), hostWindow, reinterpret_cast<DLGPROC>(DlgProc));

SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)this);


CenterDialog();


ShowWindow(hDlg, SW_SHOW); UpdateWindow(hDlg);

SetForegroundWindow(hDlg); BringWindowToTop(hDlg);

 

hProgress = GetDlgItem(hDlg, IDC_PROGRESS1);

SendMessage(hProgress, PBM_SETRANGE, 0, MAKELPARAM(0, total));

and here's the window proc:
static LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
ProgressDialog *myOwner = (ProgressDialog*)GetWindowLongPtr(hWndDlg, GWLP_USERDATA);

switch(Msg)
{
case WM_INITDIALOG:
        case WM_WINDOWPOSCHANGING:
return TRUE;

case WM_NCLBUTTONDOWN: //prevent user moving the dialog box
if (HTCAPTION == wParam) return TRUE;
else return FALSE;

case WM_COMMAND:
switch(wParam)
{
case IDOK:
return TRUE;
case IDCANCEL:
myOwner->cancelled=true;
return TRUE;
}
break;
}
return FALSE;
}

Viewing all articles
Browse latest Browse all 73444

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>