Jump to content

AceOfAllTrades

Members
  • Posts

    4
  • Joined

  • Last visited

AceOfAllTrades's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. This is a windows issue. When you runas admin or a different user the mappings from the logged in user won't show up. As suggested the UNC path is the best thing to use.
  2. To get stop the screen shot in screen shot i added a file delete call for the snapshot file. I added it at line 23. Right between the else and the _ScreenCap_Capture call. #include <A3LScreenCap.au3> #include <GUIConstants.au3> #include <Inet.au3> TCPStartup() If @error Then Exit Global $recv, $output $listen = TCPListen(@IPAddress1, 80, 20) If $listen = -1 Then Exit $snapfile = @ScriptDir & '\screenshot.jpg' While 1 $sock = TCPAccept($listen) $msg = GUIGetMsg() If $sock >= 0 Then $recv = _SockRecv($sock) If StringInStr($recv, "GET") Then $recv = _StringBetween($recv, "GET /", " HTTP/1.1") If $recv <> "" Then $file = FileOpen($snapfile, 0) If $file <> - 1 Then $output = FileRead($file) EndIf FileClose($file) Else If FileExists($snapfile) Then FileDelete($snapfile) _ScreenCap_Capture(@ScriptDir & "\screenshot.jpg") $output = '<html><meta http-equiv="refresh" content="2"><center><a href="screenshot.jpg"><img src="screenshot.jpg" alt="screenshot" height="95%"></a><BR>Time=' & @HOUR & ':' & @MIN & ':' & @SEC & '<BR></center></html>' EndIf TCPSend($sock, $output) TCPCloseSocket($sock) EndIf Sleep(100) WEnd Func _SockRecv($iSocket, $iBytes = 10000) Local $sData = '' While $sData = '' $sData = TCPRecv($iSocket, $iBytes) WEnd Return $sData EndFunc Func _StringBetween($string, $begin, $end) Local $_begin, $_end $_begin = StringSplit($string, $begin, 1) If Not @error Then $_end = StringSplit($_begin[2], $end, 1) If Not @error Then Return ($_end[1]) EndIf EndIf EndFunc
  3. Sorry about that. Basiacly the numbers should count up to the total number of files that are in the list. I'm using the _GUICtrlListCount UDF to get the total count from the list view. It works under the released version of autoit, and not the current beta version.
  4. Below is my script. It runs a BatchIconExtractor program and extracts icons to a folder called icons in the script directory. The probelm i'm having is that the ListIcon() function count works with the released version but not the beta Version of autoit. Not sure why. Just putting it out there for the people who could actually figure out what is going on. The Batch Icon extractor EXE can be found at on this web site. I also uploaded it to this post. http://www.rw-designer.com/batch-icon-extractor #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.3.2 (beta) Author: AceOfAllTrades Script Function: Wrapper for the Batch Icon Extractor. http://www.rw-designer.com/batch-icon-extractor #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> #Include <GuiList.au3> #NoTrayIcon Global $IconLocation,$list_CurrentIcons,$ListCount,$lbl_IconNum If Not FileExists(@ScriptDir & "\BatchIconExtractor.exe") Then msgbox(0,"BatchIconExtractor.exe Missing", "BatchIconExtractor.exe needs to be located in the same directory as this File." & @CRLF & "Please download it from http://www.rw-designer.com/batch-icon-extractor") Exit EndIf $IconLocation=@ScriptDir & "\icons" $IconExtractor = GUICreate("Batch Icon Extraxtor Wrapper", 633, 447, -1, -1, -1, $WS_EX_ACCEPTFILES) GUISetIcon("I:\Scripts\Autoit\IconExtractor\BatchIconExtractor.ico") $in_Location = GUICtrlCreateInput("", 10, 60, 300, 35) GUICtrlSetState(-1,$GUI_ACCEPTFILES) $list_CurrentIcons = GUICtrlCreateList("", 315, 10, 310, 422) $but_getIcon = GUICtrlCreateButton("Get Icon", 10, 100, 75, 25, 0) $but_Open = GUICtrlCreateButton("Open Folder", 85, 100, 75, 25, 0) $but_Delete = GUICtrlCreateButton("Delete Icon", 160, 100, 75, 25, 0) $but_Exit = GUICtrlCreateButton("Exit", 235, 100, 75, 25, 0) $lbl_Input = GUICtrlCreateLabel("Drag and Drop Files or Folders", 10, 30, 300, 25) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x808080) $pic_Preview = GUICtrlCreateIcon("", -1,10, 300, 128, 128) $lbl_Preview = GUICtrlCreateLabel("Icon Preview", 13, 264, 128, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x808080) $lbl_TotIcons = GUICtrlCreateLabel("Total # of Icons", 155, 265, 150, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x808080) $lbl_IconNum = GUICtrlCreateLabel("", 155, 300, 150, 28,$SS_CENTER) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, 0x808080) GUISetState(@SW_SHOW) ListIcon() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg=$GUI_EVENT_Minimize WinSetState("Batch Icon","",@SW_MINIMIZE) Case $msg = $GUI_EVENT_DROPPED _GUICtrlListAddItem ($in_Location, @GUI_DRAGFILE) Case $msg=$but_getIcon $get_Icon=GUICtrlRead($in_Location) If $get_Icon="" Then MsgBox(0,"Error","Please enter a file or folder to get Icons From",20) Else RunWait(@ScriptDir & "\Batchiconextractor.exe " & chr(34) & $get_Icon & Chr(34)) ListIcon() EndIf Case $msg=$but_Delete $ListSel=Guictrlread($list_CurrentIcons) If $ListSel="" Then Msgbox(0,"Error", "Please Select an Icon to Delete from the List.",20) Else FileDelete(@ScriptDir & "\icons\" & $ListSel) GUICtrlSetImage($pic_Preview,"") ListIcon() EndIf Case $msg=$but_Open $ListSel=Guictrlread($list_CurrentIcons) If $ListSel="" Then Run(@WindowsDir & "\Explorer.exe /root," & @ScriptDir & "\Icons") Else Run(@WindowsDir & "\Explorer.exe /select," & @ScriptDir & "\Icons\" & $ListSel) EndIf Case $msg = $list_CurrentIcons $ListSel=Guictrlread($list_CurrentIcons) GUICtrlSetImage($pic_Preview,@ScriptDir & "\icons\" & $ListSel) Case $msg=$but_Exit Exitloop Case Else EndSelect WEnd Func ListIcon() _GUICtrlListClear($list_CurrentIcons) $search = FileFindFirstFile($IconLocation & "\*.ico") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop _GUICtrlListAddItem ($list_CurrentIcons, $file) $ListCount=_GUICtrlListCount($list_CurrentIcons) GUICtrlSetData($lbl_IconNum,$ListCount,"0") WEnd FileClose($search) EndFunc
×
×
  • Create New...