• Advertisement

Archived

This topic is now archived and is closed to further replies.

Wordwrapping in Win32 API text boxes

This topic is 6444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Use these when creating your edit box:

ES_AUTOVSCROLL, ES_MULTILINE, WS_VSCROLL, ES_WANTRETURN

Share this post


Link to post
Share on other sites
Yep that works... but how can I switch it on and off like notepad does?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can set them on/off with the SetWindowLong function. Details on how to use it is on the MSDN.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Okay, I tried that and it didn''t work either...

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

Share this post


Link to post
Share on other sites

  • Advertisement