
rogdog
Active Members-
Posts
59 -
Joined
-
Last visited
Everything posted by rogdog
-
This has now been fixed. For some reason my code in the OP had been corrupted !!
-
TCPConnect( $sIPAddr , $iPort [, $iTimeOut ] )
rogdog replied to JScript's topic in AutoIt Example Scripts
A big thank to ProgAndy for his code and JScript for the modified version. Just what I was after -
; locates and right clicks the Icon for this script #include <GuiToolbar.au3> #include <_SysTray.au3> $ToolTipString = 'Autoit - '&@ScriptName $count = _SysTrayIconCount() For $i = 0 to $count - 1 $tooltip = _SysTrayIconTooltip($i) ConsoleWrite("index: " & $i & @TAB & "tooltip: " & $tooltip & @CRLF) If $tooltip = $ToolTipString then $Index = $i Next $hWnd = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') $iCommandID = _GUICtrlToolbar_IndexToCommand($hWnd, $Index) $aRect = _GUICtrlToolbar_GetButtonRect ($hWnd, $iCommandID) ControlClick($hWnd, '', '','Secondary',1,$aRect[0],$aRect[1]) Example code to locate and right click a notification(systray) icon even if the taskbar is hidden.
-
This might be just what I am after for a project at work. Thankyou very much
-
Extended Message Box - New Version: 16 Feb 24
rogdog replied to Melba23's topic in AutoIt Example Scripts
Thanks, great work :-) -
No good for me. I get the following error "Unable to Locate Component This application has failed to start because packet.dll was not found. Re-installing the application may fix the problem"
-
a short func here for you Func cov($Hex) Local $aVals[16] = ["0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"] Return $aVals[Dec($Hex)] EndFunc
-
_IECreateEmbedded in child window: script freezing
rogdog replied to rogdog's topic in AutoIt GUI Help and Support
Hi Martin, Thanks for having a look. Hopefully somebody else may be able to solve this one. -
_IECreateEmbedded in child window: script freezing
rogdog replied to rogdog's topic in AutoIt GUI Help and Support
Hi Martin, Many thanks for your tip. I have tried what you suggested but the script still hangs once the first MsgBox has appeared and I try an click on a link in the embedded web browser. -
After many hours of searching the forum and head scratching I have failed to work out why the following script freezes. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> ;_IEErrorHandlerRegister () ; Create main window $hParent = GUICreate("My GUI Tab",600,600) $idMsgbox = GUICtrlCreateButton("MSGBOX",3,5,100,25) GUISetState(@SW_SHOW,$hParent) ; create child window ; If next 2 lines are commented out then script does not freeze $hChild = GuiCreate("Child",550,550,0,30,$WS_CHILD,-1,$hParent) GUISetState(@SW_SHOW,$hChild) ; Create Embbedded IE Browser $oIE = _IECreateEmbedded () $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 500, 500) $Event = ObjEvent($oIE, "_WebEvent_", "DWebBrowserEvents") ;_IENavigate ($oIE, 'about:blank') _IENavigate ($oIE, 'www.bbc.co.uk') While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $idMsgbox MsgBox(262144,0,"Button Pressed") EndSwitch WEnd Func _WebEvent_($EventName) ConsoleWrite($EventName&@crlf) ; MsgBox causes script to freeze if child windows has been created if $EventName = "DownloadBegin" then MsgBox(262144,0,$EventName) EndFunc The script seems to freeze after the fist MsgBox is dsiplayed in the _WebEvent() function. Also, the problem only occurs if the child GUI is created. If the child GUI is commented out so that the embedded browser is created directly in the parent GUI then then the script is OK. Has any one got a fix for me please.
-
Hi AlmarM, Just had another play with _INetSmtpMail() and got a bit further. I realised that my antivirus software (McAfee) is set to block smtp traffic by default. However, once I removed the block I received error message 50 instead of 4 @ERROR = 5x - Cannot open SMTP session. x indicates the index number of last command issued to the SMTP server. It would be worth you checking any antivirus/firewall products you have that might be blocking the smtp connection
-
Communicate between scripts on same pc
rogdog replied to JohnMC's topic in AutoIt General Help and Support
Hi sandin, Thanks for posting your example above. Exactly what I was after for one of my applications I am writing. -
I have tried the code using my work smtp settings and it doesn't seem work for me either. Sorry but can't see what we are doing wrong :-(
-
Try using the following commands Do Until or While Wend
-
Many thank for this excellent UDF
-
'DeltaCopy' is a simple rsync tool for windows. Did you try that ?
-
Also Hex doesn't work when using decimal 65280 as an input
-
Hi torels, I have not had chance to try out your script but wanted to say thanks for sharing it with others. I have looked at the source and it looks very professional. Assuming it all works !! it would be great to see this kind of UDF included in a future build of autoit. All I need to do now is convert some of my scripts to use your code thanks
-
Thank you for your kind words. It is very rewarding when people go out of there way to thank others for there efforts. I am glad you found my scripts useful. I am using the _RevserseDNS() func everyday in an scheduled script that I have for gathering various information form my network. Some of the smallest functions can be the most useful !. My scheduled script mainly uses SNMP rather than WMI to scan network devices (switches,routers,etc) rather than servers. I run the script once a day to determine what nodes (servers,printers,etc) are connected to the network. I saw a bit of wmi code the other day which may help you posted by ptrex http://www.autoitscript.com/forum/index.php?showtopic=70759
-
Please find a small Func and test utiltiy for doing reverse DNS lookups on a network Here is some history behind the FUNC I recently had a requirement at work incorporate a reverse dns lookup scanner into one of my Autoit programs. My first attempt was to use the UDF Function _TCPIpToName(ipaddress). This would work fine if there was a valid reply from the network but would take aprox 4.5 seconds per ip address if the FUNC timed out. This was way to slow as I had hundreds of potential ip addresses to scan. I needed to find a better way. Looking through the forums I found a useful post (http://www.autoitscript.com/forum/index.php?showtopic=63353) by forum member Fox2. This FUNC used the Windows command prompt PING utility and with a little tweaking, I managed to get the timeout to be much shorter than the UDF func above. This prompted me to experiment a bit further and I eventually managed to write a simillar function using the windows command prompt tool NSLOOKUP. The NSLOOKUP tool doesn't need to PING the network devices before resolving the names so it is quicker and produces less network traffic. Also, not all network devices are Pingable so NSLOOKUP should have a better hit rate. Anyway, here is my simple _ReverseDNS Func using NSLOOKUP New Version: Posted 8th August 2012 Added StderrRead command as suggested in Knollo's code (post #6) Func _ReverseDNS($IPAddress) Local $NSLookupCmd,$ResponseText,$X1,$X2 $IPAddress = StringStripWS($IPAddress,3) $NSLookupCmd = Run(@ComSpec & " /c nslookup "& $IPAddress, "", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD) While 1 StderrRead($NSLookupCmd) If @error Then ExitLoop WEnd $ResponseText = StdoutRead($NSLookupCmd) If @error Then Return $x1 = StringInStr($ResponseText, "Name:") $x2 = StringInStr($ResponseText, "Address",0,-1) If $x1 > 0 and $x2 > 0 Then Return StringStripWS(StringMid($ResponseText, $x1 + 6, $x2 - $x1 - 6),3) Return "Unknown" EndFunc
-
You could try my bit of code here CODE ;-------------------------------- Func _SysObjIDToHexString($Input) ;-------------------------------- Local $Output If StringLeft($Input,4) = "1.3." then $Input = StringTrimLeft($Input,4) $aInput = stringsplit($Input,".") for $x = 1 to $aInput[0] $Output &= hex(Number($aInput[$x]),2) Next Return $Output EndFunc
-
Many thanks Christophe.
-
Hi Fox2, I have been meaning to create a script for reverse DNS and you example script prompted me to have a play. Your script works well but I decided to create a script using the command 'NSLOOKUP' instead of 'PING' To me NSLOOKUP is neater than PING as it only sends the reverse DNS commands to the DNS server on the network. In comparison, the PING command sends a reverse DNS lookup to the DNS server and then Pings the IPaddress in question. This is extra traffic on the network which is not actually required. I also wanted to be able to do a RDNS lookup on a large list of IP addresses so I didn't really want to send these unnecessary pings. Having said all that, I can still see that using PING is good if you also want to check whether the device is currently active on the network (assuming it responds to pings !) Anyway Here is my Simple equivalent NSLOOKUP version of the FUNC CODEFunc _ReverseDNS($IP) $IP = StringStripWS($IP,3) $NSLookupCmd = Run(@ComSpec & " /c nslookup "& $IP, "C:\", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD) $ResponseText = StdoutRead($NSLookupCmd) If @error Then Return $x1 = StringInStr($ResponseText, "Name:") $x2 = StringInStr($ResponseText, "Address",0,-1) If $x1 > 0 and $x2 > 0 Then Return StringStripWS(StringMid($ResponseText, $x1 + 6, $x2 - $x1 - 6),3) Return "Unknown" EndFunc I have also written a GUI to test the FUNC CODE#include <GuiIPAddress.au3> $hGUI = GUICreate("RDNS",600,400) $idEdit=GUICtrlCreateEdit ("", 0,0,600,350,BitOR($ES_AUTOVSCROLL,$ES_READONLY,$WS_HSCROLL,$WS_VSCROLL)) GUICtrlSendMsg($idEdit, $EM_SetLimitText, 0, 0); Set Edit Text Buffer Size to unlimited ; Create GUI $idBTNStart=GUICtrlCreateButton ("START", 10,360,90,25) $idBTNStop=GUICtrlCreateButton ("STOP", 110,360,90,25) GUICtrlCreateLabel ("START IP", 220,366,50,25) GUICtrlCreateLabel ("END IP", 420,366,50,25) $hIPAddressStart = _GUICtrlIpAddress_Create($hGUI, 280, 360) $hIPAddressEnd = _GUICtrlIpAddress_Create($hGUI, 470, 360) $IPStart = IniRead("rdns.ini","IpRange","Start","0.0.0.0") $IPEnd = IniRead("rdns.ini","IpRange","End","0.0.0.0") _GUICtrlIpAddress_Set($hIPAddressStart, $IPStart) _GUICtrlIpAddress_Set($hIPAddressEnd, $IPEnd) GUISetState (@SW_SHOW) Do $Msg = GUIGetMsg() If $Msg = $idBTNStart Then $IPStart = _GUICtrlIpAddress_Get ($hIPAddressStart) $IPEnd = _GUICtrlIpAddress_Get ($hIPAddressEnd) $iIPStart = _IP2Number($IPStart) $iIPEnd = _IP2Number($IPEnd) For $iIP = $iIPStart to $iIPEnd $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE then _Exit() If $Msg = $idBTNStop then ExitLoop $sIP = _Number2IP($iIP) GUICtrlSetData($idEdit,$sIP &" = "& _ReverseDNS($sIP )&@crlf,1) Next EndIf Until $Msg = $GUI_EVENT_CLOSE _Exit() Func _ReverseDNS($IP) $IP = StringStripWS($IP,3) $NSLookupCmd = Run(@ComSpec & " /c nslookup "& $IP, "C:\", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD) $ResponseText = StdoutRead($NSLookupCmd) If @error Then Return $x1 = StringInStr($ResponseText, "Name:") $x2 = StringInStr($ResponseText, "Address",0,-1) If $x1 > 0 and $x2 > 0 Then Return StringStripWS(StringMid($ResponseText, $x1 + 6, $x2 - $x1 - 6),3) Return "Unknown" EndFunc Func _Number2IP($IPNumber) Local $IPString = "" For $index = 3 to 0 step -1 $X = Int($IPNumber/(256^$index)) $IPNumber = $IPNumber - $X*256^$index $IPString &= $X &"." Next Return StringTrimRight($IPString,1) EndFunc Func _IP2Number ($IP) $IPArray=StringSplit($IP,'.') $IPValue=($IPArray[1]*(256^3))+($IPArray[2]*(256^2))+($IPArray[3]*(256^1))+($IPArray[4]) Return $IPValue EndFunc Func _Exit() IniWrite("rdns.ini","IpRange","Start",$IPStart) IniWrite("rdns.ini","IpRange","End",$IPEnd) EndFunc
-
Howto get quality Large Icons in Toolbar using imagelist
rogdog replied to rogdog's topic in AutoIt GUI Help and Support
Cool, thanks for quick replys and excelent fix Gary . I have tested it out and it works great -
I would like to use 32x32pixel 32bit icons in a toolbar but can't get them to display correctly in Autoit (3.2.10.0) The icons look very poor as is they are 16x16pixel 8bit icons. The following code shows an example icon using the toolbar and imagelist. It also show the same icon using the command GUICtrlCreateIcon. I would like the toolbar icon to look like the GUICtrlCreateIcon icon Anyone got any ideas how I can fix this please CODE #include <GuiConstantsEx.au3> #include <GuiImageList.au3> #Include <GuiToolBar.au3> Local $id1, $GUI, $hImage Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp $GUI = GUICreate("(External) ImageList AddIcon", 400, 300) GUISetState() ; Load images $hImage = _GUIImageList_Create (32,32, 5, 3) _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 20) ; Create toolbar $hToolbar = _GUICtrlToolBar_Create($GUI) _GUICtrlToolbar_SetImageList($hToolbar, $hImage) _GUICtrlToolbar_AddButton ($hToolbar, $id1, 0) ; add Gui icon $icon = GUICtrlCreateIcon (@SystemDir & "\shell32.dll",21, 3,50) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete()