Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting Wintext Depending On what Macro is Running.
#1
Code:
Copy      Help
ifi(id(10 win("Mr_B" "#32770")))
,int i n=EnumQmThreads(0 0 0 0)
,QMTHREAD* a._new(n)
,for i 0 EnumQmThreads(a n 0 0)
,,_s.getmacro(a[i].qmitemid 1)
,,str q.getwintext(id(20 win("Mr_B" "#32770")))
,,if q="None"or"Running"
,,,_s="Macro1"; _s.setwintext(id(20 win("Mr_B" "#32770")))
,,,goto START
,,else
,,,goto Second
,,,
,,;Second
,,str r.getwintext(id(22 win("Mr_B" "#32770")))
,,if r="None"or"Running"
,,,_s="Macro1"; _s.setwintext(id(22 win("Mr_B" "#32770")))
,,,goto START
,,else
,,,goto Four
,,;Four
,,str x.getwintext(id(23 win("Mr_B" "#32770")))
,,if x="None"or"Running"
,,,_s="Macro1"; _s.setwintext(id(23 win("Mr_B" "#32770")))
,,,goto START
,,else
,,,goto START
;START
int w1;err
w1=win("Notepad")
act w1
hid w1
hid- w1

Hey G. the new QM is great! i found a thread code and thought i could put it to use but so far i am out of luck :wink: if you could please help me fixs the bugs in this code it would make my day Big Grin

This is what the code is SAPOSE to do.
1. When i run the Macro that this code is stored in (In this case "Macro1") it is saposed to setwintext in an edit in my dialog. The text that it sets just says "Running"
2. I had it working earlyer but there was still bugs in it.
3. It has a strange set up because it sets text on the next available Edit that = "None"or"Running"
4. "None" is the default. so ifwintext= "None" then it will setwintext into that Edit. Ifwintext= "Running" then it goes to the next available Edit.

Thanks a lot G! I hope that you have time to look over my code and point me into the right direction 8)
Smile 8)
#2
i think it might be better to start with...what do you want to do.
if you got the code from another link it'll be better to get in touch with the person who started/posted the question.
An old blog on QM coding and automation.

The Macro Hook
#3
ken gray Wrote:i think it might be better to start with...what do you want to do.
if you got the code from another link it'll be better to get in touch with the person who started/posted the question.
i made this code myself last night. i found part of the code in QM. help. but its not working the way i want it to.(not working at all) lol

ill be back in couple of days. got to go to work for week 8)
Smile 8)
#4
how in the WORLD did i read that as "what is this code supposed to do"?!
An old blog on QM coding and automation.

The Macro Hook
#5
i'd start with making sure that your vars are actually getting the info you need.

the first part seems to work for me but i cant check the "getwintext" stuff.
An old blog on QM coding and automation.

The Macro Hook
#6
ken gray Wrote:i'd start with making sure that your vars are actually getting the info you need.

the first part seems to work for me but i cant check the "getwintext" stuff.
in the getwintext you can just use notepad as and example. or make a dialog with 3 Edit in it and make the id and windows according to the dialog.
Smile 8)


Forum Jump:


Users browsing this thread: 1 Guest(s)