Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FLOATING TOOLBAR
#1
I LOST MY FLOATING TOOLBAR!!!!

HOW DO I GET IT BACK Sad
#2
Is it the toolbar that is used to insert macro commands, or some other toolbar?

In first case, here are possible reasons and solutions:
1. You use a macro list file that does not include System.qml. Each macro list should include System as shared file, otherwise you will not have the floating toolbar and other extensions. Solution: add System.qml to your macro list: menu File -> Add shared. Then retart QM.
2. System shared folder or function init is disabled. Enable them and restart QM. The toolbar runs from function init, which runs at startup.
3. Function init is not specified in Options -> Triggers -> Special items (first item must be init).
4. System.qml is modified. Solution: restore it from quickm21.zip. Then retart QM.

In case it is ANY toolbar, maybe it is somewhere outside screen. Go to menu Tools -> Toolbars, locate it in the list of currently running toolbars and click one of buttons. It requires QM 2.1.4. For earlier versions, easiest would be to rename the toolbar, then restart it.
#3
TYVM :lol:


I'm trying to learn ACC command and is a little bit confused.

Here's the scenario: 11 buttons, 1-10 will either say on the screen "Open," "Closed," or not even visible, and button 11 says "Click Me."

I am getting no value using a.Value on buttons 1-10, I am however getting a value of "Click Me" on button 11.

What I need the macro to do is to continue the loop until it can find "Open" from 1-10 buttons and not even bother with button 11. Once the macro finds "Open," it will click the button, which I am able to do by the way, LOL.

At the moment, if buttons 1-10 is not visible, it clicks on button 11 Sad and it also clicks on visble button that says "Closed."

Using the "Info" button from "Find Accessible Object" the state of the "Open" buttons is "0x0 (normal)" and the state of the "Close" buttons is "0x1 (Unavailable)."

How do I tell the macro to continue looping until it finds the "Open" button with state as "0x0 (normal)?"

Oh God, I hope I made this clear, lmao.

Thanks!
#4
Try to find some adjacent object, eg button 11, and navigate to the button you actually need: in the "Find accessible object" dialog, press 'Navigate' button, and enter post-navigation string. How to compose the string, read QM help.

Alternatively, if the buttons are in a web page, try html elements.
#5
Ok, I was able to get it to skip button 11 Smile Very very happy.


Now, how do i get the STATE of the button?
#6
Use dialog "Accessible object actions", action "Get state".
#7
Ok I think I got it! You're a genius!!!!


I am just posting the codes for buttons 1-2. Let me know what you think

Code:
Copy      Help
str z.getwintext(win("My Dialog Box "))

button1
Acc a=acc("" "CLIENT" z "AfxWnd42s" "" 0x1100 486 53); err goto button2
str a1=a.State()
if a1=1048576
    a.Mouse(1)
    goto endnow


button2
Acc b=acc("" "CLIENT" z "AfxWnd42s" "" 0x1100 628 90); err goto button3
str b1=b.State()
if b1=1048576
    b.Mouse(1)
    goto endnow

button3
end


I have button1 - button10 labels. Is there another way to make it file smaller? Like loop through the buttons and check if state is "1048576," click the button?

Thank you so much!
#8
acc has flag 0x800, which forces to interpret x and y as state and state mask. If you include this flag in flags, acc will find first object that has the specified state. If this will work, all your macro can be only two lines:

Code:
Copy      Help
Acc a=[color=blue]acc[/color]("" "CLIENT" "My Dialog Box " "AfxWnd42s" "" 0x1900 STATE_SYSTEM_FOCUSABLE STATE_SYSTEM_FOCUSABLE);
a.Mouse(1)

Here STATE_SYSTEM_FOCUSABLE is name of constant that is equal to 1048576. State constants are defined in some function. To view them quickly, click STATE_SYSTEM_FOCUSABLE and press F1.
#9
Confusedhock: reading and learning ...
pi
#10
What about Button11 "Click Me" that is also showing State "1048576" How do I skip that button?


From the example you provided above, the macro is also clicking on the "Close" button with State "1048577" Sad It is only suppose to click on the "Open" button with State "1048576."



I really appreciate all the help! You are so wonderful!!!!

Thanks!
#11
In the example, acc finds object that has STATE_SYSTEM_FOCUSABLE state, but may have also other states. To match state exactly, y must be -1.

Code:
Copy      Help
Acc a=[color=blue]acc[/color]("" "CLIENT" "My Dialog Box " "AfxWnd42s" "" 0x1900 STATE_SYSTEM_FOCUSABLE -1)
[color=blue]str [/color]s=a.Value; [color=blue]if[/color](s~"Click Me") [color=blue]ret[/color]
a.Mouse(1)
#12
:lol:

Big Grin

Tongue


TY TY TY


OH BY THE WAY, MY TASKBAR ICON IS NOT RED ANYMORE WHILE A MACRO IS PLAYING??? HOW DO I FIX THAT?
#13
It isn't red when runs function or menu item.
#14
THANK YOU SO MUCH :lol:
#15
Hi Gintaras:

Can I pick on your brains a little bit longer? I have a quick question.

From previous discussions, where the button has a State vaue of 1048577 as being disabled. Is there a way for QM to force it to be Enabled and set the value to become 1048576? Some type of DLL function maybe?

Thank you!
#16
If button is separate control (can be captured with "Find window" dialog), use EnableWindow function. If it is button in standard toolbar (control with class "ToolbarWindow32"), SendMessage TB_ENABLEBUTTON. Otherwise, I don't know. Even if you will successfully enable button, application probably will think that it is disabled.
#17
Class is "AfxWnd42s"

How do I incorporate EnableWindow function from the code below?


Code:
Copy      Help
Acc a=acc("" "CLIENT" z "AfxWnd42s" "" 0x1900 STATE_SYSTEM_FOCUSABLE STATE_SYSTEM_FOCUSABLE)



Thank you very much!
#18
You cannot enable accessible objects.

If you can capture the button with "Find window" dialog, this would insert child or id function that returns button handle. Then you can call EnableWindow.

Following example enables "Find Next" button in Notepad's "Find" dialog.

Code:
Copy      Help
int hwnd=child("&Find Next" "Button" "Find" 0x1)
EnableWindow hwnd 1

In your case this would be something like

Code:
Copy      Help
int hwnd=child("" "AfxWnd42s" z)
EnableWindow hwnd 1
#19
I'm back Smile

I am hoping this would be the last question I have.

I found this example and I'd like to know where the value "0x162BFF" came from? Or or simpler terms, what color is this? Big Grin

Code:
Copy      Help
int mycolor=pixel(421 22)
if(mycolor=0x162BFF); mes "wrong color"


Thanks! You're the best!
#20
0x162BFF = 0xFF red, 0x2B green, 0x16 blue.

More info: QM Help, pixel.
#21
Ok, I am definitely on the wrong track. Let's stick to what we already know using Accessible Objects.

Is there a way to find out the ID for the object found using Accessigble Objects?

I know their individual IDs but the macro doesn't Smile) The macro clicks on the first accessible object and I cant seem to find a command to use to get the ID.

Thanks!
#22
How do you know individual ids? From last line in "Find accessible object" -> "Object properties" dialog? If so, you can use but command instead of accessible objects. If you still want to use accessible objects, in "Find accessible object" dialog's "Class" field select "id=..." from dropdown list.
#23
But then I cannot use:

Code:
Copy      Help
Acc a=acc("" "CLIENT" z "AfxWnd42s" "" 0x1900 STATE_SYSTEM_FOCUSABLE STATE_SYSTEM_FOCUSABLE)

instead I will be hard coding 10 buttons again like my previous post?

I was hoping that maybe from getting x y coordinates or something, I can get and button ID
#24
Please post screenshot of "Find accessible object" dialog when that button is found. Also, screenshot of window you are working with.

To make a window snapshot, activate the window, press Alt+PrintScreen, run mspaint, paste, save in gif format. To post here, add as attachment.
#25
Do you mind if I email them to you instead?
#26
Ok.


Forum Jump:


Users browsing this thread: 2 Guest(s)