Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to get HWND of my InDesign_HWNDBasedPanelView

New Here ,
Jun 12, 2016 Jun 12, 2016

Hi to all,

I'm trying to add my Qt button to the dockable panel of the plugin. I need HWND of this panel to attach my button. How I can get it? With spy++ I found out that my panel's class name is InDesign_HWNDBasedPanelView but I don't know how to access it and get it's HWND.Could you tell me how to get it please? Thank you in advance.

TOPICS
SDK
519
Translate
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 1 Correct answer

Participant , Jun 12, 2016 Jun 12, 2016

Here's the solution that works for me:

HWND hwnd{};

InterfacePtr<IApplication> app(GetExecutionContextSession()->QueryApplication());

if (app)

{

     InterfacePtr<IPanelMgr> panelMgr(app->QueryPanelManager());

     if (panelMgr)

     {

          InterfacePtr<IControlView> controlView(this, UseDefaultIID());

          if (controlView)

          {

               PaletteRef panelsContainer = panelMgr->GetPaletteRefContainingPanel(controlView);

               hwnd = panelsContainer.GetOWLControl();

          }

  

...
Translate
Participant ,
Jun 12, 2016 Jun 12, 2016
LATEST

Here's the solution that works for me:

HWND hwnd{};

InterfacePtr<IApplication> app(GetExecutionContextSession()->QueryApplication());

if (app)

{

     InterfacePtr<IPanelMgr> panelMgr(app->QueryPanelManager());

     if (panelMgr)

     {

          InterfacePtr<IControlView> controlView(this, UseDefaultIID());

          if (controlView)

          {

               PaletteRef panelsContainer = panelMgr->GetPaletteRefContainingPanel(controlView);

               hwnd = panelsContainer.GetOWLControl();

          }

     }

}

Translate
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