Jump to content

notta

Active Members
  • Posts

    192
  • Joined

  • Last visited

About notta

  • Birthday 09/22/1969

notta's Achievements

Prodigy

Prodigy (4/7)

0

Reputation

  1. ISI360, I had to log on to tell you that this application is amazing. The GUI builder is beautiful. Very nice job!
  2. This is very nice. I love the interface.
  3. I copied abberation's example and I didn't receive any errors. Are you sure you copied the entire code including the last line EndFunc?
  4. haha, thanks anyway man. I have verified it on a 3rd Windows 7 machine so something is wrong.
  5. Thanks guys. The issue is happening on my Windows 7 machine. I have verified that the child window delay does not happen on Windows XP. I built the test file and had a co-worker run it on his Windows 7 machine and he also sees the delay. I don't have a Vista machine so I can't test that. Anyone have a 7 box they can test it on?
  6. I have a child window inside of my main window that has a tab control with a scrollbar. Everything is working fine except for a few little annoyances. When I minimize the window it works fine, but when I click on the window to bring it back I see the child window display instantly and then the parent window comes in behind it a second later. Also, I have another issue that when the window is open for a while and I come back to it the child window is shifted to the right and is extending outside the bounds of the parent window. I have not been able to narrow down when this happens, but it has happened quite a few times. If someone has a chance please take a look and see if you see the same thing. Thanks. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <TabConstants.au3> #include <GUIScrollbars_Ex.au3> #include <StringSize.au3> #include <EditConstants.au3> #include <ComboConstants.au3> $xWidth = 800 $xHeight = 600 $iPadRight = 20 $iPadBottom = 20 $eColor = 0x80FF80 $oColor = 0xffffff $Form1 = GUICreate("My GUI", $xWidth, $xHeight) ; will create a dialog box that when displayed is centered $tab1 = GUICtrlCreateTab(0,10,$xwidth,490) $t1 = GUICtrlCreateTabItem("Tab 1") $t2 = GUICtrlCreateTabItem("Tab 2") $t3 = GUICtrlCreateTabItem("Tab 3") $t4 = GUICtrlCreateTabItem("Tab 4") $t5 = GUICtrlCreateTabItem("Tab 5") $t6 = GUICtrlCreateTabItem("Tab 6") GUICtrlCreateTabItem("") $hTab_Win0 = GUICreate("Test", $xWidth - 20, 400, 10, 50, $WS_POPUP, $WS_EX_MDICHILD, $Form1) GUISetBkColor(0xffffff) _GUIScrollbars_Generate($hTab_Win0, 0,400) GUISetState(@SW_SHOW, $Form1) GUISetState(@SW_SHOW, $hTab_Win0) ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $Tab1 Then _Tab() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete($hTab_Win0) GUIDelete($Form1) Func _Tab() Switch GUICtrlRead($tab1) Case 0 GUISetState(@SW_SHOW, $hTab_Win0) Case 1 GUISetState(@SW_HIDE, $hTab_Win0) Case 2 GUISetState(@SW_HIDE, $hTab_Win0) Case 3 GUISetState(@SW_HIDE, $hTab_Win0) Case 4 GUISetState(@SW_HIDE, $hTab_Win0) Case 5 GUISetState(@SW_HIDE, $hTab_Win0) EndSwitch EndFunc
  7. I've searched the forums and was surprised to have not seen this question asked before. How do you center text both horizontally and vertically in an inputbox control when the default height is changed? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Dim $msg Dim $xWIdth = 500 Dim $xHeight = 500 Dim $iWidth = 200 Dim $iHeight = 35 GUICreate("My GUI", $xWIdth, $xHeight) ; will create a dialog box that when displayed is centered GUICtrlCreateInput("", ($xWIdth / 2) - ($iWidth / 2), ($xHeight / 2) - ($iHeight / 2), $iWidth, $iHeight, $ES_CENTER) GUISetState(@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete()
  8. Wow, Malkey that really streamlined it. I really appreciate you taking the time to do that. I was swamped all day at work today so I couldn't post. Regular expressions are killer for me, but I'm going to sit down now and go through how you did this. Thanks again.
  9. How about using a launcher that calls edit.exe? ;launcher.exe If ProcessExists("Edit.exe") Then Exit Else ;run edit.exe EndIf
  10. Hey guys, I have to create a comma separated string of IP addresses. The string could easily just consist of each IP address, but I want to create ranges to cut down the size of the string. What I mean by that is: 192.168.1.1,192.168.1.2,192.168.1.3,192.168.1.4,192.168.1.5,192.168.1.6 Want to return 192.168.1.1-192.168.1.6 It was more difficult then I thought it would be, but to be honest I'm curious if this could be done more efficiently? I don't like the fact that I'm treating the IP's as strings. I hate the fact that I had to add the leading 0's to sort the array. If I didn't add the leading 0's the array wouldn't be sorted correctly. I put together this small example so you guys could see. I will be dealing with 2000+ IP addresses when I actually go to use this. Any feedback would be appreciated. #include Global $aIP = StringSplit("192.168.121.12,192.168.120.176,192.168.134.23,192.168.134.32,192.168.134.67" & _ ",192.168.120.177,192.168.121.18,192.168.134.87,172.16.21.35,192.168.121.13,192.168.120.178" & _ ",192.168.121.1,192.168.121.2,192.168.120.179,192.168.121.10,172.16.33.2,192.168.121.11,192.168.120.180", ",") ;sequences 192.168.120.176,192.168.120.177,192.168.120.178,192.168.120.179,192.168.120.180 ;sequences 192.168.121.1,192.168.121.2 ;sequences 192.168.121.10,192.168.121.11,192.168.121.12,192.168.121.13 Global $newArray[UBound($aIP)][2] $newArray[0][0] = UBound($aIP) - 1 Global $aSequence[1] $aSequence[0] = 0 ;add the leading 0's for sorting purposes #Region add leading 0's for $i = 1 To UBound($aIP) - 1 $split = StringSplit($aIP[$i], ".") $newIP = "" For $j = 1 To UBound($split) - 1 Select Case $split[$j] > 0 AND $split[$j] <= 9 $val = "00" & $split[$j] $newIP &= $val & "." Case $split[$j] >= 10 AND $split[$j] <=99 $val = "0" & $split[$j] $newIP &= $val & "." Case $split[$j] >= 100 AND $split[$j] <=255 $val = $split[$j] $newIP &= $val & "." Case Else MsgBox(16,"","Should never get here") Exit EndSelect Next $newIP = StringTrimRight($newIP, 1) $newArray[$i][0] = $aIP[$i] $newArray[$i][1] = $newIP Next #EndRegion add leading 0's _ArraySort($aIP, 0, 1, 0, 2) _ArraySort($newArray, 0, 0, 0, 1) _ArrayDisplay($aIP, "source array sorted") _ArrayDisplay($newArray, "working array, sorted, with leading 0's") ;delete original array $aIP = "" ;hold the final string of IP's $stringOfIP = "" ;array loop counter $i = 1 ;holds the count of how many IP's currently exist in a sequence $counter = 1 ;holds the element of the first element in a sequence to be compared against $compareVal = 0 If $newArray[0][0] > 1 Then Do If $counter > 1 Then ;if we are in a sequence run If StringLeft($newArray[$i + 1][1], 12) = StringLeft($newArray[$i][1], 12) Then ;check if first 3 octets are equal If (StringRight($newArray[$i + 1][1], 3) - $counter) = StringRight($newArray[$compareVal][1], 3) Then ;compare current IP against first IP in the sequence ReDim $aSequence[UBound($aSequence) + 1] $aSequence[0] += 1 $aSequence[UBound($aSequence) - 1] = $newArray[$i + 1][0] ;add the IP without the leading 0's $counter += 1 $i += 1 _ArrayDisplay($aSequence, "In Sequence") ContinueLoop EndIf EndIf ;write out IP's to the string. No sense creating a range for 2 IP's. Only create an IP range for sequence of IP's > 2 Select Case $counter = 2 for $j = 1 To $aSequence[0] $stringOfIP &= $aSequence[$j] & "," Next Case $counter > 2 $stringOfIP &= $aSequence[1] & "-" & $aSequence[UBound($aSequence) -1] & "," EndSelect ;sequence over. reset variables $compareVal = 0 $counter = 1 ReDim $aSequence[1] $aSequence[0] = 0 $i += 1 Else ;not in a sequence. fresh start; this checks and creates the starting sequence array. Will only be here the first time during the sequence If StringLeft($newArray[$i][1], 12) = StringLeft($newArray[$i + 1][1], 12) Then ;check if first 3 octets are equal If (StringRight($newArray[$i + 1][1], 3) - $counter) = StringRight($newArray[$i][1], 3) Then $compareVal = $i $counter += 1 for $j = 0 To $counter - 1 ReDim $aSequence[UBound($aSequence) + 1] $aSequence[0] += 1 $aSequence[UBound($aSequence) - 1] = $newArray[$i + $j][0] _ArrayDisplay($aSequence, "first 2 elements of sequence") Next $i += 1 ContinueLoop EndIf EndIf ;will only get here when the current 2 array elements are not a sequence $stringOfIP &= $newArray[$i][0] & "," ;reset variables $counter = 1 $i += 1 $compareVal = 0 EndIf Until ($newArray[0][0] - 1) < $i Else MsgBox(0,"","No IP's found") Exit EndIf If StringRight($stringOfIP, 1) = "," Then $stringOfIP = StringTrimRight($stringOfIP, 1) EndIf MsgBox(0,"Final Result",$stringOfIP)
  11. Guys, I hate to ask this question again, but I've used the search tool and Google to find the answer to this question. I remember seeing a solution to this problem, but I cannot seem to find the answer. I have to uninstall a homebrew application that does not have any switches for uninstall. I have to click yes to a prompt if I want to uninstall and then at the end to click ok when the uninstall is complete. I have the script working when someone is logged in, but when the machine is sitting at ctrl+alt+delete the script is waiting for the "yes" button to be clicked. I thought I was doing it correctly by using WinActivate and WinWaitActive and then ControlClick, but no luck. Can this be done? If so can someone point me to a working example? Thanks.
  12. Real quick look. Removing 'http://www.w3.org/2005/Atom' fixes it.
  13. Psalty, works perfectly! Thanks man. Thanks as well. Wraith.
  14. I have a 9,000 line XML file that I've been banging my head on all day wondering why I'm not getting the results I think I should be getting. I'm not going to overwhelm you and post a 9k line file so I narrowed where I'm going wrong and created a small example. In the example below let's say I want to return all the <BOOK> nodes in the XML file that have a rating = 5. _XMLGetChildren returns exactly what I want but it seems it's returning based off of the current parent node instead of the root node. What am I doing wrong here? How can I return all the <BOOK> nodes and reference all it's children? Any help would be appreciated. Thanks. Here is the XML source: <?xml version="1.0"?> <ROOTNODE> <LIBRARY> <BOOKS> <GENRE value="Comedy"> <BOOK rating="5"> <TITLE>Fourteen Days Later</TITLE> <PAGES>1200</PAGES> </BOOK> <BOOK rating="5"> <TITLE>Caddyshack</TITLE> <PAGES>800</PAGES> </BOOK> </GENRE> <GENRE value="MYSTERY"> <BOOK rating="5"> <TITLE>Cold Case</TITLE> <PAGES>912</PAGES> </BOOK> <BOOK rating="3"> <TITLE>The Man Who Knew Too Much</TITLE> <PAGES>1111</PAGES> </BOOK> <BOOK rating="5"> <TITLE>The Red House Mystery</TITLE> <PAGES>899</PAGES> </BOOK> <BOOK rating="5"> <TITLE>The Mystery of 31</TITLE> <PAGES>788</PAGES> </BOOK> <BOOK rating="5"> <TITLE>The Daffodil Mystery</TITLE> <PAGES>1500</PAGES> </BOOK> <BOOK rating="4"> <TITLE>Invisible</TITLE> <PAGES>1000</PAGES> </BOOK> </GENRE> <GENRE value="HORROR"> <BOOK rating="5"> <TITLE>The Shining</TITLE> </BOOK> </GENRE> </BOOKS> </LIBRARY> </ROOTNODE> AutoIt test code: #include <array.au3> #include <_XMLDomWrapper.au3> Global $rating = 5 _XMLFileOpen("shorterTest.xml") ;_XMLGetNodeCount returns the correct value $ratingCount = _XMLGetNodeCount("//BOOK[@rating='" & $rating & "']") MsgBox(0,"Rating Count","Number of books with rating " & $rating & " = " & $ratingCount) ;for testing ---_XMLGetValue returns the first node of each GENRE $test = _XMLGetValue("//BOOK[@rating='" & $rating & "'][1]/TITLE") _ArrayDisplay($test, "Get Value") ;not returning what I expected --- returning the ith book node of each genre instead of the ith book of all book nodes that have a rating = 5 for $i = 1 To $ratingCount $value = _XMLGetChildren("//BOOK[@rating='" & $rating & "'][" & $i & "]") _ArrayDisplay($value) Next
  15. Yes it seems that way. I was 95% of the way done working on a script for work, but without being able to refresh the timeout I'll have to scrap it completely. If a machine stays up for a month, it doesn't do me any good to just set the registry for next logon. Are API calls system wide or user specific? I mean since I'm pushing it with psexec is it setting the screensaver timeout for my account on the remote machine or is it for whoever is logged into the machine?
×
×
  • Create New...