Thanks again. I had a bit of trouble getting EM_LINESCROLL to work, then I had the idea of scrolling a negative number and it works great.
Also, your advice of creating a global font and giving the text box the WM_SETFONT message worked wonders.Code:int nLength = SendMessage(hwndMainBox, EM_GETLINECOUNT, 0, 0); SendMessage (hwndMainBox, EM_LINESCROLL, (WPARAM) NULL, -((LPARAM) nLength));
Not sure if I did that right, but it works. "static HFONT FONT_CourierNew;" is defined globally, CreateFont is right after the parent window is created in WinMain, and the WM_SETFONT message is sent to the edit box right after it is created in WM_CREATE. Is there anything I've done that will case problems in the future? I'm pretty much winging it at this point and learning from my mistakes since I'm programming in territory I've never touched before.Code:static HFONT FONT_CourierNew; ... ... ... FONT_CourierNew=CreateFont (18, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Courier New"); ... ... ... SendMessage(hwndMainBox, WM_SETFONT, (WPARAM)FONT_CourierNew, (LPARAM)TRUE);
I do have another question that is on my mind. Is it possible to bind the width and height of child controls to the width and height of the parent window? I want the controls to be resized and redrawn when the user alters the size of the window either with the maximize/restore button or with dragging the edges.




Reply With Quote