- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I created the following child window with the WC_LISTVIIEW class and LVS_REPORT style:
hWndList = CreateWindowEx(WS_EX_RIGHTSCROLLBAR, WC_LISTVIEWA, " "C, IOR(WS_VISIBLE, IOR(WS_VSCROLL,
IOR(WS_CHILD, LVS_REPORT))),0, LVycoord ,rclist%right, height_LV_Wnd, hwnd, ID_LISTVIEW, ghInstance, NULL)
The child window with the List View control works fine.
I would like to double click a list View item and intercept the notification message (NM_DBLCLK sent via WN_NOTIFY).
I tried to subclass the child window (hWndList) using an example from the SDK, but my attempts failed, so I was wondering if it is possible to subclass this window. If not, is there another way to intercept the WM_NOTIFY message?
hWndList = CreateWindowEx(WS_EX_RIGHTSCROLLBAR, WC_LISTVIEWA, " "C, IOR(WS_VISIBLE, IOR(WS_VSCROLL,
IOR(WS_CHILD, LVS_REPORT))),0, LVycoord ,rclist%right, height_LV_Wnd, hwnd, ID_LISTVIEW, ghInstance, NULL)
The child window with the List View control works fine.
I would like to double click a list View item and intercept the notification message (NM_DBLCLK sent via WN_NOTIFY).
I tried to subclass the child window (hWndList) using an example from the SDK, but my attempts failed, so I was wondering if it is possible to subclass this window. If not, is there another way to intercept the WM_NOTIFY message?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is possible to subclass the listview, but you don't need to. Controls in general are notintended to be subclassed; it is possible, but only if you need something really special. Controls aredesigned to be controlled from their parent window.
That being said, have in mind that WM_NOTIFY/NM_DBLCLK is sent to listview's parent window (hwnd) -- you're supposed to handle it in its window procedure, not in listview's subclassed procedure.
Or am I missing something in your question?
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply jugoslavdujic.
I thought that the child window (hWndList) was the parent. I will treat the main window (hwnd) as the parent, and see what happens.
I thought that the child window (hWndList) was the parent. I will treat the main window (hwnd) as the parent, and see what happens.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page