Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
change macro? (toolbar check button that controls a macro)
#1
Hello,
I have created some Macro, that opens Editor with mouse move to screen edge trigger.
if that window is open, another macro is triggered with mouse middle click, only notepad.


_s.getsel();
_s.setclip()
min win("QM TEMP.txt - Editor" "Notepad")
'Cv
'V
0.1
clo win("QM TEMP.txt - Editor" "Notepad")


that is instead of a clipboard recorder program. its function is, to open Editor on mouse movement to screen edge, then select a word what I mark in Editor, then close Editor and paste the word in another App.
If there is one word to copy, Editor should close after that. But if there are many words to copy, Editor should stay on top, and not close.
I would prefer some button (like the needle-button we know from other programs), to deceide, wether the window should stay on top or hide automatically.
I have created some toolbar only for notepad, - in this I would like to add some Icon, Button, that makes, if it is not klicked, that the window hides automatically, but if is clicked, make it to stay on top (untill it is closed manually).
How do I send this command to the macro? :?:
I dont want to create some Dialog with too much klicks on Buttons, OK Buttons and so on, just some Button, I can click - if needed - that changes the comand
clo win("QM TEMP.txt - Editor" "Notepad")
into
ont("QM TEMP EINARS.txt - Editor")
any idea? Idea

Hasi
#2
This toolbar changes a global variable when you click the first button. The button is checked when the variable is 1, unchecked when 0.

Code:
Copy      Help
;/lock {int+ g_editorontop=0}
check :g_editorontop^1; SendMessage id(9999 TriggerWindow) TB_CHECKBUTTON 1 g_editorontop ;;^1 toggles the variable value between 0 and 1. In SendMessage, 1 is 0-based line index of the button in toolbar text.

Then use the variable in a macro. Example:

int hwnd=win("window name" "window class")
int+ g_editorontop
if(g_editorontop)
,ont hwnd
else
,clo hwnd


Forum Jump:


Users browsing this thread: 1 Guest(s)