Just to clarify, I do not think you are using managed C++, there for I am not sure why you are referring to a NM_CLICK notificaton code as an event.
Besides, you do not have to catch anything, you are not handling any exceptions, you are just handling a WM_NOTIFY message.
Anyway, I am not sure why you experience this particular behavior since I do not see what you do outside of the code snippet but I know what is causing it.
In our code snippet you use wParam to determine a notification code and this is incorrect. This control does not use wParam. To determine notification code you should do the following:
NMHDR* pHeader = (NMHDR*)lParam;
switch (pHeader->code)
< 加固 > p Header- & gt; code strong > 持有您应该使用的通知代码值, 而 < 坚固 > pheader- gt; hwndFrom strong > 是被单击的控件的控件控件 。
Furthermore, you using LOWORD(wParam) again and pass it as the parameter to function call. You are not showing what you do in this function but I can conclude that the code is also not correct.
The same lParam is a pointer to the NMLINK structure.
First member of this structure is mentioned above NMHDR, the next member is LITEM structure that should be used to determine what the URL is.
NMLINK* pNMLink = (NMLINK*)lParam;
LITEM iItem = pNMLink->item;
item.szUrl 是您在呼叫 ShellExercute 调用时应该使用的 URL 。