Modal dialog box from resource file

New Here ,
Feb 11, 2021 Feb 11, 2021

Copy link to clipboard

Copied

How to create an application modal dialog box on a button click on Panel using Illustrator plugin development SDK ?

I show some API in AIUserSuite like OKCancelAlert, ErrorAlert, YesNoAlert, MessageAlert, MessageAlertEx, QuestionAlert.

However, I want to create my custom dialog from resource file, for that, How to get the main illustrator window's handle to pass in Win32 API 'DialogBox' to create the application modal dialogbox ?

TOPICS
Scripting, SDK

Views

293

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
Guest
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

Moving thread to the Illustrator forum from Using the Community

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 Community Professional ,
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

Hi Ged, can mods also add tags to posts? Here the SDK and Scripting tags would be useful if so.

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
Guest
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

Yep we can 🙂

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 Community Professional ,
Feb 12, 2021 Feb 12, 2021

Copy link to clipboard

Copied

Nice, thank you!

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
New Here ,
May 08, 2021 May 08, 2021

Copy link to clipboard

Copied

Did you ever figure out a solution to this? I need to access the Adobe window handle in order to spawn a modal dialog. I also need to make this work for MacOS. 

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
New Here ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

LATEST

I don't have perfect solution because the Panel window can be attached to other panel window too.

The workaround:

Find the most parent window handle for launching the dialog:

Used GetParent() function until I get the output parent handle as null or equal to GetDesktopWindow().

However, Sometime it is possible to go to Panel window from the dialog box.

Hence, the steps:

1. Disabled all the controls on Panel Window.

2. Launch the Dialogbox using MAKEINTRESOURCE, setting the parent as found by GetParent described above.

3. Once DialogBox returns, enable all the controls on Panel window

 

If you find any better solution then let me know.

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