Link to home
Start Free TrialLog in
Avatar of Eyooper
Eyooper

asked on

How do you change TABSTOPS in an edit control?

I've written an application using MASM and I'm trying to change the default tabstops in my edit control
using:

TS    DWORD     40
.
.
.
INVOKE     SendMessage, hREdit, EM_SETTABSTOPS, 1, TS

 The return is zero which means it did not process.
 I don't need to set up an array for variable length Stops.

 Thanks,

 Ewayne
Avatar of BigRat
BigRat
Flag of France image

I'm no expert on MASM but I assume you want the tab stop to bet 40, since when wParam=1 lParam is the distance between TabStops namely 40 dialog units.
   The EM_SETTABSTOPS message positions the tab stops for a MULTILINE EDIT CONTROL. Single line edit controls do not process this message, they just return zero!
Avatar of Eyooper
Eyooper

ASKER

I'm using a MULTILINE EDIT CONTROL for my text editor program, everything is working great, except I would like to change the tabstop spaces
I smell a rat! The hREdit is a handle to Rich Edit control, isn't? In which case you can't use it. Extract from Microsoft documentation :-

EM_SETTABSTOPS (Rich edit controls use the EM_SETPARAFORMAT message instead.)

The EM_SETPARAFORMAT message sets the paragraph formatting for the current selection in a rich edit control.

EM_SETPARAFORMAT
wParam = 0;  // not used; must be zero
lParam = (LPARAM) (PARAFORMAT FAR *) lpFmt;
 
Parameters

lpFmt

Pointer to a PARAFORMAT structure specifying the new paragraph formatting attributes. Only the attributes specified by the dwMask member are changed.

Rich Edit 2.0 and later: This parameter can be a pointer to a PARAFORMAT2 structure, which is an extension of the PARAFORMAT structure. Before sending the EM_SETPARAFORMAT message, set the structure's cbSize member to indicate the version of the structure.

Return Values

Returns a nonzero value if successful, or zero otherwise.

Do you need the data structure or do you have it somewhere?
Avatar of Eyooper

ASKER

I accept

Thanks
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eyooper

ASKER

Adjusted points to 100