Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select list item
#1
i am having troubles with a code of mine, it works if u can see the list item but if the list item isnt visible it wont work. The window is active and visible when i try to make the macro highlight the Object. i have used accesible objects from the toolbar, and it works fine but my problem is i can not make it work if the text of the ID isnt visible. here is the code that i have bro, i hope it helps. if you dont understand what i mean then i will send a screen shot. all i wana do is make it so that the macro high lights the list item in a scroll bar but if the scroll bar is scrolled all the way down and the list item is at the top then it will not work, and send me an error, but if there both at the top and visible then it wont send me an error and it will work. ty bro so kindly i will be back on later to see if you have replied till then i have to go to work Sad gota work 2 shifts. peace and ty
#2
Quote: here is the code that i have bro, i hope it helps

where?
An old blog on QM coding and automation.

The Macro Hook
#3
If it is SysListView32 control or inherited from it, you can send LVM_ENSUREVISIBLE message to make an item visible (scroll to it). Example:

Code:
Copy      Help
int hwnd=child("FolderView" "SysListView32" win("" "ExploreWClass") 0x1)
int index=60
def LVM_ENSUREVISIBLE 0x00001013
SendMessage hwnd LVM_ENSUREVISIBLE index 0
#4
can i use id instead of child? and ty bro for the reply.
#5
Yes.
Functions id and child are just two different ways to get child window handle.
#6
ok bro i found it out, but this is the thing now. i show the code.
Code:
Copy      Help
str s.getwintext(id(6"Search"));err
Acc a=acc("Excel 810" "LISTITEM" "Excel" "SysListView32" "" 0x1031);err
a.Select(SELFLAG_TAKEFOCUS|SELFLAG_TAKESELECTION)

what i want to do now is i type the # into a dialog then hit search, then i wana use getwintext so that when i run the macro it gets the text from the dialog then searches for it. instead of having to type it in the Macro itself. i was wondoring if you could help me out and that is my last question i have besides how you make dialog timer count like 00:00:00:00 in minutes and hours and seconds. what i want is the # 810 to equal string s. so that when i change the # in dialog it will change in the code.
#7
Regarding the LVM_ENSUREVISIBLE statement, I'm trying to use it, but my window often scrolls horizontally instead of vertically. Is there a way to specify the direction?
#8
No. I tried with Explorer and Winamp, and never scrolls horizontally.
#9
I played around with it a bit more and it looks like it scrolls horizontally when the item is wider than what can be displayed on the screen. In that case, it tries to display the center of the item, scrolling horizontally part of the way. Thanks for trying.
#10
Insert this after

Code:
Copy      Help
def SB_LEFT 6
SendMessage hwnd WM_HSCROLL SB_LEFT 0


Forum Jump:


Users browsing this thread: 1 Guest(s)