Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Auto3Lib


  • This topic is locked This topic is locked
960 replies to this topic

#21 sohfeyr

sohfeyr

    Prodigy

  • Active Members
  • PipPipPip
  • 194 posts

Posted 13 October 2006 - 04:19 PM

:lmao:

How can the _PopupGetParent() help with that? I thought context menus and other popups (like comboboxes, drop down menus, etc) were child windows of the desktop, and that was why you couldn't get at them through EnumChildWindows using the current window handle as the starting point?

I believe you when you say it works, but could someone clear that up for me?

Also... say I wanted to locate a particular item in a context menu. (Assume that for demo purposes, shortcut keys are not an option)
1) Move the cursor over the source point and right click
2) Identify the popup menu
3) Retrieve a list of the item text (to check against a list)
4) Verify whether a particular item is available or grayed (say, "&Delete Selected Records")
5) Determine the rectangle occupied by a particular item in that menu (say, "&Export")
6) Move the cursor to the midpoint of that item and left click

#1 and #6 are very easy, and you just explained #2, but have you been successful at #3-5?

Also, does this work with non-standard menus and non-standard toolbars, like if a regular windows control has been subclassed? How much of this is class-dependant?

Gotta hand it to you, I just get more excited about this thing...

(BTW, someone may ask why I'm not just experimenting. Besides the sudden and humbling realization I barely know what is going on at the Win32 level, at this phase in the project I'm not given a lot of time for experiments, and I'm really just "scouting ahead" for the next phase in our automation software. I do try to learn in my spare time, and may I say these UDFs look like a great way to do that, too.)







#22 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 13 October 2006 - 04:56 PM

You are correct about the popups being child windows. That's the whole purpose behind the _PopupScan function. I wrote an _EnumWindows function (A3LWinSDK) that enumerates all windows, including child windows. To find the popup windows, you enumerate starting with the desktop. What _PopupScan does is take a snapshot of all the open popup windows before a button is clicked. After you click the button, it takes another snapshot looking for new popup windows. Any new popup windows it finds are stored in the global array I mentioned. The _PopupGetMenu function returns a menu handle from this global array. The _PopupGetHandle function returns the parent of the menu (which you need for some of the menu functions). Lastly, the _PopupGetType function tells you whether the menu handle is a #32768 window (standard popup menu) or a handle to a ToolbarWindow (which is used by Microsoft to emulate a popup menu).

All of the items you listed (1-6) are handled in Auto3Lib. In fact, most of them are used in the examples that are included with the library. Between A3LToolbar and A3LMenu, all of the toolbar and menu functions are fully exposed. What I've done is come up with the "magic" that Birch is referring to that allows you to marry the two together. So when you click on a "menu" (regardless of whether it's a toolbar or a true menu) Auto3Lib will capture any popups for you, tell you what the popups are and then you can do whatever you want using either Toolbar or Menu commands.

As for subclassing, the answer would be no. Auto3Lib uses class names to determine which windows are menus, toolbars, etc. But if you look at the _PopupScan code, you'll see where I use a switch statement which allows you to add other window classes to the list of the ones I'm looking for. So if you subclass a Toolbar, you'd just add your class name to the switch statement. If there is a lot of demand for such a feature, I will change the library so that you can register the class names of the windows you want to track.

I don't mind the questions at all. This is suppose to be a support forum and if you've got questions, you should be able to ask them without fear of getting blasted. :lmao:
Auto3Lib: A library of over 1200 functions for AutoIt

#23 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 14 October 2006 - 02:19 PM

I have released a new version of Auto3Lib that includes full support for SysListView32 controls. As always, appropriate comments/suggestions are welcome.
Auto3Lib: A library of over 1200 functions for AutoIt

#24 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,722 posts

Posted 15 October 2006 - 01:20 AM

I have released a new version of Auto3Lib that includes full support for SysListView32 controls. As always, appropriate comments/suggestions are welcome.


Hey PaulIA you are BIG man! :lmao:

I quickly looked into your ListView stuff and it's great.
I can't wait to test it.

Thanks for that. It's really much of work.

#25 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 15 October 2006 - 05:08 PM

@Zedna: Thank you for the feedback. Let me know how it works out for you.

Added SysHeader32 control. If anybody that is using Auto3Lib has suggestions/comments for enhancements or future controls to implement, let me know.

Edited by PaulIA, 04 January 2007 - 06:57 PM.

Auto3Lib: A library of over 1200 functions for AutoIt

#26 ptrex

ptrex

    Universalist

  • MVPs
  • 2,419 posts

Posted 15 October 2006 - 06:59 PM

@PaulIA


this is the MAX !!

The ListviewLib is realy extensive !!
I definitely can use this.

Thanks a lot :lmao:

ptrex

#27 this-is-me

this-is-me

    Pursuer of obscure functionality

  • Active Members
  • PipPipPipPipPipPip
  • 2,466 posts

Posted 15 October 2006 - 07:56 PM

I must say this is simply the most complete and carefully crafted library I have seen here. Thank You for the time and effort you have put into this, and I hope to see this library grow much as time goes on.
Who else would I be?

#28 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 16 October 2006 - 02:38 AM

Thank you for the comments and feedback. :lmao:

I will continue to expand Auto3Lib as the need arises or as I get requests. I'm looking at adding ComboBox, ListBox or Tab Control next, but would be interested if any of the users have other suggestions or recommendations.

In looking back over the library, I see several places where I need to be more mindful of setting @Error, so I will be doing that in the next few weeks too.
Auto3Lib: A library of over 1200 functions for AutoIt

#29 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 24 October 2006 - 05:38 AM

I have released a new version of Auto3Lib that includes full support for Listbox controls. As always, appropriate comments/suggestions are welcome.
Auto3Lib: A library of over 1200 functions for AutoIt

#30 sohfeyr

sohfeyr

    Prodigy

  • Active Members
  • PipPipPip
  • 194 posts

Posted 24 October 2006 - 05:23 PM

Are you still taking suggestions?

You already have the commands wrapped to get a handle for an associated tooltip control; adding more tooltip-related commands would be a great addition for this library, and especially to the Toolbar32. You could get text identifiers for toolbar buttons that don't have their own text set, the same way a user would - by looking at the tooltip!

I'm curious, how do you crank this stuff out so easily, PaulIA? What is your programming background?

Edited by sohfeyr, 24 October 2006 - 05:24 PM.


#31 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 24 October 2006 - 09:26 PM

Yep, still taking suggestions (at least the appropriate ones) ;)

I was looking at the Tooltip control last night, so I'll see what I can do in the next week or two.

As far as background, let's just say when I started programming, saving your code to paper tape was "high tech", a 1 Mhz processor was "awesome" and we routinely coded a million lines of assembly code into 64K of address space (with space left over).

God... am I really that old? :whistle:
Auto3Lib: A library of over 1200 functions for AutoIt

#32 sohfeyr

sohfeyr

    Prodigy

  • Active Members
  • PipPipPip
  • 194 posts

Posted 25 October 2006 - 02:26 AM

That's not old, that's experienced. :whistle:

#33 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 25 October 2006 - 03:31 PM

Anything special you want for the ToolTips control beside the basic mapping of all the messages? I worked on it last night and I'm able to track when a tooltip pops up, read the text, move it around, etc.
Auto3Lib: A library of over 1200 functions for AutoIt

#34 sohfeyr

sohfeyr

    Prodigy

  • Active Members
  • PipPipPip
  • 194 posts

Posted 25 October 2006 - 04:56 PM

Anything special you want for the ToolTips control beside the basic mapping of all the messages? I worked on it last night and I'm able to track when a tooltip pops up, read the text, move it around, etc.

Well, since you asked, there are a few functions I had in mind to further wrap it... they might be useful to more people than just me, if you wanted to implement them:

Func _ToolTip_GetTextAt($tooltipHwnd, $x, $y, [$coordmode=1], [$param1=0])ƒo݊÷ Úée‹Mú¶Š%¶*GÂwb²Ø^­ë.–Ú²‰ž¶§‚X¤y:(•¶«ëS¢‰mŠŸåŠX´ß¬ZÝ7ë&«yÊ(­Ø§j׬þX¥‹MúrŠ+vjy§z›ljö¥¹ë)yȟÊ)à­éZ¶+Þ¶‹­ç§Ö·¥jدzÚrد{§vŒ6¢ºÞ•«b½ëh¶œ¢{[)yȟ‰çbŸMú¥ªÚ›]ÿ–)bÓ~©j¶¦Ö+uØ­Š‰Ú–)ß¡ú+Ó~œ¢ŠÝš‡^²ç!jƜ¢{k¢XZÙ^þX¿ºTáŠÌ(ºWkzÛ«žØ^µìm¡ûazÚ(–Ø©Âœ‡ .•Ö©¥æ«jÖ©j»bréZ®ZjبŸ­†‹­ç²Æ«Š ¢)ණ{­†Ø^rê좶®¶ˆ­sdgVæ2õFööÅF—ôÖ÷W6TÖ÷fTW‡V7B‚b33c·‚Âb33c·’²b33c·6V75FõF–ÖV÷WCÓ5Ò²b33c¶6ö÷&FÖöFSÓÒ²b33c·&ÓÓÒ
  • all pretty self-explanatory, since the four of them are the same as before.
This would return a two-element array containing the handle of the window that appears and the text of the tooltip. If it did not appear before the timeout elapsed, the contents would be zero and zero. It might be really cool to have a third element in that array that gives the elapsed time between the MouseMove and the tooltip appearing, and maybe a fourth with the LTWH or LTRB rectangle of where it appears (since it might have disappeared by the time a WinGetPos command was called on the handle).

If I had to give them a priority, I'd say the second was more important to me since it has the visual element (more impressive for demoing).

Thanks for offering!

Edit:
I've found that something is funky with AutoIt's built-in time delays on some hyperthreading and multiprocessor machines. You TOTALLY have my permission if you want to include / wrap / use my time delay routines here. (If you have your own, I'll understand.)

Edited by sohfeyr, 25 October 2006 - 05:20 PM.


#35 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 25 October 2006 - 07:24 PM

For _ToolTip_GetTextAt, are you after the text that will get displayed at X, Y if the mouse were moved there? Isn't the message that is displayed at an X/Y coordinate controlled by the application? I mean that, I can read the text of a ToolTip, but if the mouse moves over another control, doesn't the application reuse the ToolTip window and just modify the text? If that were true, I wouldn't be able to tell what the text at a given X/Y coordinate would be without actually moving the mouse.

Insight, anybody?
Auto3Lib: A library of over 1200 functions for AutoIt

#36 sohfeyr

sohfeyr

    Prodigy

  • Active Members
  • PipPipPip
  • 194 posts

Posted 25 October 2006 - 07:50 PM

For _ToolTip_GetTextAt, are you after the text that will get displayed at X, Y if the mouse were moved there? Isn't the message that is displayed at an X/Y coordinate controlled by the application? I mean that, I can read the text of a ToolTip, but if the mouse moves over another control, doesn't the application reuse the ToolTip window and just modify the text? If that were true, I wouldn't be able to tell what the text at a given X/Y coordinate would be without actually moving the mouse.

Insight, anybody?


I had assumed this would be possible by obtaining the handle of the topmost control at X, Y (there is something that does this in AutoIt Wrappers in the Scripts and Scraps forum), and then using the TTM_GETTOOLINFO message. But then, if you're stymied I'm way out of my league...


If PaulIA = ;) Then sohfeyr = :whistle:

It might be best to just move the mouse anyways.


Off-topic edit: seriously, aren't these emoticons great? Wish I had them on MSN

Edited by sohfeyr, 25 October 2006 - 08:14 PM.


#37 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 25 October 2006 - 09:22 PM

:whistle: I think I know what you're after now. I'll work on it and see what I come up with.
Auto3Lib: A library of over 1200 functions for AutoIt

#38 Lakes

Lakes

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,049 posts

Posted 25 October 2006 - 10:56 PM

:whistle: I think I know what you're after now. I'll work on it and see what I come up with.


Reading/parsing Tooltip text would be great! ;)

#39 PaulIA

PaulIA

    API Extremist

  • MVPs
  • 1,201 posts

Posted 29 October 2006 - 12:14 AM

Added support for ToolTip controls. Take a look at the demo to see all the utterly useless things you can do to a poor ToolTip control.
Auto3Lib: A library of over 1200 functions for AutoIt

#40 Lakes

Lakes

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,049 posts

Posted 29 October 2006 - 12:36 AM

Added support for ToolTip controls. Take a look at the demo to see all the utterly useless things you can do to a poor ToolTip control.


Great! I`ll have a play with this when I get time. :whistle:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users