CHARFORMAT to LOGFONT

Thought someone might require this conversion. CharformatToLogfont(CHARFORMAT & cf, LOGFONT & lf, COLORREF & cr) {   lf.lfCharSet = cf.bCharSet; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; lf.lfEscapement = 0; lf.lfOrientation = 0; lf.lfOutPrecision = OUT_DEFAULT_PRECIS; lf.lfQuality = DEFAULT_QUALITY; lf.lfPitchAndFamily = DEFAULT_PITCH;     if ( (cf.dwEffects & CFE_BOLD) == CFE_BOLD) { lf.lfWeight = FW_BOLD; }   CDC dc;…

Read More

LOGFONT to CHARFORMAT

Thought someone might require this conversion.   LogfontToCharformat(LOGFONT & lf, COLORREF & cr, CHARFORMAT & cf) {   cf.cbSize = sizeof(CHARFORMAT); cf.dwMask = CFM_COLOR | CFM_FACE | CFM_SIZE | CFM_CHARSET | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_OFFSET; cf.dwEffects = 0;   if (lf.lfWeight >= FW_BOLD) { cf.dwEffects |= CFE_BOLD; }   if…

Read More

SendInput Function

We had to use the “SendInput Function” to send keystrokes to any active window in our program PikyFolders. We had troubles using it first. We also referred to many other samples on the Internet. But still it was not clear that after sending every keystroke we must also send the same keystroke with the KEYEVENTF_KEYUP…

Read More