Click here to Skip to main content
16,011,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating stellar GUI Pin
Iain Clarke, Warrior Programmer13-Feb-08 0:44
Iain Clarke, Warrior Programmer13-Feb-08 0:44 
QuestionHow Can repaint the views? [modified] Pin
Le@rner12-Feb-08 17:25
Le@rner12-Feb-08 17:25 
AnswerRe: How Can repaint the views? Pin
Swathee12-Feb-08 20:14
Swathee12-Feb-08 20:14 
GeneralRe: How Can repaint the views? Pin
Le@rner12-Feb-08 22:02
Le@rner12-Feb-08 22:02 
QuestionGET_X_LPARAM gives incorrect results inside WM_NOTIFY Pin
flip12-Feb-08 15:50
flip12-Feb-08 15:50 
GeneralRe: GET_X_LPARAM gives incorrect results inside WM_NOTIFY Pin
Iain Clarke, Warrior Programmer13-Feb-08 4:15
Iain Clarke, Warrior Programmer13-Feb-08 4:15 
GeneralRe: GET_X_LPARAM gives incorrect results inside WM_NOTIFY Pin
flip13-Feb-08 12:28
flip13-Feb-08 12:28 
GeneralRe: GET_X_LPARAM gives incorrect results inside WM_NOTIFY Pin
Iain Clarke, Warrior Programmer14-Feb-08 0:19
Iain Clarke, Warrior Programmer14-Feb-08 0:19 
It bugs me that that the NM_CLICK & NM_RCLICK notifications don't have a cursor position in an extended NMHDR too. It just feels clumsy to get it separately.

I would recommend GetMessagePos rather than GetCursorPos. I've been caught out in the past by a breakpoint before the getcursorpos, moving the mouse and getting the "wrong" value.

-----

As for trackpopupmenu, the window h would get a WM_COMMAND with a lParam of the menu item id of the selected menu unless you specify TPM_RETURNCMD. As that would have to mesh in with the main menu commands of my application I always use TPM_RETURNCMD anyway. Keeps local commands to local definitions. No worrys about my popup in one part of my app clashing with the numbers for another.

The TPM_NONOTIFY flags turns off messages (eg) WM_MENUSELECT from being sent, etc.

Another error you may have had. The NM_RCLICK gets sent to the dialog window - but did you use the dialog's or the treeview's window handle for the hWnd param of TrackPopupMenu? Maybe you were handling the WM_COMMAND message in the wrong window? You could check by using spy++ and monitoring all windows in your app for WM_COMMAND.

Iain.

Iain Clarke appearing in spite of being begged not to by CPallini.

GeneralRe: GET_X_LPARAM gives incorrect results inside WM_NOTIFY Pin
flip14-Feb-08 16:18
flip14-Feb-08 16:18 
GeneralRe: GET_X_LPARAM gives incorrect results inside WM_NOTIFY Pin
Iain Clarke, Warrior Programmer14-Feb-08 22:22
Iain Clarke, Warrior Programmer14-Feb-08 22:22 
QuestionHow go get the coordinate of a control object Pin
Kennis12-Feb-08 15:46
Kennis12-Feb-08 15:46 
GeneralRe: How go get the coordinate of a control object Pin
Stephen Hewitt12-Feb-08 16:24
Stephen Hewitt12-Feb-08 16:24 
QuestionNeed to share data between C++ DLL and C# Pin
Adlai12-Feb-08 15:21
Adlai12-Feb-08 15:21 
Question2. Questions about PowerDown and Hibernation - need help Pin
tibiz12-Feb-08 13:14
tibiz12-Feb-08 13:14 
GeneralRe: 2. Questions about PowerDown and Hibernation - need help Pin
Stephen Hewitt12-Feb-08 15:04
Stephen Hewitt12-Feb-08 15:04 
GeneralRe: 2. Questions about PowerDown and Hibernation - need help Pin
tibiz13-Feb-08 0:11
tibiz13-Feb-08 0:11 
GeneralRe: 2. Questions about PowerDown and Hibernation - need help Pin
Stephen Hewitt13-Feb-08 1:06
Stephen Hewitt13-Feb-08 1:06 
GeneralRe: 2. Questions about PowerDown and Hibernation - need help Pin
tibiz13-Feb-08 5:51
tibiz13-Feb-08 5:51 
GeneralProblems distributing release version Pin
Tom Paronis12-Feb-08 12:54
Tom Paronis12-Feb-08 12:54 
GeneralRe: Problems distributing release version Pin
Cedric Moonen12-Feb-08 20:29
Cedric Moonen12-Feb-08 20:29 
GeneralRe: Problems distributing release version Pin
Tom Paronis13-Feb-08 9:49
Tom Paronis13-Feb-08 9:49 
Generalint * -vs- Object * Pin
Areal Person12-Feb-08 11:44
Areal Person12-Feb-08 11:44 
GeneralRe: int * -vs- Object * Pin
Mark Salsbery12-Feb-08 12:34
Mark Salsbery12-Feb-08 12:34 
GeneralRe: int * -vs- Object * Pin
CPallini12-Feb-08 21:29
mveCPallini12-Feb-08 21:29 
GeneralRe: int * -vs- Object * Pin
Areal Person13-Feb-08 4:57
Areal Person13-Feb-08 4:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.