Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get text from left/right pane in QM and GetWinId
#1
question 1

How do I get the text from the left or right code editor pane in QM?

I got this from another topic, and it works.
But the problem is that it targets the left pane (id 2210)

Macro Macro11
Code:
Copy      Help
str s
int h=id(2210 _hwndqm)
int lens=SendMessage(h SCI.SCI_GETTEXTLENGTH 0 0)
s.fix(SendMessage(h SCI.SCI_GETTEXT lens+1 s.all(lens)))
out s

How can I get the code within the pane that is active (2210 or 2211)?

Has it something to do with the FILTER class?
(beneath code is wrong)

Macro Macro14
Code:
Copy      Help
FILTER f
...
int h1 = id(2210 "Quick Macros")
int h2 = id(2211 "Quick Macros")
...
if(GetWinId(f.hwnd)=2210)
...

question 2
And how do I get the ID of any currently active Window Control.
For example, the edit pane in notepad has ID '15'

Macro Macro14
Code:
Copy      Help
int w=win("Untitled - Notepad" "Notepad")
lef 416 137 id(15 w) 1 ;;editable text

If Notepad was the active window, how would I retrieve '15'
Should I first start with

Macro Macro14
Code:
Copy      Help
int w=win()

To get the active window? And then use the GetWinId function?
But I can't get the syntax correct.
#2
1. GetQmCodeEditor

2. child() without arguments gets focused control handle.
#3
Thank you!


Forum Jump:


Users browsing this thread: 2 Guest(s)