Override click inside QuickLaunch results list SOLVED
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Override click inside QuickLaunch results list
Hi Support,
Is there a way to override what happens / catch / get notified when a click happens for the item in the QuickLaunch list:
Note: I do not want to custom handle the associated command - I want to know what command was selected/clicked (and stop it from being executed).
I guess that's some IUIX_List and I should be able to use IUIX_ListCallbacks and List_OnItemClick. But not sure from what IUIX_Obj to get to that list? And if I can, how to get the actual command from List_OnItemClick?
-žarko
Is there a way to override what happens / catch / get notified when a click happens for the item in the QuickLaunch list:
Note: I do not want to custom handle the associated command - I want to know what command was selected/clicked (and stop it from being executed).
I guess that's some IUIX_List and I should be able to use IUIX_ListCallbacks and List_OnItemClick. But not sure from what IUIX_Obj to get to that list? And if I can, how to get the actual command from List_OnItemClick?
-žarko
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 11262
- Joined: Wed Jan 03, 2018 6:52 pm
Re: Override click inside QuickLaunch results list
Hello, zarkogajic
I have passed this along for review by the Dev team, hopefully they can get back to us in a timely manner.
Kind regards,
I have passed this along for review by the Dev team, hopefully they can get back to us in a timely manner.
Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Dan,
Ping here ...
-žarko
Ping here ...
-žarko
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Override click inside QuickLaunch results list
Hi Zarko.
You may try this way:
HTH
You may try this way:
Code: Select all
const int id_cmd_quickLaunchList = PXV_Inst.Str2ID("cmd.quickLaunchList");
public void OnEventMonitor(PDFXEdit.IUIX_Obj pTarget, PDFXEdit.IUIX_Event pEvent)
{
if (pEvent.Code == (int)WM_LBUTTONUP)
{
if (pTarget.ID == id_cmd_quickLaunchList)
{
IntPtr impl = IntPtr.Zero;
pTarget.QueryImpl(typeof(IUIX_List).GUID, null, out impl);
IUIX_List list = (IUIX_List)Marshal.GetObjectForIUnknown(impl);
if (!IsMyCallback(list.Callbacks))
{
list.Callbacks = CreateMyCallback(list.Callbacks); // it sets my implementation of IUIX_ListCallbacks interface that
// mostly redirects all calls to the original callbacks,
// BUT overrides the IUIX_ListCallbacks::List_OnItemClicked
}
}
}
}
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Vasyl,
Thanks.
Can I get what item/cmd was clicked with List_OnItemClicked ?
-žarko
Thanks.
Can I get what item/cmd was clicked with List_OnItemClicked ?
-žarko
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Vasyl,
I've tried your code ...
WM_LBUTTONUP is too late as at that moment the item in the list is already clicked and the command gets executed and list hidden/destroyed - so List_OnItemClick does not happen.
I've changed that to use "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" - so inject my callback when the list is made visible. This works and upon clicking an item in the list the List_OnItemClick does happen.
But, as I feared - no real data I can use there to figure out what item (what command) was clicked (except the item position in the list (UIX_ListItemID.nItem). As I remember, for a similar request sometime in the past, the answer was "for internal use, not available to SDK"
So, new questions:
Q1. Is my approach with "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" the best I can use?
Q2. Is there any (never mind how crazy or complex) way to get to the actual item that was clicked - the command ID that was selected/clicked to be executed ? I know the item in that list might not be a command but some kind of "show sub-menu" ...
3.How come the selected command does get executed even if I do not call "Original Callbacks List_OnItemClick"?
I tried to return E_FAIL or E_ABORT from my List_OnItemClick but the selected command still gets executed.
If I return S_FALSE - nothing happens (command does not get executed, list remains visible) - so I guess there is some return code I can use to stop the command from being executed (but list made hidden as if it was executed).
Edit: Ok, if I set "result = s_false" and also do "pList.Obj.Show(0, false)" - selected command does not get executed and the list gets hidden - good enough for me.
So, only Q1 and Q2 open ...
-žarko
I've tried your code ...
WM_LBUTTONUP is too late as at that moment the item in the list is already clicked and the command gets executed and list hidden/destroyed - so List_OnItemClick does not happen.
I've changed that to use "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" - so inject my callback when the list is made visible. This works and upon clicking an item in the list the List_OnItemClick does happen.
But, as I feared - no real data I can use there to figure out what item (what command) was clicked (except the item position in the list (UIX_ListItemID.nItem). As I remember, for a similar request sometime in the past, the answer was "for internal use, not available to SDK"

So, new questions:
Q1. Is my approach with "(pEvent.Code = e_Visible) AND (pEvent.Param1 = 1)" the best I can use?
Q2. Is there any (never mind how crazy or complex) way to get to the actual item that was clicked - the command ID that was selected/clicked to be executed ? I know the item in that list might not be a command but some kind of "show sub-menu" ...
3.
I tried to return E_FAIL or E_ABORT from my List_OnItemClick but the selected command still gets executed.
If I return S_FALSE - nothing happens (command does not get executed, list remains visible) - so I guess there is some return code I can use to stop the command from being executed (but list made hidden as if it was executed).
Edit: Ok, if I set "result = s_false" and also do "pList.Obj.Show(0, false)" - selected command does not get executed and the list gets hidden - good enough for me.
So, only Q1 and Q2 open ...
-žarko
-
- Site Admin
- Posts: 2448
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Override click inside QuickLaunch results list
Q1 - yes, this can be used
Q2 - the List_OnGetItemText of the original list.Callbacks can be used to get the display text of the item. Unfortunately, nothing more...
Q2 - the List_OnGetItemText of the original list.Callbacks can be used to get the display text of the item. Unfortunately, nothing more...
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list SOLVED
Hi Vasyl,
Thanks.

So, no go.
-žarko
Thanks.

So, no go.
-žarko
-
- Site Admin
- Posts: 11262
- Joined: Wed Jan 03, 2018 6:52 pm
Override click inside QuickLaunch results list

Dan McIntyre - Support Technician
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
PDF-XChange Co. LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Vasyl,
-žarko
Long shot but I have to ask: could you please (, please ...) expose something there (OnClick) so I can get the underlying item ...Vasyl - PDF-XChange wrote: ↑Thu Jul 03, 2025 11:54 pm Q2 - the List_OnGetItemText of the original list.Callbacks can be used to get the display text of the item. Unfortunately, nothing more...
-žarko
-
- User
- Posts: 13
- Joined: Wed Sep 11, 2024 1:43 pm
Re: Override click inside QuickLaunch results list
Hello zarkogajic,
Unfortunately, there is no easy way to get the ID of the command that was clicked here. I will try to explain Vasyl's idea of getting the text of an element in more detail.
When processing List_OnItemClick, you get data on which list item was clicked - UIX_ListItemID.nItem, and using this, you call List_OnGetItemText to get the text of that item.
This text will usually contain the name and tip of the command. You should split these values.
Next, you need to get IUIX_CmdManager (https://sdkhelp.pdf-xchange.com/view/PX ... CmdManager), from which you can get IUIX_CmdCollection (https://sdkhelp.pdf-xchange.com/view/PX ... Collection), which contains all the commands. Using the index(https://sdkhelp.pdf-xchange.com/view/PX ... ction_Item), you can get each command (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd) and compare it with the data obtained in the first step and its properties ‘Title’ (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd_Title) and ‘Tip’ (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd_Tip).
It is important to check both values, as some commands may have the same names.
When the required command is found, you can obtain its ID (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd_ID)
This is the only solution I can offer. I hope it helps.
Kind regards,
Misha
Unfortunately, there is no easy way to get the ID of the command that was clicked here. I will try to explain Vasyl's idea of getting the text of an element in more detail.
When processing List_OnItemClick, you get data on which list item was clicked - UIX_ListItemID.nItem, and using this, you call List_OnGetItemText to get the text of that item.
This text will usually contain the name and tip of the command. You should split these values.
Next, you need to get IUIX_CmdManager (https://sdkhelp.pdf-xchange.com/view/PX ... CmdManager), from which you can get IUIX_CmdCollection (https://sdkhelp.pdf-xchange.com/view/PX ... Collection), which contains all the commands. Using the index(https://sdkhelp.pdf-xchange.com/view/PX ... ction_Item), you can get each command (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd) and compare it with the data obtained in the first step and its properties ‘Title’ (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd_Title) and ‘Tip’ (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd_Tip).
It is important to check both values, as some commands may have the same names.
When the required command is found, you can obtain its ID (https://sdkhelp.pdf-xchange.com/view/PXV:IUIX_Cmd_ID)
This is the only solution I can offer. I hope it helps.
Kind regards,
Misha
-
- User
- Posts: 1511
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Override click inside QuickLaunch results list
Hi Misha,
Thanks. Yes, that's the approach I use - a bit cumbersome - that's why I asked to consider exposing some internal stuff
-žarko
Thanks. Yes, that's the approach I use - a bit cumbersome - that's why I asked to consider exposing some internal stuff

-žarko