Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Expanding options for autotext MenuOptions
#1
The autotext insertion in LA is unable to find the insertion point in some controls, so I want to extend it.

Here's the assumption:
I have a DLL file compiled successfully in C++, named CaretPos.dll
There is a public function in the DLL: bool GetCaretPosExt(IntPtr rect).
It returns true if it successfully retrieves the value of rect, otherwise it returns false.

How should I use this function in the options below to solve the problem?

The solution will be valuable for many similar tasks.
Thanks in advance
David
 
Code:
Copy      Help
tt.MenuOptions = new(PMFlags.ByCaret | PMFlags.WindowCenter);
#2
Quote:How should I use this function in the options below to solve the problem?
Wait for next LA, probably it will have more autotext menu options.
#3
In next LA use popupMenu.caretRectFunc. Example:

Code:
Copy      Help
popupMenu.caretRectFunc = () => {
    if (miscInfo.getTextCursorRect(out var r, out _)) return r;
    
    //alternative "get caret rect" code here
    
    return null; //failed
};

var m = new popupMenu("461cda57-2885-4175-bace-0795fd4ad446");

m["Item1"] = o => { };

m.Show(PMFlags.ByCaret);
#4
Could you provide an example code for calling a C++ DLL component in the above code?  thank you.
Quote:I have a DLL file compiled successfully in C++, named CaretPos.dll
There is a public function in the DLL: bool GetCaretPosExt(IntPtr rect).
It returns true if it successfully retrieves the value of rect, otherwise it returns false.
#5
Learn C# or ask an AI, it's not LA-specific.


Forum Jump:


Users browsing this thread: 1 Guest(s)