Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send message to Winform control to obtain information
#1
Hi,

I want to obtain the position of the text insertion point(Caret) in the Winform control (pink box in the picture below). The GetCaretXY function cannot obtain coordinate information

This problem has been bothering me for a long time, and now I have come up with a new solution:

Inside the Winform control, I can use the following code to obtain the position of the Caret, as shown in the following image
 
Code:
Copy      Help
Winform C# code:
var viewBounds = se1.ActiveView.GetCharacterBounds(se1.ActiveView.Selection.CaretPosition).Rect;
Console.WriteLine(viewBounds.ToString());

How to send this message in QM and obtain the position of the Caret? I can already obtain the handle of this control through the QM code below

Thanks in advance for any suggestions and help
david

[Image: 2.png]

Function Macro3
Code:
Copy      Help
int w=win("Actipro" "*.Window.*")
int c=child("" "*.Window.*" w 0x0 "wfName=syntaxEditor1")
out c


;SendMessageW c ??? 0 0  ;;Todo: Send a message to the control to obtain the result of the following code execution
;______________________________________________________________________
;Winform C# code:
;var viewBounds = se1.ActiveView.GetCharacterBounds(se1.ActiveView.Selection.CaretPosition).Rect;
;Console.WriteLine(viewBounds.ToString());


Messages In This Thread
Send message to Winform control to obtain information - by Davider - 05-12-2023, 10:13 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)