04-15-2024, 05:01 AM
Macro Macro3422
1
out sub.IsMouseInScintillaEditArea(GetQmCodeEditor)
#sub IsMouseInScintillaEditArea
function! hwndSci
;Returns 1 if mouse is in a Scintilla control but not in margins. Else 0.
;
;hwndSci - Scintilla control handle. It can be any Scintilla control, eg in QM, LA, Notepad++.
POINT p; xm p
ScreenToClient hwndSci &p
RECT r; GetClientRect hwndSci &r
if(!PtInRect(&r p.x p.y)) ret
int i marginsWidth
for(i 0 5) marginsWidth+SendMessage(hwndSci SCI.SCI_GETMARGINWIDTHN i 0)
ret p.x >= marginsWidth