sohfeyr Posted October 13, 2006 Posted October 13, 2006 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.) Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt
PaulIA Posted October 13, 2006 Author Posted October 13, 2006 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. Auto3Lib: A library of over 1200 functions for AutoIt
PaulIA Posted October 14, 2006 Author Posted October 14, 2006 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
Zedna Posted October 15, 2006 Posted October 15, 2006 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! 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. Resources UDF ResourcesEx UDF AutoIt Forum Search
PaulIA Posted October 15, 2006 Author Posted October 15, 2006 (edited) @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 January 4, 2007 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt
ptrex Posted October 15, 2006 Posted October 15, 2006 @PaulIA this is the MAX !! The ListviewLib is realy extensive !! I definitely can use this. Thanks a lot ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
this-is-me Posted October 15, 2006 Posted October 15, 2006 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?
PaulIA Posted October 16, 2006 Author Posted October 16, 2006 Thank you for the comments and feedback. 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
PaulIA Posted October 24, 2006 Author Posted October 24, 2006 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
sohfeyr Posted October 24, 2006 Posted October 24, 2006 (edited) 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 October 24, 2006 by sohfeyr Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt
PaulIA Posted October 24, 2006 Author Posted October 24, 2006 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? Auto3Lib: A library of over 1200 functions for AutoIt
sohfeyr Posted October 25, 2006 Posted October 25, 2006 That's not old, that's experienced. Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt
PaulIA Posted October 25, 2006 Author Posted October 25, 2006 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
sohfeyr Posted October 25, 2006 Posted October 25, 2006 (edited) 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Ý÷ ÚéeMú¶%¶*GÂwb²Ø^ë.Ú²¶§X¤y:(¶«ëS¢måX´ß¬ZÝ7ë&«yÊ(اj׬þX¥Múr+vjy§zljö¥¹ë)yÈÊ)àéZ¶+Þ¶ç§Ö·¥jدzÚrد{§v6¢ºÞ«b½ëh¶¢{k¢[)yÈçbMú¥ªÚ]ÿ)bÓ~©j¶¦Ö+uØÚ)ß¡ú+Ó~¢Ý^²ç!jÆ¢{k¢XZÙ^þX¿ºTáÌ(ºWkzÛ«Ø^µìm¡ûazÚ(Ø©Â .Ö©¥æ«jÖ©j»bréZ®Zjبç²Æ« ¢)ණ{Ø^rê좶®¶sdgVæ2õFööÅFôÖ÷W6TÖ÷fTWV7Bb33c·Â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 October 25, 2006 by sohfeyr Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt
PaulIA Posted October 25, 2006 Author Posted October 25, 2006 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
sohfeyr Posted October 25, 2006 Posted October 25, 2006 (edited) 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 = 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 October 25, 2006 by sohfeyr Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt
PaulIA Posted October 25, 2006 Author Posted October 25, 2006 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
Lakes Posted October 25, 2006 Posted October 25, 2006 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! 2015 - Still no flying cars, instead blankets with sleeves.
PaulIA Posted October 29, 2006 Author Posted October 29, 2006 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
Lakes Posted October 29, 2006 Posted October 29, 2006 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. 2015 - Still no flying cars, instead blankets with sleeves.
Recommended Posts