jokke Posted March 30, 2007 Posted March 30, 2007 (edited) Hiya PaulIA, great work thanks! I'we tried some of you'r functions and they seem to work great, but now i have one i cant seem to get the hang of ( ! ) help. #include <A3LWinAPI.au3> $iAction = 'SPI_GETSCREENSAVERRUNNING' $test1 = _API_SystemParametersInfo($iAction) ConsoleWrite( $test1 ) ;Will Return false if screen saver is not active.. While 1 $test2 = _API_SystemParametersInfo($iAction) If $test2 <> $test1 Then ConsoleWrite( $test2 ) ;Should return true if screensaver is started.. EndIf Sleep(40) WEnd Edited March 30, 2007 by jokke UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
seamg Posted March 30, 2007 Posted March 30, 2007 Kind of new here and new of using AutoIt3. Love your library... I need "right click" the toolbar button(taskbar) to get the popup menu This is how I am using it: $icon = _Toolbar_IndexToCommand($hd, $i) $iconText = _Toolbar_GetButtonText ($hd, $icon) ... if StringRegExp($iconText, "title", 0) Then _Toolbar_ClickButton($hd, $icon) <==== Here, I need do right click... but looks like this is left only sleep(1000) EndIf _Menu_ClickPopup("Properties") Not sure if I can use your lib to do it.. and if this is the right way to use it... Thanks
PaulIA Posted March 31, 2007 Author Posted March 31, 2007 Hiya PaulIA, great work thanks! I'we tried some of you'r functions and they seem to work great, but now i have one i cant seem to get the hang of ( ! ) help. #include <A3LWinAPI.au3> $iAction = 'SPI_GETSCREENSAVERRUNNING' $test1 = _API_SystemParametersInfo($iAction) ConsoleWrite( $test1 ) ;Will Return false if screen saver is not active.. While 1 $test2 = _API_SystemParametersInfo($iAction) If $test2 <> $test1 Then ConsoleWrite( $test2 ) ;Should return true if screensaver is started.. EndIf Sleep(40) WEndSPI_GETSCREENSAVERUNNING is not a string. It is a numeric constant that is defined in A3LConstants.au3. Just remove the quote marks and you should be fine. Auto3Lib: A library of over 1200 functions for AutoIt
PaulIA Posted March 31, 2007 Author Posted March 31, 2007 Kind of new here and new of using AutoIt3. Love your library... I need "right click" the toolbar button(taskbar) to get the popup menu This is how I am using it: $icon = _Toolbar_IndexToCommand($hd, $i) $iconText = _Toolbar_GetButtonText ($hd, $icon) ... if StringRegExp($iconText, "title", 0) Then _Toolbar_ClickButton($hd, $icon) <==== Here, I need do right click... but looks like this is left only sleep(1000) EndIf _Menu_ClickPopup("Properties") Not sure if I can use your lib to do it.. and if this is the right way to use it... ThanksWelcome to the forum. Change _Toolbar_ClickButton to this: Func _Toolbar_ClickButton($hWnd, $iCommandID, $sButton="left", $fMove=False) Local $tPoint, $tRect, $iX, $iY $tRect = _Toolbar_GetRectEx($hWnd, $iCommandID) $tPoint = _Lib_PointFromRect($tRect) $tPoint = _API_ClientToScreen($hWnd, $tPoint) _Lib_GetXYFromPoint($tPoint, $iX, $iY) _Lib_MouseClick($sButton, $iX, $iY, $fMove, 1, 0, True) EndFuncoÝ÷ Ù8^ÈZ²¢êÜjYm¡«¢+Ù}Q½½±É} ±¥ ÕÑѽ¸ ÀÌØí¡°ÀÌØí¥½¸°ÅÕ½ÐíÉ¥¡ÐÅÕ½Ðì¤ As for clicking on a popup menu, you have two choices. If you want to click on a menu item by it's position, use _Menu_ClickPopup and pass the zero based position of the menu item. If you want to click on a menu item using it's accelerator character (the underlined character in the menu item), use _Menu_ClickPopupAccel and pass the accelerator character. Might want to throw in some error checking after the library calls too, just to be safe. I'll change the _Toolbar_ClickButton function for the next release. Thanks for pointing this out. Auto3Lib: A library of over 1200 functions for AutoIt
Ram Posted March 31, 2007 Posted March 31, 2007 First, there are two ListView demos. One just exercises the various calls for a ListView control and the other captures the ToolTips from Explorer. I assume that you are running the correct demo? Second, I assume you know that when you run the demo, the Explorer window that is opened has to be the active window and you are suppose to hover your mouse over the items in Explorer (like your C: drive)? When you do, the demo will print out the ToolTip that is displayed in the SciTE console. This demonstrates what you asked for: How to capture the text from a ToolTip control. If you study the demo script, you will then be able to apply this same technique to solve your problem. Third, I have not heard anybody but you say the help file doesn't work. If it is copied in the same directory as the AutoIt help file (which is "C:\Program Files\AutoIt3"), it works. If the help file doesn't work for you, it may be something specific to your system. Fourth, you need to tone down your posts if you expect help. Yelling at me (using upper case), multiple exclaimation points and question marks does not motivate me to help you in any shape, form or fashion. PaulIA... I think you misunderstood me.. If I need help why do I have yell at you or anybody..and BTW: If I am yelling why do have to say Thanks and awaiting your response !! Putting exclaimatiion mark multiple question marks is my style for writing..and I have been doing that since my child wood..!! Anyways, if you feel I am yelling at you.. I am sorry for that..!! The help file was copied to the same directory. I think I missed copying au3.user.calltips this file to SCITE directory. Now I can see the help file properly. I removed au3.user.calltips from SCITE folder and I got page cannot be displayed.!! I opened tooltip2.au3 in scite and then ran the script for my application and all I got in the tooltip text field was the Title of my application but didn't get the column information. so I was looking at the help found out there is something for getting tooltip text. which is _ToolTip_GetText($hWnd, $hTool, $iID) Hence can you help me out in using " _tooltip_gettext" working for my applicaiton... Awaiting your response! Thanks !!
PaulIA Posted April 1, 2007 Author Posted April 1, 2007 PaulIA... I think you misunderstood me.. If I need help why do I have yell at you or anybody..and BTW: If I am yelling why do have to say Thanks and awaiting your response !! Putting exclaimatiion mark multiple question marks is my style for writing..and I have been doing that since my child wood..!! Anyways, if you feel I am yelling at you.. I am sorry for that..!! The help file was copied to the same directory. I think I missed copying au3.user.calltips this file to SCITE directory. Now I can see the help file properly. I removed au3.user.calltips from SCITE folder and I got page cannot be displayed.!! I opened tooltip2.au3 in scite and then ran the script for my application and all I got in the tooltip text field was the Title of my application but didn't get the column information. so I was looking at the help found out there is something for getting tooltip text. which is _ToolTip_GetText($hWnd, $hTool, $iID) Hence can you help me out in using " _tooltip_gettext" working for my applicaiton... Awaiting your response! Thanks !!When you use upper case words LIKE THIS!!!, it is considered yelling on a forum. I think you'll also find that most people find that multiple exclaimation points and question marks are read as a strongly written, emotional post. No harm done though, so let's get on to the problem at hand. I think you may be confused about what a ToolTip is. It's not just the TrayTip that appears when you hover your mouse over the AutoIt icon that appears next to your PC clock when you run a script (which is what I'm betting you are doing). So let's step through what I told you to do in the previous post, because I think you're missing the trees for the forest: 1. Run the ToolTip2.au3 script in SciTE. 2. The script opens Explorer and pops up a message dialog that tells you to close Explorer to exit the demo. 3. Make sure that Explorer is focused (click on the title bar or something) and then hover your mouse over the C: drive folder in Explorer. When I do this on my machine, a ToolTip pops up telling me how much disk space is free/used for my C: drive. When the ToolTip pops up, the demo grabs the text from the Explorer ToolTip and prints it in the SciTE console. You need to make sure you can get this to work before we go any further with how to capture the ToolTips in your application or you'll just be confused. If you get this to work, let me know and we'll take the next step. Auto3Lib: A library of over 1200 functions for AutoIt
Ram Posted April 1, 2007 Posted April 1, 2007 When you use upper case words LIKE THIS!!!, it is considered yelling on a forum. I think you'll also find that most people find that multiple exclaimation points and question marks are read as a strongly written, emotional post. No harm done though, so let's get on to the problem at hand.I think you may be confused about what a ToolTip is. It's not just the TrayTip that appears when you hover your mouse over the AutoIt icon that appears next to your PC clock when you run a script (which is what I'm betting you are doing). So let's step through what I told you to do in the previous post, because I think you're missing the trees for the forest:1. Run the ToolTip2.au3 script in SciTE.2. The script opens Explorer and pops up a message dialog that tells you to close Explorer to exit the demo.3. Make sure that Explorer is focused (click on the title bar or something) and then hover your mouse over the C: drive folder in Explorer.When I do this on my machine, a ToolTip pops up telling me how much disk space is free/used for my C: drive. When the ToolTip pops up, the demo grabs the text from the Explorer ToolTip and prints it in the SciTE console.You need to make sure you can get this to work before we go any further with how to capture the ToolTips in your application or you'll just be confused. If you get this to work, let me know and we'll take the next step.Yep. I get the tooltip info printed in scite console and I tried the same for my application (Tooltip2.au3 process is still running near the clock). I get all the tooltip infomation where ever I hover the mouse on the application but when I hover the mouse on the column name for the one which I want tooltip info. I get just my application's title info and not the tooltip's info...that what makes me concerned if this an tooltip or not?
rush4hire Posted April 1, 2007 Posted April 1, 2007 I appriciate what I've seen so far, though I haven't explored this very much. I was alarmed, though when I tried the examples and they started messing with my settings by opening my options dialogues and clicking stuff. This is bad. Please change these examples. Follow the standard of the examples that come with AutoIt. They never do stuff like this. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player
PaulIA Posted April 1, 2007 Author Posted April 1, 2007 Yep. I get the tooltip info printed in scite console and I tried the same for my application (Tooltip2.au3 process is still running near the clock). I get all the tooltip infomation where ever I hover the mouse on the application but when I hover the mouse on the column name for the one which I want tooltip info. I get just my application's title info and not the tooltip's info...that what makes me concerned if this an tooltip or not?If you run ToolTip2 it will catch all ToolTips that pop up, or they aren't ToolTips. Auto3Lib: A library of over 1200 functions for AutoIt
PaulIA Posted April 1, 2007 Author Posted April 1, 2007 (edited) I appriciate what I've seen so far, though I haven't explored this very much.I was alarmed, though when I tried the examples and they started messing with my settings by opening my options dialogues and clicking stuff.This is bad.Please change these examples.Follow the standard of the examples that come with AutoIt. They never do stuff like this.When you write your own 1,000 function library, you can make your examples do whatever you want. Until I decide otherwise, the ones in Auto3Lib will stay the way they are. Edited April 1, 2007 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt
LOULOU Posted April 1, 2007 Posted April 1, 2007 Hi Paul1A, I have a problem with the function _ListView_GetHotItem($hlist) if i move trough the listview with mouse , the function return me the right indice but if i move with down arrow the function return bad hot item ? Maybe you know that problem ?
PaulIA Posted April 1, 2007 Author Posted April 1, 2007 Hi Paul1A,I have a problem with the function _ListView_GetHotItem($hlist) if i move trough the listview with mouse , the function return me the right indice but if i move with down arrow the function return bad hot item ?Maybe you know that problem ?The hot item is always the item under the cursor, not the item which is currently focused. That's the way ListViews work and not a problem with Auto3Lib. Auto3Lib: A library of over 1200 functions for AutoIt
tinjaw Posted April 2, 2007 Posted April 2, 2007 PaulIA, First of all, thanks for Auto3Lib. I'd like to send you a donation via PayPal. Can you please PM where I can send it to. I am using your lib to get a series of screen captures, but not by using the _ScreenCap_Capture. I am using the Win32api and BitBlting the DC. This part is working wonderfully. Once I have the bitmap, I am attempting to use _ScreenCap_SaveBitmap to save it to a file. Some times it works and some times it doesn't. I haven't yet been able to track it down. When it does not work I get an error dialog. The text is, "_API_GetDIBits: The operation completed successfully." and no file is written to disk. If it does work properly, I don't get any error dialog and the bitmap is properly saved to disk. How do you suggest I troubleshoot this? thanx, tinjaw
tinjaw Posted April 2, 2007 Posted April 2, 2007 (edited) I have started debugging this by copying code from A3LScreenCap.au3 into my script. From this, so far, I have determined the error box is raised on the second call to _API_GetDIBits in the function _ScreenCap_SaveBitmap(). I see a call to _Lib_Check in _API_GetDIBits. Is that debugging code left in by accident, or should that be there? Edited April 2, 2007 by tinjaw
tinjaw Posted April 2, 2007 Posted April 2, 2007 [sorry folks, when I started this I thought we could edit our own posts. I planned on updating my original post as I got more info. But it seems that is only for a few minutes. I won't do this again after this. Sorry] It seems like _Lib_Check is doing there and detecting that the API call is returning an error, but the text string returned appears to be wrong. I think it should be "ERROR_INVALID_PARAMETER One or more input parameters is invalid.".
seamg Posted April 2, 2007 Posted April 2, 2007 Welcome to the forum. Change _Toolbar_ClickButton to this: Func _Toolbar_ClickButton($hWnd, $iCommandID, $sButton="left", $fMove=False) Local $tPoint, $tRect, $iX, $iY $tRect = _Toolbar_GetRectEx($hWnd, $iCommandID) $tPoint = _Lib_PointFromRect($tRect) $tPoint = _API_ClientToScreen($hWnd, $tPoint) _Lib_GetXYFromPoint($tPoint, $iX, $iY) _Lib_MouseClick($sButton, $iX, $iY, $fMove, 1, 0, True) EndFuncoÝ÷ Ù8^ÈZ²¢êÜjYm¡«¢+Ù}Q½½±É} ±¥ ÕÑѽ¸ ÀÌØí¡°ÀÌØí¥½¸°ÅÕ½ÐíÉ¥¡ÐÅÕ½Ðì¤ As for clicking on a popup menu, you have two choices. If you want to click on a menu item by it's position, use _Menu_ClickPopup and pass the zero based position of the menu item. If you want to click on a menu item using it's accelerator character (the underlined character in the menu item), use _Menu_ClickPopupAccel and pass the accelerator character. Might want to throw in some error checking after the library calls too, just to be safe. I'll change the _Toolbar_ClickButton function for the next release. Thanks for pointing this out.awesome! works perfectly. Also thanks of pointing out the _menu_clickpopup usage, it works great if using position.... Thanks Paul...
PaulIA Posted April 2, 2007 Author Posted April 2, 2007 [sorry folks, when I started this I thought we could edit our own posts. I planned on updating my original post as I got more info. But it seems that is only for a few minutes. I won't do this again after this. Sorry] It seems like _Lib_Check is doing there and detecting that the API call is returning an error, but the text string returned appears to be wrong. I think it should be "ERROR_INVALID_PARAMETER One or more input parameters is invalid.".I have recently discovered a bug in the _ScreenCap_SaveBitmap function that is generating this error. Without going too much into the specifics, it has to do with the image size calculation. This will be fixed in the next release (which will be this week or next). Until then, you can avoid this error by making sure that the width and height of the image you are saving are evenly divisable by 4. Auto3Lib: A library of over 1200 functions for AutoIt
rush4hire Posted April 3, 2007 Posted April 3, 2007 When you write your own 1,000 function library, you can make your examples do whatever you want. Until I decide otherwise, the ones in Auto3Lib will stay the way they are.No UDF that comes with Autoit3 will have examples that are like this.Settings on my computer where changed. Folder view options and stuff. I'm telling you this for your own good, young man. There's no need for you to just get snide with me. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player
PaulIA Posted April 3, 2007 Author Posted April 3, 2007 No UDF that comes with Autoit3 will have examples that are like this.Settings on my computer where changed. Folder view options and stuff. I'm telling you this for your own good, young man. There's no need for you to just get snide with me.You're one of those people that buys a gun, shoots themselves in the foot and then blames the gun manufacturer. And as for the "young man" crack, it just shows that you obviously have no clue who you're talking to. Take it somewhere else. I have no time for trolls... Auto3Lib: A library of over 1200 functions for AutoIt
lsakizada Posted April 3, 2007 Posted April 3, 2007 PaulIA,I am getting the error bellow on performing rightclick mouse on the nodes.I ran the example "Tree View 1.au3". What is wrong?C:\PROGRA~1\AutoIt3\beta\Include\A3LStructs.au3 (54) : ==> Subscript used with non-Array variable.: Local $iElement = Eval($aTag[0] & $sElement) Local $iElement = Eval($aTag^ ERRORThanks Be Green Now or Never (BGNN)!
Recommended Posts