Page 1 of 1

Command execution difference: click item vs enter key on item in Quick Launch list

Posted: Wed Dec 13, 2023 3:01 pm
by zarkogajic
Hi Support,

Please shed some light on the following...

(some intro) I'm custom handing some commands, let's say "cmd.newDocHtml" for the sake of this question.

In my custom IUIX_CmdHandler implementation, for UIX_CmdNotify_Exec in OnNotify I'm calling the following 3 "code lines":

1. Register IUIX_EventMonitor
2. Call Original Handler -> this will bring up the "DlgNewDocFromWebPage" dialog.
3. Unregister IUIX_EventMonitor

My code does what's needed in IUIX_EventMonitor.OnEventMonitor for e.Visible for "DlgNewDocFromWebPage" (pTarget.ID).

The above all works as expected WHEN that command is executed via mouse click on the corresponding item in the "File-New Document-From Web Page" main menu.

Also, all works as expected if I initiate the command from the "Quick Launch" via mouse click:

image.png

However: if I hit the enter (/return) key on that item in the Quick Launch list, my IUIX_EventMonitor never gets the "DlgNewDocFromWebPage" for pTarget.ID. Actually my IUIX_EventMonitor.OnEventMonitor never gets called - as if it is not registered (but is!)

So, clicking vs enter-key works differently.

Why ?

p.s.
The above applies as described for other commands as well ...

-žarko

Re: Command execution difference: click item vs enter key on item in Quick Launch list

Posted: Thu Dec 14, 2023 3:57 am
by Vasyl - PDF-XChange
We will check this case and let you know what is going on...

Re: Command execution difference: click item vs enter key on item in Quick Launch list

Posted: Fri Dec 15, 2023 5:44 am
by Vasyl - PDF-XChange
We found the reason of the trouble. It occurs because OnNotify(Exec) is called inside from the internal EventMonitor installed by QuickLaunch control for itself. And in this specific context all new registered monitors will not get any event until runtime will exit from that context. We will fix that issue in the upcoming release. Or currently you may use the simple workaround - register your event monitor once and globally before any using the QuickLaunch control.

Re: Command execution difference: click item vs enter key on item in Quick Launch list  SOLVED

Posted: Fri Dec 15, 2023 6:38 am
by zarkogajic
Hi Vasyl,

Thanks!

-žarko

Command execution difference: click item vs enter key on item in Quick Launch list

Posted: Fri Dec 15, 2023 9:42 am
by Stefan - PDF-XChange
:)