Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Name of Current Active Window
#1
This one sort of makes me feel like a n00b, but I've been trying to figure it out for the last 15 minutes and searched the forum...but how do I get the name of the current active window? I can't believe I've never needed to know this before now!

What I'm doing is using Notepad++ to edit a .ino file...I also have the .ino file open in Arduino IDE where the setting, "Use external editor" is set.

So when I click "CTRL+U" a QM function first keys CTRL+S to save, then grabs the title of the window and gets the filename. Then the Arduino window that has the title that matches is activated and QM sends "CTRL+U" there to upload the sketch.

Sometimes I'm working with multiple Arduino files, so I need a bit more logic than just using "Notepad++" and "Ardunio" as partial matches.

Thanks,
The Vig
#2
to get the name of the active window is
Code:
Copy      Help
int w=win()
str txt.getwintext(w)
out txt
 then can use something like this to find and activate other window
Code:
Copy      Help
txt.replacerx("\s\-.+" "")
int w1=win(txt "Ardunio");; or whatever is the classname of that window
act w1
#3
Duh. int w=win() so simple. I just never needed that until now. I'll post my code later, but it's working so good! Finally I can code Arduino in Notepad++


Forum Jump:


Users browsing this thread: 1 Guest(s)