Jump to content

Word wrap question


Recommended Posts

Is there a way, with AutoIt, to turn off word wrap in an edit control. The word wrap is screwing up my script output.

Might get more help if you included a script.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

What sort of script would you like? I've got msgbox scripts, counter scripts, pixelsearch scripts....

I don't need someone the fix my code I need to know if (and how) word wrap can be turned off.

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

What sort of script would you like? I've got msgbox scripts, counter scripts, pixelsearch scripts....

I don't need someone the fix my code I need to know if (and how) word wrap can be turned off.

If it's an AutoIT generated Edit box that gives you the problem, post the shortest demo script possible that demonstrates the problem. Someone will find the fix very soon afterwards.

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

The word wrap, or lack thereof, is in another programs edit control. There doesn't seem to be anything wrong with my script other than the fact that the text that my script gets from the outside app gets read in as 3 lines, when in actuality it is 1 line (word wrapped).

When I force the other apps edit control to be very wide it will no longer word wrap (for obvious reasons). Making this adjustment doesn't seem to be the answer just because it will funky up the other app (it's do-able I suppose, but not preferred).

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

The word wrap, or lack thereof, is in another programs edit control. There doesn't seem to be anything wrong with my script other than the fact that the text that my script gets from the outside app gets read in as 3 lines, when in actuality it is 1 line (word wrapped).

When I force the other apps edit control to be very wide it will no longer word wrap (for obvious reasons). Making this adjustment doesn't seem to be the answer just because it will funky up the other app (it's do-able I suppose, but not preferred).

Then perhaps just removing the line breaks after reading the control would be easier:

$sText = ControlGetText("Window Title", "Window Text", "Edit1")
$sText = StringReplace($sText, @CR, "")
$sText = StringReplace($sText, @LF, "")
MsgBox(64, "Results", "Text with line breaks removed: " & $sText

:whistle:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

being your ruluctant to give all the information to help you, I'll do the same

DllCall("user32.dll", "none", "SendMessage", "hwnd", $h_edit, "int", 0xC8, "int", 0, "int", 0)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

I am not 100% sure, but if the word wrap is kept then there might be CR and LF in the string. So assuming you can read the info out of the edit control this should work.

Where $String is equal to the string from the edit control.

$String = StringReplace($String, Chr(10), "")
$String = StringReplace($String, Chr(13), "")

EDIT: Ahh got beat to it.. I type too slow lol.

Edited by Knight
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...