Hi All:
I've got a couple of quick questions.
First of all, how would I go about setting the font of a Rich Edit control? I am currently sending the window that created the Rich Edit a WM_SetFont message with a handle to a font created by CreateFondIndirect. This stratigy works for all controls - buttons, combo and list boxes, even standard text boxes - but when it comes to the rich edit it doesn't seem to set the text font and weight. Everything else works, the size and italic, strikeout and underline portions of the font are set just fine in the rich edit. What am I doing wrong?
Also, I'm trying to find out when my program recieves and looses the keyboard focus, so the back ground music I have playing only plays when the user is actually using my program. WM_SetFocus is sent just fine, but as near as I can figure, the WM_KillFocus message is sent to my callback directly after WM_SetFocus is sent - totally rediculous, I know, but that is what it seems to do. It does send EN_KillFocus messages when I Alt+Tab away from the program, but those are also sent when I tab out of the edit box to another control so that is unreliable, and different messages are sent if I switch away and a button (for example) has the keyboard focus. Any other ideas?
Thanks for your help. I've been battling these 2 little things for a while now. Just thought someone might have a magical solution for them.
Have a great weekend!
Danny.
I've got a couple of quick questions.
First of all, how would I go about setting the font of a Rich Edit control? I am currently sending the window that created the Rich Edit a WM_SetFont message with a handle to a font created by CreateFondIndirect. This stratigy works for all controls - buttons, combo and list boxes, even standard text boxes - but when it comes to the rich edit it doesn't seem to set the text font and weight. Everything else works, the size and italic, strikeout and underline portions of the font are set just fine in the rich edit. What am I doing wrong?
Also, I'm trying to find out when my program recieves and looses the keyboard focus, so the back ground music I have playing only plays when the user is actually using my program. WM_SetFocus is sent just fine, but as near as I can figure, the WM_KillFocus message is sent to my callback directly after WM_SetFocus is sent - totally rediculous, I know, but that is what it seems to do. It does send EN_KillFocus messages when I Alt+Tab away from the program, but those are also sent when I tab out of the edit box to another control so that is unreliable, and different messages are sent if I switch away and a button (for example) has the keyboard focus. Any other ideas?
Thanks for your help. I've been battling these 2 little things for a while now. Just thought someone might have a magical solution for them.
Have a great weekend!
Danny.
Comment