Creating your own control... Custom font issues...
I am creating a URL static control, which I guess would be simular to the windows SysLink control... The reason I am creating this is because the SysLink control is not available unless users have the CommCtrl32.dll version 6.+.
Handled messages:
WM_SETFONT:
If the controls style has the underline style set, I get the LOGFONT structure for the font being passed in and set the lfUnderline member to true, and create a new font. This new font is stored in a struct, which is unique for each control of this class.
WM_PAINT:
I select the font stored in the controls struct into the current DC, and draw the text... after I do this I select the original font back into the DC.
WM_LBUTTONDOWN:
Changes the controls mode ( changes the color ) and forces the control to be repainted.
The problem is when I click on the control... the text color is changed fine and the font that should be used... is.... But... the font for other controls on the Dialog are changed... to Shell Dlg or something, which I didn't expect to happen...
I was wondering if anyone had any ideas why this may be happening or any tips when using custom fonts.
I can make the code available if need be.