Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stoping All Functions From Toolbar
#1
Hello Gin, bro i just have 1 last question for you.
I have a ToolBar that opens with Mutiple Windows, and on it the toolbar has several macros and all of these macros run on a window with the same class and name i want to stop all functions without stoping the 1s that are running on the other window. ill show you the code and then go more into detail so that you completly understand. Smile
Code:
Copy      Help
TOOLBAR CODE
Window Functions :mac "Function" "" GetWindow(TriggerWindow GW_OWNER)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function" 0)
Code:
Copy      Help
FUNCTION
int w1;err
w1=win("Excel");err
act w1;err
hid w1;err
hid- w1;err
SetProp(w1 "FUNCTION" 1)
spe 15
rep
,if(!GetProp(w1 "FUNCTION")) end
wait 3
act w1



WITH THESE CODES IT ONLY SHUTS DOWN THE ONE FUNCTION, I WANT TO MAKE IT SO THAT IF I PUSH THE STOP BUTTON IT STOPS ALL FUNCTIONS RUNNING FROM THAT TOOLBAR, WITHOUT STOPING ANY FUNCTIONS FROM THE OTHER TOOLBAR, I CAN DO IT FROM THAT TOOLBAR BUT I WOULD HAVE TO MAKE 10 MORE BUTTONS AND I DONT WANT TO DO IT THAT WAY SO IS THERE ANY WAY THAT YOU CAN STOP ALL FUNCTIONS INSTEAD OF 1 WITHOUT MAKING 10 STOP BUTTONS, BECAUSE THERE IS 10 FUNCTIONS THAT ARE IN THE 1 TOOLBAR TYVM BRO IF YOU WANT ME TO EXPLAIN IT SOME OTHER WAY THEN JUST SAY SO I HOPE THIS HELPS YOU  :lol:
#2
what are the function names as they show in the "Threads" window?
An old blog on QM coding and automation.

The Macro Hook
#3
If there are many threads of single function, I think they all should stop. If different functions, add similar code in each of them. Of course this cannot be added to functions that do not repeat. Other way - for each window use functions with unique names, and use shutdown. I don't know other ways (i don't say it is impossible, maybe you will find a better way).
#4
Gintaras Wrote:If there are many threads of single function, I think they all should stop. If different functions, add similar code in each of them. Of course this cannot be added to functions that do not repeat. Other way - for each window use functions with unique names, and use shutdown. I don't know other ways (i don't say it is impossible, maybe you will find a better way).
if i use shutdown -6 0 "Function" then it shuts down all macros that are running. is there a way to shut down all functions and macros running off that toolbar?
#5
ken gray Wrote:what are the function names as they show in the "Threads" window?
the functions names are Function_A , Function_B ,,,, ect to 10
#6
what i want to do is stop all functions running from the toolbar with out stoping other functions running cause 3 functions can be running at the same time, do you get my drift?
ty
#7
maybe i'm misunderstanding but if you have a bunch of toolbars with different functions assigned to them that have different names than the functions in the other toolbars, can't you create a function that does a "shutdown" of all of that toolbar's function regardless of whether they are running or not?
An old blog on QM coding and automation.

The Macro Hook
#8
ken gray Wrote:maybe i'm misunderstanding but if you have a bunch of toolbars with different functions assigned to them that have different names than the functions in the other toolbars, can't you create a function that does a "shutdown" of all of that toolbar's function regardless of whether they are running or not?
all of the toolbars are triggered to open with a window, and i have 2 of the same windows open at the same time right, so when im running a function from my toolbar on window 1 then i have the same same function running on the other window... i can shut off just the 1 function from that toolbar but ..... i cant shut off my other functions without using shutdown,,, but if i use shutdown then it stops all functions from both toolbars and i only want it to stop all functions from the toolbar its running on.
#9
ok....now, i'm getting it....what are the program windows? maybe there's something there we can work with.
An old blog on QM coding and automation.

The Macro Hook
#10
Window Functions 2:mac "Function2" "" GetWindow(TriggerWindow GW_OWNER)
Window Functions3 :mac "Function3" "" GetWindow(TriggerWindow GW_OWNER)
Window Functions 4:mac "Function1" "" GetWindow(TriggerWindow GW_OWNER)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function1" 0)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function2" 0)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function3" 0)

i could do it this way, but i dont want to have 10 buttons to stop just 1 function get my drift?
#11
ken gray Wrote:ok....now, i'm getting it....what are the program windows? maybe there's something there we can work with.
the programs windows are Excel
#12
I was thinking it is PartyPoker. What these 10 functions do in Excel?
#13
Gintaras Wrote:I was thinking it is PartyPoker. What these 10 functions do in Excel?
its for my work, the toolbar is up top like yours on QM, each function uses set and get text, and other complicated strings and functions, there hard to explain, the functions are used to type text into boxes because i get paid for graphing. I dont use PartyPoker, would never break your rules. if u didnt no, u can make functions in excel 2 lol
#14
Mr____B Wrote:Window Functions 2:mac "Function2" "" GetWindow(TriggerWindow GW_OWNER)
Window Functions3 :mac "Function3" "" GetWindow(TriggerWindow GW_OWNER)
Window Functions 4:mac "Function1" "" GetWindow(TriggerWindow GW_OWNER)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function1" 0)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function2" 0)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function3" 0)

i could do it this way, but i dont want to have 10 buttons to stop just 1 function get my drift?

It does not stop all functions because you use different strings ("Function1", "Function2", ...) with SetProp/GetProp. Use single string everywhere. It can be any string.
#15
Gintaras Wrote:
Mr____B Wrote:Window Functions 2:mac "Function2" "" GetWindow(TriggerWindow GW_OWNER)
Window Functions3 :mac "Function3" "" GetWindow(TriggerWindow GW_OWNER)
Window Functions 4:mac "Function1" "" GetWindow(TriggerWindow GW_OWNER)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function1" 0)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function2" 0)
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function3" 0)

i could do it this way, but i dont want to have 10 buttons to stop just 1 function get my drift?

It does not stop all functions because you use different strings ("Function1", "Function2", ...) with SetProp/GetProp. Use single string everywhere. It can be any string.
ok ty bro, ill try it out and get back to u, so it looks like this?
Code:
Copy      Help
Stop Functions On Window:SetProp(GetWindow(TriggerWindow GW_OWNER) "Function3""function2" 0)
#16
No. With all SetProp and GetProp, use "x" instead of "FUNCTION", "Function1", etc.
#17
ok, so put it into a variable? or a string? lol sorry i just got lost, can u show me an example ty
#18
Mr____B Wrote:ok, so put it into a variable? or a string? lol sorry i just got lost, can u show me an example ty
lmfao nvm i got it tyvm bro it works great! cant belive i didnt try that im so stupid!! Cry


Forum Jump:


Users browsing this thread: 2 Guest(s)