herzl shemuelian
herzl shemuelian

Reputation: 3508

How I can get a focus message in MFC?

I have a dialog box with some CListCtrl. I want that when I click on one of them, receive killfocus or setfocus message.

How I can get it?

Upvotes: 0

Views: 1335

Answers (1)

Cody Gray
Cody Gray

Reputation: 244903

The CListCtrl class wraps the Win32 ListView control. That control communicates with its parent (your dialog) via WM_NOTIFY messages.

So you can process WM_NOTIFY messages from your list control in your dialog class. Use the Properties window to create an OnChildNotify handler function and write a switch statement that handles the notification message(s) of interest.

The possible notification messages are listed here in the Windows SDK documentation.

Upvotes: 1

Related Questions