MS Windows messages in multiline fields

forum.centura.team.developer (2000-2005) & forum.sqlwindows (2000-2005)
Nerea Diez

MS Windows messages in multiline fields

Post by Nerea Diez » 07 Feb 2005, 09:28

 Posted by:  Nerea Diez 

Hello,

I use MS Windows messages when the user press the TAB key in multiline
fields. In SQL Windows 5.0.3 PTF7, this code run correctly but not in
Centura. The sentence:

Set nPos = SalSendMsg( hWndItem, EM_GETSEL, 0, 0 )

in Centura return "0" in nPos and in SQL Windows 5.0.3 PTF7 return correct
value, for example "2818091". Perhaps Centura doesn't recognize the
EM_GETSEL message?

The code is:
On WM_KEYDOWN
If wParam = VK_TAB
Call Tratar_Tabulador ( )

Function: Tratar_Tabulador
Local variables
Number: nPos
Number: nPos1
Number: nPos2
Actions
Set nPos = SalSendMsg( hWndItem, EM_GETSEL, 0, 0 )
Set nPos1 = SalNumberLow( nPos )
Set nPos2 = SalNumberHigh( nPos )
Call SalStrReplace( MyValue, nPos1, nPos2 - nPos1, SalStrRepeatX( ' ', 7 ),
MyValue )
Set nPos1 = nPos1 + 7
Set nPos2 = nPos1
Set nPos = (nPos2 * 0x10000) + nPos1
Call SalPostMsg( hWndItem, POSICIONAR_FOCUS, 0, 0 )
Call SalPostMsg( hWndItem, EM_SETSEL, 0, 0xFFFF )
Call SalPostMsg( hWndItem, EM_SETSEL, 0, nPos )
Call SalSetFieldEdit( hWndItem, TRUE )

Thanks for your help,
Nerea.

Return to “forum.sqlwindows”

Who is online

Users browsing this forum: [Ccbot] and 0 guests