Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralEdit control beeps on Esc or Tab keys Pin
Jim Crafton1-Nov-04 5:25
Jim Crafton1-Nov-04 5:25 
GeneralRe: Edit control beeps on Esc or Tab keys Pin
peterchen1-Nov-04 7:24
peterchen1-Nov-04 7:24 
GeneralOne more on print orientation and paper size specifications Pin
Member 12423731-Nov-04 4:06
Member 12423731-Nov-04 4:06 
GeneralRe: One more on print orientation and paper size specifications Pin
Phil J Pearson1-Nov-04 6:10
Phil J Pearson1-Nov-04 6:10 
GeneralRe: One more on print orientation and paper size specifications Pin
Member 12423731-Nov-04 10:36
Member 12423731-Nov-04 10:36 
GeneralRe: One more on print orientation and paper size specifications Pin
Phil J Pearson2-Nov-04 1:25
Phil J Pearson2-Nov-04 1:25 
GeneralRe: One more on print orientation and paper size specifications Pin
Qadddd2-Nov-04 7:45
Qadddd2-Nov-04 7:45 
GeneralHook woes Pin
Roger Allen1-Nov-04 1:38
Roger Allen1-Nov-04 1:38 
I have set up an application hook procedure. This hook is looking for WM_INITMENUPOPUP, WM_MEASUREITEM and WM_DRAWITEM messages so that I can make all menus shown by the application ownerdrawn.

The hook does catch these as required, but its the actual processing of the message I am having trouble with.

For example. My WM_MEASUREITEM handler correctly measures the menu item and returns the correct size, yet when I get to the WM_DRAWITEM message to draw it, the size comes through as 12 * 16, which is the default size of a menu item which has not been measured (not processed WM_MEASUREITEM).

It looks like I cannot modiy the MEASUREITEM struct members in the hook procedure and have the application use these values.

I have tried both the WH_CALLWNDPROC and WH_CALLWNDPROCRET hook methods for before/after porcessing of the message, but regardless the system is not using the sizes I measure for the items.

Anyone know of this problem or how to get around it? The docs on hooks are pretty sparse.

I would also like to know whether is possible from within the hook procedure to stop the application processing the message as I have already done the work in the hook procedure.


If you vote me down, my score will only get lower
GeneralRe: Hook woes Pin
vcplusplus1-Nov-04 2:38
vcplusplus1-Nov-04 2:38 
GeneralRe: Hook woes Pin
Roger Allen1-Nov-04 2:57
Roger Allen1-Nov-04 2:57 
GeneralRe: Hook woes Pin
PJ Arends1-Nov-04 7:47
professionalPJ Arends1-Nov-04 7:47 
GeneralRe: Hook woes Pin
Roger Allen1-Nov-04 22:55
Roger Allen1-Nov-04 22:55 
GeneralRe: Hook woes Pin
PJ Arends2-Nov-04 6:09
professionalPJ Arends2-Nov-04 6:09 
GeneralRe: Hook woes Pin
Roger Allen2-Nov-04 7:04
Roger Allen2-Nov-04 7:04 
GeneralRe: Hook woes Pin
PJ Arends2-Nov-04 16:17
professionalPJ Arends2-Nov-04 16:17 
GeneralRe: Hook woes Pin
Roger Allen2-Nov-04 22:46
Roger Allen2-Nov-04 22:46 
GeneralDiskQuota on remote machine Pin
std77021-Nov-04 1:24
std77021-Nov-04 1:24 
GeneralRe: DiskQuota on remote machine Pin
David Crow1-Nov-04 4:08
David Crow1-Nov-04 4:08 
GeneralRe: DiskQuota on remote machine Pin
std77021-Nov-04 5:01
std77021-Nov-04 5:01 
QuestionHow do I add chart using Visual C++ Pin
pubududilena1-Nov-04 0:52
pubududilena1-Nov-04 0:52 
AnswerRe: How do I add chart using Visual C++ Pin
Selvam R1-Nov-04 3:19
professionalSelvam R1-Nov-04 3:19 
GeneralUse Clipboard in MFC Application Pin
sweep1231-Nov-04 0:36
sweep1231-Nov-04 0:36 
GeneralSystem Path Pin
Dave_Sullivan3331-Oct-04 23:44
Dave_Sullivan3331-Oct-04 23:44 
GeneralRe: System Path Pin
Dominik Reichl1-Nov-04 4:32
Dominik Reichl1-Nov-04 4:32 
QuestionWho gets the Mutex? Pin
Malcolm Smart31-Oct-04 23:30
Malcolm Smart31-Oct-04 23:30 

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.