Wordwrapping in Win32 API text boxes

Started by
5 comments, last by Big Al 23 years, 9 months ago
Ok, No matter what I try I just cannot get this to work, I have spent large amounts of time flicking through MSDN and mucking around with the code just to fail time and time again. If anyone can help me out with this problem It would make me so overjoyed and happy and overjoyed and happy (you get the idea)... -Big AL
Advertisement
Use these when creating your edit box:

ES_AUTOVSCROLL, ES_MULTILINE, WS_VSCROLL, ES_WANTRETURN
http://www.crosswinds.net/~druidgames/resist.jpg
Yep that works... but how can I switch it on and off like notepad does?
You can set them on/off with the SetWindowLong function. Details on how to use it is on the MSDN.
Ok, I have used

unsigned long WordwrapStyle = WS_CHILD / WS_VSCROLL / WS_EX_LEFT / WS_VISIBLE / ES_MULTILINE / ES_AUTOVSCROLL;
SetWindowLong(hwndTextBox,GW_STYLE, WordwrapStyle);
SetWindowPos(hwndTextBox,0,0,0,0,0,SWP_NOMOVE / SWP_NOSIZE / SWP_NOZORDER / SWP_FRAMECHANGED);


This does NOT work, and I can''t see why...
Any help?

Big Al
Two possible problems one, no where in the documentation do I see GW_STYLE defined, I DO however see GWL_STYLE defined.

Problem two, you are including an EX style in your style definition. There are two seperate window properties, the Style and the ExStyle.. hense there is GWL_EXSTYLE as well. (In other words take out the WS_EX_LEFT and it should work, if you want to change an Ex style use the GWL_EXSTYLE, otherwise use GWL_STYLE)

-Omalacon
Okay, I tried that and it didn''t work either...

It is just being a big bad annoying Windows developer day...

This topic is closed to new replies.

Advertisement