Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SYS(2008,'I',2) in VFP8
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
SYS(2008,'I',2) in VFP8
Divers
Thread ID:
00797507
Message ID:
00797507
Vues:
62
Ok. I start from begin.
I need to change caret in my TextBox becouse some cases it is hardly visible in TextBox control in my Grid. The users need to stuggle to find the cursor. In FPD26 I use
SYS(2008,"I",2) 
Now I have VFP 8.0 (and WinXP) and off course it dosn't work

Could someone please tell me how I could this doing by the Windows API ?. I try like this by it doesn't worked well.
loForm=CREATEOBJECT("frmTest")
loForm.show 

DEFINE CLASS frmTest AS form
	DoCreate = .T.
	Caption = "Form1"
	WindowType = 1
	Name = "Form1"
	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 72, ;
		Top = 60, ;
		Width = 228, ;
		Name = "Text1"
       PROCEDURE Load
	DECLARE INTEGER CreateCaret IN user32 INTEGER hwnd, INTEGER hBitmap, INTEGER nWidth, INTEGER nHeight
	DECLARE INTEGER ShowCaret   IN user32 INTEGER hwnd
	DECLARE INTEGER GetFocus    IN user32
	DECLARE INTEGER HideCaret   IN user32 INTEGER hWnd
	DECLARE INTEGER SetCaretPos IN user32 INTEGER X, INTEGER Y
       ENDPROC
       PROCEDURE text1.GotFocus
		THIS.ForeColor=RGB ( 255, 255, 255 )
		THIS.BackColor=RGB ( 255,   0,   0 )
         LOCAL hFocus, lnRet 
		hFocus = GetFocus()
		ret = CreateCaret(hFocus, 1, 4, this.Height-4)
		ret = ShowCaret(hFocus)
		ret = SetCaretPos(this.left+3,this.top+2)
       ENDPROC
       PROCEDURE text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
        LOCAL hFocus, lnRet 
		hFocus = GetFocus()
		lnRet = HideCaret(hFocus)
		lnRet = CreateCaret(hFocus, 1, 4, this.Height-4)
		lnRet = SetCaretPos(this.left+(this.selStart*7)+10,this.top+2)
		lnRet = ShowCaret(hFocus)
       ENDPROC
ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform