You have to use the ADMWinHostSuite (that's not portable to the Mac side but there is an equivalent ADMMacHostSuite):
ADMWinHostSuite4* sADMWinHost = NULL;
error = sSPBasic->AcquireSuite(kADMWinHostSuite, kADMWinHostSuiteVersion4, (const void **)&sADMWinHost);
And then you can ask for the window:
HWND hwnd = (HWND)sADMWinHost->GetPlatformAppWindow();
Now you have all the things you need, if you call it in the plugin startup you may need to call getparent on that window to obtain the correct window holding the menu, anyway calling it from the plugin startup you will not be able to obtain the command in the correct locale because Illustrator use some sort of identifier in the menu that are translated to the correct values at runtime.
No comments:
Post a Comment