Jump to content

anks

Active Members
  • Posts

    26
  • Joined

  • Last visited

anks's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. @Melba23 I have integrated your code with mine...and it goes as below: #Include <GuiToolBar.au3> Opt("WinTitleMatchMode", 2) Global $hSysTray_Handle, $iSysTray_ButtonNumber Global $sToolTipTitle = "True Color Finder" $iSysTray_ButtonNumber = Get_SysTray_Index($sToolTipTitle) If $iSysTray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is True Color Finder Running?") Exit Else $tRect = _GUICtrlToolbar_GetButtonRectEx($hSysTray_Handle, $iSysTray_ButtonNumber) $tPoint = _WinAPI_PointFromRect($tRect) $tPoint = _WinAPI_ClientToScreen($hSysTray_Handle, $tPoint) Local $iX, $iY _WinAPI_GetXYFromPoint($tPoint, $iX, $iY) MouseMove($iX, $iY) EndIf Func Get_SysTray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32; INSTANCE:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSysTray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop Next If $iSysTray_ButtonNumber = $iSysTray_ButCount Then Return 0 ; Not found Else Return $iSysTray_ButtonNumber ; Found EndIf EndFunc But still the same problem persists, directly the IF statement as below runs If $iSysTray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is True Color Finder Running?") Exit and a message prompt is thrown as "Is True Color Finder Running?" Can u please help me how to proceed further
  2. Hi All, Objective: Need to find a Application named "True Color Finder" running in the system tray of Win XP-32 bit and clicking left click , so that context menu opens up. Script used: #Include <GuiToolBar.au3> Opt("WinTitleMatchMode", 2) Global $hSysTray_Handle, $iSysTray_ButtonNumber Global $sToolTipTitle = "True Color Finder" $iSysTray_ButtonNumber = Get_SysTray_Index($sToolTipTitle) If $iSysTray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is True Color Finder Running?") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSysTray_ButtonNumber, "right") Sleep(2000) ;_GUICtrlToolbar_ClickIndex($hSysTray_Handle,2) Send("{UP}") Send("{UP}") ;Sleep(2000) Send("{ENTER}") ;_GUICtrlToolbar_ClickIndex($hSysTray_Handle,2, "left", True) Sleep(1000) ;~ $ret = _GUICtrlToolbar_GetButtonText($hSysTray_Handle,"#32768") ;~ msgbox(0,"",$ret) EndIf Func Get_SysTray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32; INSTANCE:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSysTray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop Next If $iSysTray_ButtonNumber = $iSysTray_ButCount Then Return 0 ; Not found Else Return $iSysTray_ButtonNumber ; Found EndIf EndFunc Problem Statement: The script above works only in few monitors, for other monitors it does not work. Anybody can please provide me help regarding it, i believe that there are some settings changes on the monitor which needs to be done. Can any body guide me regarding the setting changes. Resolution of monitor where the script runs: 1280 x 768. Resolution of monitor where the script does not run: 1920 x 1080. Thank you all of you.
  3. Thanks a lot Mr Mitchell. Your code was of great help. It helped me to resolve the issue. "getElementsByTagName" was the call i had to make instead i was using another API of AutoIT Thanks once again.
  4. Hello All, Can anybody please tell me that if _IELinkGetCollection can be used to find links in the particular tags. Please see my code $oInputs = _IETagNameGetCollection ($oIE, "LI") For $oInput In $oInputs MsgBox(0, "UL", $oInput.innerText) $oLinks = _IELinkGetCollection($oInput) For $oLink In $oLinks $str_cmpre = StringCompare($oLink.href,"Null") If ($str_cmpre == 0) Then Msgbox(0,"Hello", "Hello") Else Msgbox(0,"Link","Got the link", 1) MsgBox(0, "Link Info", $oLink.href, 1) EndIf ;~ If( $oLink.href == "Null") Then ;~ Msgbox(0,"Hello", "Hello") ;~ ;msgbox(0,"UL",$oInput.innertext) ;~ Else ;~ Msgbox(0,"Link","Got the link", 1) ;~ MsgBox(0, "Link Info", $oLink.href, 1) ;~ EndIf Next Next I want to read the tag and find out if the tag has a link within it or not. The above logic does not work. Always the else part of If is been executed. Today while keenly reading the help i found out that _IELinkGetCollection(ByRef $o_object [, $i_index = -1]) takes input parameter as $o_object which is a Object variable of an InternetExplorer.Application, Window or Frame object. Can i use the tag name objects as the input parameter with in it. Please guide me in this respect. Thanks in Advance.
  5. Hi All, I have a task to right click on a certain application in system tray and be able to select (click) an item(from the context menu) and read the text of the item selected. I am able to select the application from system tray, but not able to read the text. Please see the snippet of code attached: #Include <GuiToolBar.au3> Opt("WinTitleMatchMode", 2) Global $hSysTray_Handle, $iSysTray_ButtonNumber Global $sToolTipTitle = "SmartDualMon" $iSysTray_ButtonNumber = Get_SysTray_Index($sToolTipTitle) If $iSysTray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is SmartDualMon Running?") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSysTray_ButtonNumber, "right") Sleep(2000) ;_GUICtrlToolbar_ClickIndex($hSysTray_Handle,2) Send("{UP}") Send("{UP}") Sleep(1000) $ret = _GUICtrlToolbar_GetButtonText($hSysTray_Handle,"#32768") msgbox(0,"",$ret) EndIf Func Get_SysTray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32; INSTANCE:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSysTray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSysTray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop Next If $iSysTray_ButtonNumber = $iSysTray_ButCount Then Return 0 ; Not found Else Return $iSysTray_ButtonNumber ; Found EndIf EndFunc In the above code using this API "_GUICtrlToolbar_GetButtonText()" i am able to read the text of the other application running in the system tray. Please advice me regarding it. Thank U...
  6. Thanks for the reply I tried your above code, but i am not able to save the type and size of the font on the clipboard. My objective is to get the text from an Application and paste the text with same size and type into excel. Please reply me ...if you have any idea.
  7. Hi Raja, I have used AUTOIT tool for the automation on localization of application. Here are the list it will support and on which I have worked on: Win XP 32 bit( Eng, Korean, CHinese) Win 2K Win XP 64 bit Win Vista( But i faced some issues during this implementation) I hope it has given u an idea of the support of the tool ~Anks
  8. Hi All, I am facing a issue where i have to Get the text from an application, and paste that text in the clipboard. The text copied to clipboard should be in the same format as that of the application. For ex: if Application font is Verdana, the text getting saved should have verdana font. Please look the snippet of code written by me: #Include <ExcelBMS.au3> #Include <BMS.au3> #Include <Clipboard.au3> $text = ControlGettext("Building Management System - Engineering", "", "[NAME:label1]") msgbox(0,"",$text) $ret = _ClipBoard_SetData($text,$CF_TEXT) msgbox(0,"",$ret) I am able to save the text on clipboard but the font is not getting saved in the same format. Any body who know regarding this please help me.... Thank you.!! ~Ankita
  9. Thanks Bugfix for the reply...I am able to retrieve the font name in A1 cell by calling the function "Font.Name" using the Excel object. But for ex: I have the to retrieve the font name of an application built by us how it is possible. Please find below the code, where i am trying to retrieve the font name of an notepad, but it throws an error: $ofile = ObjCreate("Wscript.Shell") ;This line is throwing error msgbox(0,"",$ofile) $file = FileOpen("d:\trial.txt", 0) msgbox(0,"",$file) $handle= ControlGetHandle("trial.txt - Notepad", "", "Edit1") msgbox(0,"",$handle) $var = ControlGetText("trial.txt - Notepad", "", $handle,ofile.font.Name ) msgbox(0,"",$var) Can u please help me...
  10. Dear All, While testing an application i have come under a situation where i need to find out the style and the type of font. Please see the code below: $Property = _ExcelReadCell($oExcelInput, $Cell, 3) $Actual = ControlGetText($Title, "", $Property) The ControlGettext function retrieves the text, is there any mechanism where i can find the style and the type of font for the text retrieved from ControlGetText function. Please help me for it. Thank U ~Akita
  11. Dear All, I have to create a array with names such as: Value1[2] ; Value2[2] Value3[2] . . . Value50[2] where Value1[0] = "1". Value2[1] = "Boolean1". The same thing follows for other 50 Value array's I have attached a snippet of code for reference. Please review it and help me. for $i = 1 to 50 STEP 1 ; Making 50 points $arrayname = "value" & $i $arrayname[0] = $i $str1 = ' " ' $str2 = 'Boolean' $cstr = $i $str3 = ' " ' $namestr = $str1 & $str2 & $cstr & $str3 $arrayname[1] = $namestr Next The above code throws a error "Subscript used with non-Array variable." Can anybody please suggest how to move on with it. How to create arrays Value1, Value2, ..... Value50 and this inturn takes values as Value1[0] Value1[1]
  12. @Melba23.. Hey thanks the first idea works... The second idea i hardly understood......
  13. Dear All, I want to write some string variables such as: "1" "2" "3" ... to be stored in an array named $idarr[$i] I have written my code snippet. Please anybody help me with it. Dim $idarr[50], $str1, $str2 for $id = 1 to UBound($idarr) - 1 STEP 1 [b]$str1 = " " " ; The single double quote is surrounded by the other two double quotes $str2 = $id $str3 = " " "[/b] $idarr[$i] = $str1 & $str2 & $str3 ...... .. The double quotes in bold,are giving me compilation error. Anybody having knowledge how to assign it.
  14. Hey thanks..... Its works.......
  15. Hi All, I am trying to use XML Dom Wrapper Function, and i had written the following snippet code: #include <_XMLDomWrapper.au3> #Include <Array.au3> Dim $aAttr[50], $aVal[50], $node,$node1 $node = "logicalpage" $returnval = _XMLCreateFile("D:\UMS\AUTOMATION\Performance\sample.xml", $node) $node1 = "folders" $ret = _XMLCreateRootChild($node1) MsgBox(0, "Error:", $ret, 2) ;~ $returnchildnode = _XMLCreateChildNode("//logicalpage", "child") In the above code i am able to create the XML Sample with root mode as "Logical Page", but i am not able to use " _XMLCreateRootChild" and also use "_XMLCreateChildNode" functions. Can any body please help me with it. Thanks.
×
×
  • Create New...