;Version=4.7.8.0 ;This needs to be in the 1st line - don't touch! #SingleInstance FORCE SetWorkingDir %A_ScriptDir% SetBatchLines, -1 SetKeyDelay, 0 OnMessage( 6, "WM_ACTIVATE" ) OnMessage(0x219, "Removable_Drive") DriveGet, DriveList, list, REMOVABLE MainWndX = X_%A_ScriptName% ;; ID of 320 MPH Screen id320 = -1 ;___________________________________________ Process, Priority,, High CurrentVersion := myGetVersion(A_ScriptFullPath) iconBasic = 23 ;23 269 57 172 210 iconScanning = 172 ;46 56 172 219 271 iconPause = 110 ;21 110 240 266 Menu, Tray, Icon, Shell32.dll, %iconBasic% Menu, Tray, Tip, %MainWndX% %CurrentVersion% Menu, Tray, Click, 1 skin_IniFile = skins320.ini GoSub,makeMenus If not A_IsCompiled SetTimer,UPDATEDSCRIPT,1000 SetTimer,CheckWin,500 ;IndexDir = %A_Temp%\my320MPH_index IndexDir = %A_AppData%\my320MPH\Index IfNotExist,%IndexDir% FileCreateDir,%IndexDir% IniFile = 320MPHX.ini IniGui_IniFile := IniFile IfNotExist, %IniFile% GoSub, WriteIni ;DEFAULTS are set in ReadIni GoSub, ReadIni If ListFile FileMove,%A_ScriptDir%\*%ListFile%,%IndexDir%,1 IndexFile = %IndexDir%\%ListFile% FastScanList_orig := FastScanList FastScanList := ExpandVars(FastScanList) PathListX := ExpandVars(PathList) OpenFolderWithX := ExpandVars(OpenFolderWith) ExtraTxtFile := ExpandVars(ExtraTxtFile) szml = 0 ; IndexN%szml% = Full Index ; IndexF%szml% = %IndexDir%\%ListFile% ;Setting Plugins IndexN%szml% = Start IndexF%szml% = %IndexDir%\Start_%ListFile% szml++ IndexN%szml% = Docs IndexF%szml% = %IndexDir%\MyDoc_%ListFile% szml++ IndexN%szml% = FireFox IndexF%szml% = %IndexDir%\FF_%ListFile% szml++ IndexN%szml% = Exe's IndexF%szml% = %IndexDir%\Exe_%ListFile% szml++ IndexN%szml% = Dirs IndexF%szml% = %IndexDir%\Dirs_%ListFile% szml++ IndexN%szml% = Full Index IndexF%szml% = %IndexDir%\%ListFile% IndexFile := IndexF0 ;------------myCheckUpdate------------------------------------ CheckUpdate_URL = http://fures.hu/my_ahk_updates/%A_ScriptName% CheckUpdate__Lang = en ;hu en (default=en) CheckUpdate_Silent = 0 SetTimer, CheckUpdateOnce, % 150*1000 SetTimer, CheckUpdate, % 12*60*60*1000 ;12hours SetTimer, iLogUsage, -60000 ;------------------------------------------------------------- Start320: If A_IsCompiled { If ShellIntegration { RegWrite, REG_SZ, HKCR, *\Shell\320MPH\Command,, "%A_ScriptFullPath%" "`%1" RegWrite, REG_SZ, HKCR, Folder\shell\320MPH\command,, "%A_ScriptFullPath%" "`%1" } Else { RegDelete, HKCR, *\Shell\320MPH, RegDelete, HKCR, Folder\Shell\320MPH, } } ;RParam = %1% ;create scanned result list on first run IfNotExist, %IndexDir%\%ListFile% { myshow("Please wait...","First time scanning your files","TT",0,0) AgressiveScan = 1 GoSub, ButtonScan AgressiveScan = myshow("OFF") } myshow("Please wait...","Scanning Recent","TT",0,0) GoSub, RecentScanNow myshow("OFF") ;Check scan date GoSub, CheckScanDate ;;JWJ - Avoids drawing GUI again if id320 <> -1 ;not the 1st run Return ;--------------Make Gui---------------------------- LVGuiW := 263 ;GuiW - 12 GuiMargin := 25 GuiH := 575 WinGetPos tbX, tbY, tbWidth, tbHeight, ahk_class Shell_TrayWnd IfEqual,tbY,0 { WinTrayPos = up } else { WinTrayPos = down } GuiW := LVGuiW + (GuiMargin * 2) ;275 volt, 10 115 - 232 645 LVGuiH := GuiH - 2*GuiMargin - 48 - 20 - 20 + 10 -20 StatusY := GuiH - GuiMargin +10 - 20 Status2Y := GuiH - GuiMargin +10 - 20 - 20 FEditX := GuiW - GuiMargin - 150 IconSize := 1 If not GuiTrans GuiTrans = 180 GuiTextC = CBlack If (GuiColor < "444444" or GuiColor = "black") GuiTextC = CWhite ListTextC = CBlack If (ListColor < "444444" or ListColor = "black") ListTextC = CWhite Gui, -Caption -Border +LastFound +ToolWindow Gui +LastFound ; Make the GUI window the last found window for use by the line below. id320 := WinExist() If GuiBGpicture Gui, Add, Picture, x0 y0, %GuiBGpicture% SearchTabs = %IndexN0% Loop,%szml% SearchTabs := SearchTabs "|" IndexN%A_Index% ; Gui, Add, Tab, x%GuiMargin% y71 w%LVGuiW% h20 Choose1 AltSubmit gChangeIndexFile vSearchTab -Wrap 0x40 +Background +Theme -Buttons,%SearchTabs% Gui, Add, Tab, x%GuiMargin% y71 w%LVGuiW% h20 Choose1 AltSubmit gChangeIndexFile vSearchTab -Wrap +Theme -Background,%SearchTabs% gui, font, normal gui, font, %GuiTextC% Gui, Color, %GuiColor% If TransWin { Gui, Color, 000001 WinSet, TransColor, 000001 } Gui, Tab, gui, font, s10 %GuiTextC%, %GuiFont% Gui, Add, Text, % "x" GuiMargin " y" GuiMargin-10 " vSearchTxt", Search: Gui, Add, Edit, % "x+15 y" GuiMargin-10 " w200 CBlack vCurrText gGetText", gui, font, s9 %GuiTextC%, %GuiFont% ;col = CC5500 ;CreateBMPGradient(A_Temp "\" col ".bmp", ColorName2RGB(col), ColorRGB_Mod(ColorName2RGB(col),70), 1) ;Gui, Add, Picture,% "x" GuiMargin " y+50 +0x8000 w" LVGuiW " h" LVGuiH, % A_Temp "\" col ".bmp" Gui, Add, ListView, Tile x%GuiMargin% y+50 w%LVGuiW% h%LVGuiH% vSelItem gSelection AltSubmit -Hdr Background%ListColor% %ListTextC%, Name|Ext|Folder ; Gui, Add, ListView, Tile x%GuiMargin% yp w%LVGuiW% h%LVGuiH% vSelItem gSelection AltSubmit -Hdr BackgroundTrans %ListTextC%, Name|Ext|Folder Gui, Font gui, font, %GuiTextC% ;this line prevents theme on bottom CheckBox buttons - but ok. Gui, Add, Button,x0 y0 w0 h0 Gui, Add, Text, % "x" GuiMargin+0 " y" GuiMargin+10 " w60 h28 vResults", ; Gui, Add, CheckBox, % "x" FEditX+72 " y" StatusY " vFindInPath w78 0x1000 h19", &Find in Path ; Gui, Add, CheckBox, % "x" FEditX+72 " y" Status2Y " vShowTTip w78 0x1000 h19", Show &Tooltip Gui, Add, CheckBox, % "x" FEditX+72 " y" StatusY " vFindInPath w78 h19", &Find in Path Gui, Add, CheckBox, % "x" FEditX+72 " y" Status2Y " vShowTTip w78 h19", &Tooltip Gui, Add, Picture, % "X" GuiW " Y" GuiMargin+65 " W200 H480", %Pth% Gui, Add, Text, x%GuiMargin% y%Status2Y%, Max result&s: Gui, Add, Edit, x+0 y%Status2Y% w25 h16 CBlack vMaxIt gGetText, %MaxItems% ; Gui, Add, CheckBox, % "x" GuiMargin+92 " y" StatusY " w90 h19 vShowBigViewCtrl gChangeView 0x1000", Change &View Gui, Add, CheckBox, % "x" GuiMargin+92 " y" StatusY " w90 h19 vShowBigViewCtrl gChangeView", Change &View ;Gui, Add, Text, % "X" GuiW " Y" GuiMargin+45 " w0 h0" ;placeholder for the picture preview data-text ButtonTheme := " +Theme" Gui, Add, Button, % "x" GuiMargin+61 " y" GuiMargin-10+30 " w50 h22 gButtonOpen Default" ButtonTheme, &Open Gui, Add, Button, % "x+5" " y" " h22 gButtonDir" ButtonTheme, &Dir Open Gui, Add, Button, % "x+5" " y" " h22 gButtonDirTg" ButtonTheme, Target-Dir Open Gui, Add, Button, % "x+" GuiMargin " y" " h22 gGoogle" ButtonTheme, &Google Search Gui, Add, Button, % "x+5" " y" " h22 gWikipedia" ButtonTheme, &Wikipedia ; Gui, Add, CheckBox, % "x" GuiMargin+92 " y" Status2Y " gAltIndexFile w90 0x1000 h19", &Network Search Gui, Add, CheckBox, % "x" GuiMargin+92 " y" Status2Y " vAltNetInd gAltIndexFile w90 h19", &Network ;This is HIDDEN now Gui, Add, Text, % "x" GuiW " y" GuiMargin-10+3+5 " h20 HIDDEN", Run-Params: Gui, Add, Edit, x+5 yp-3 w80 h20 CBlack vRParam HIDDEN, %RParam% Gui, Add, Text, % "x" GuiW " y" Status2Y " w600 h28 vStatus", Gui, Add, Text, % "xp" " yp+20" " w600 h28 vStatus2", ;pwb := IE_Add(mgH, GuiW, GuiMargin+40, 200, 200) TWChk = If TransWin TWChk = Checked Gui, Add, CheckBox, % "x" GuiMargin+0 " y" StatusY " w90 h19 vTransWin gTransWinToggle " TWChk, Trans&parency Gui, Add, Text, x0 y0 w%GuiW% h%GuiH% cFFFFFF Backgroundtrans +0x200 gGuiMove vMOVER ;this is the grabber control - hold and move with mouse Gui, Add, Text, x470 y15 vStatus3 h30 w153 Right,Ver: %CurrentVersion% Gui, Add, Text, % "x" GuiW " y" GuiMargin-10+3+5 " h20", "rec"=>Recent "dir"=>Folders LV_ModifyCol (1, 210) ;100 ;MsgBox,%GuiX% - %GuiY% Gui, Show, h%GuiH% w%GuiW% x%GuiX% y%GuiY%, %MainWndX% WinGetPos, GuiX, GuiY,,,ahk_id %id320% ;GuiControl, Move, SearchTab, w1200 ;GuiControl, +forced, SearchTab ;GuiControl, -Wrap, SearchTab ;GuiControl, +BackgroundTrans, SearchTab ;GuiControl, +Buttons, SearchTab ;GuiControl, -BackgroundRed , SearchTab If FindInPath Control,Check,,Button2,ahk_id %id320% If ShowTTip Control,Check,,Button3,ahk_id %id320% ControlFocus, Edit1, ahk_id %id320% ; Gui, 2:+lastfound ; mgHIE := WinExist() ; pwb := IE_Add(mgHIE, 0, 0, 400, 300) ; Gui, 2:Show, NoActivate Hide x10 y50 w400 h300, Preview IE GoSub, setHotkeys GoSub, ChangeIndexFile LastText = fadsfSDFDFasdFdfsadfsadFDSFDf If ShowBigView { GuiControl,, ShowBigViewCtrl,1 GoSub, ChangeView } else GoSub, ShowNetworkSplash GoSub, GetText GoSub, DoScan Return ;______END of AUTOEXECUTE section______________________ ;----------------HOTKEYS---------------------- setHotkeys: If not HotkeyMain { MsgBox,0,No main hotkey!,There's no main hotkey defined.,10 HotkeyMain:=myGetHotkey33(HotkeyMain) If not HotkeyMain { MsgBox,0,No main hotkey!,There's no main hotkey defined.`nThe program will exit now.,10 ExitApp } IniWrite, %HotkeyMain%, %IniFile%, Display, HotkeyMain } ; HotkeyMain = #a ; HotkeyMain = CapsLock & a ; HotkeyMainSecondary = ~space & a ; HotkeyShow = !d ; HotkeyExit = !^d Hotkey,IfWinActive,ahk_id %id320% Hotkey,%HotkeyMain%,Hide320 ;Hotkey,%HotkeyMainSecondary%,Hide320 Hotkey,Left,ChangeIndexFile Hotkey,Right,ChangeIndexFile Hotkey,Up,KeyHandler Hotkey,Down,KeyHandler Hotkey,PgUp,KeyHandler Hotkey,PgDn,KeyHandler Hotkey,Home,KeyHandler Hotkey,End,KeyHandler Hotkey,~BackSpace,HKCollect Hotkey,~Del,HKCollect ;Hotkey,~Left,HKCollect ;Hotkey,~Right,HKCollect Hotkey,AppsKey,GuiContextMenu Hotkey,!f,toggleAltF Hotkey,!s,toggleAltS Hotkey,!t,toggleAltT Hotkey,!v,toggleAltV Hotkey,!n,toggleAltN Hotkey,!p,toggleAltP Hotkey,^Del,MenuDel Hotkey,IfWinNotActive,ahk_id %id320% Hotkey,%HotkeyMain%,Show320 ;Hotkey,%HotkeyMainSecondary%,Show320 ; Hotkey,%HotkeyShow%,Show320 Hotkey,IfWinActive Hotkey,esc,EscHandler ;Activates/deactivates in GetText ; Hotkey,%HotkeyExit%,GuiClose Return KeyHandler: ControlGetFocus, CurrCtrl, ahk_id %id320% IfEqual, CurrCtrl, Edit1 ControlSend, SysListView321, {%A_ThisHotkey%}, ahk_id %id320% else send, {%A_ThisHotkey%} GoSub,HKCollect Return HKCollect: ThisHK = %A_ThisHotkey% Return GuiContextMenu: ; Launched in response to a right-click or press of the Apps key. Menu, MyContextMenu, Show , %A_GuiX%, %A_GuiY% Return toggleAltF: ;Alt-F Toggle FindInPath checkbox ControlClick, Button2, ahk_id %id320% ControlGet, FindInPath, Checked,, Button2, ahk_id %id320% IniWrite, %FindInPath%, %IniFile%, Display, FindInPath ControlFocus, Edit1, ahk_id %id320% GoTo, GetText Return toggleAltS: ;Alt-S Edit MaxItems ControlGetFocus, curFoc, ahk_id %id320% IfEqual, curFoc, Edit2 { ControlFocus, Edit1, ahk_id %id320% GoTo, GetText } else { ControlFocus, Edit2, ahk_id %id320% Send, {Control Down}a{Control Up} } Return toggleAltT: ;Alt-T Toggle ShowTTip checkbox IfWinNotActive, ahk_id %id320% Return ControlClick, Button3, ahk_id %id320% ControlGet, ShowTTip, Checked,, Button3, ahk_id %id320% IniWrite, %ShowTTip%, %IniFile%, Display, ShowTTip if !ShowTTip Tooltip ControlFocus, Edit1, ahk_id %id320% GoTo, GetText Return toggleAltV: ;view ChangeView_Menu: If ShowBigView GuiControl,,ShowBigViewCtrl,0 else GuiControl,,ShowBigViewCtrl,1 GoSub,ChangeView Return toggleAltN: ;network If AltNetInd GuiControl,,AltNetInd,0 else GuiControl,,AltNetInd,1 GoSub,AltIndexFile Return toggleAltP: ;transparency If TransWin GuiControl,,TransWin,0 else GuiControl,,TransWin,1 GoSub,TransWinToggle Return EscHandler: StopSearchNow = 1 Return ;----------------end HOTKEYS---------------------- CheckWin: WinGetTitle,thiswintitle,A WinGetClass,thiswinclass,A If thiswinclass not in CabinetWClass,MozillaUIWindowClass If thiswintitle contains Warcraft,Sims,Revolt,metin { Suspend,On SuspendIsOn = 1 } else { Suspend,Off SuspendIsOn = } else { Suspend,Off SuspendIsOn = } Return ReadIni: ;;SplashImage design attribs: xhely := A_ScreenWidth-400 yhely := 30 Spl_Design = y%yhely% x%xhely% w150 M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM7 FS7 WM600 WS400 Spl_Design2 = y%yhely% x%xhely% M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM11 FS11 WM600 WS400 Spl_Design3 = y%yhely% x%xhely% w200 M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM7 FS7 WM600 WS400 GoSub, IniGui_Load ;defaults for new ini items If not ListColor ListColor = "000011" If not ExtraTxtFile ExtraTxtFile = %A_Desktop%\MyTxtFile.txt If not MaxTxtItems MaxTxtItems = 10 If not ScanUSB ScanUSB = 1 If not WaitIdleSecBeforeScanning WaitIdleSecBeforeScanning = 300 Return WriteIni: ;Creating ini File - if not any Loop, 10 { Sleep, 500 FileDelete, %IniFile% If not ERRORLEVEL Break } FileAppend, ( [Scanning] PathList=`%A_MyDocuments`%|`%A_StartMenuCommon`%|`%A_StartMenu`%|`%A_Desktop`%|`%UserProfile`%\Favorites|`%UserProfile`%\Recent|`%AppData`%\Microsoft\Internet Explorer\Quick Launch ;List of paths to scan when doing full-scan ;Default=`%A_MyDocuments`%|`%A_StartMenuCommon`%|`%A_StartMenu`%|`%A_Desktop`%|`%UserProfile`%\Favorites|`%UserProfile`%\Recent|`%AppData`%\Microsoft\Internet Explorer\Quick Launch|`%A_ProgramFiles`% ScanPeriod=12 ;in hours. Full-Scan in background every X hours. WaitIdleSecBeforeScanning=300 ;in seconds. Wait X sec. idle time (no user actions) before starting scanning. ;Default=300 FastScanList=`%A_StartMenuCommon`%|`%A_StartMenu`%|`%A_Desktop`%|`%UserProfile`%\Favorites|`%UserProfile`%\Recent|`%AppData`%\Microsoft\Internet Explorer\Quick Launch ;List of paths to scan when doing fast-scan ;Default=`%A_StartMenuCommon`%|`%A_StartMenu`%|`%A_Desktop`%|`%UserProfile`%\Favorites|`%UserProfile`%\Recent|`%AppData`%\Microsoft\Internet Explorer\Quick Launch FastScanPeriod=30 ;in minutes. Fast-Scan in background every X minutes. TypeList=exe|lnk|ahk|doc|xls|ppt|pdf|dot|xlt|pot|jpg|jpeg|tif|ico|wmf|emf|exif|ani|cur|mpg|mpeg|avi|mov|wmv|asf|url|dir ;List of extensions to scan for ;Default=exe|lnk|ahk|doc|xls|ppt|pdf|dot|xlt|pot|jpg|jpeg|tif|ico|wmf|emf|exif|ani|cur|mpg|mpeg|avi|mov|wmv|asf|url|txt|ini|log|gif|png|dir ;Use dir for scanning folders ;Use *** for scanning any extension (might be time consuming to scan!) ExcludeList=about|history|readme|remove|unins|license ;Default=about|history|readme|remove|unins|license ;Strings to exclude from scanning IncludeList=mustreadme|readmeanyway ;Default=mustreadme|readmeanyway|zsoft ;Strings to still include, even if in exclude list ;Example: All "uninst" are excluded, but ZSoft Uninstaller is still in ScanFirefox=1 ;Do you want to scan Firefox Bookmarks? ;Type=boolean ScanUSB=1 ;Do you want to scan USB drives when you plug it in? ;Type=boolean ScanPause=5 ;A running scan will pause for this many seconds when you use your computer ListFile=RunList.lst ;Default=RunList.lst ;Name of the main index file ExtraTxtFile=%A_Desktop%\MyTxtFile.txt ;Default=%A_Desktop%\MyTxtFile.txt ;Name of the extra txt file for content-indexing [Display] HotkeyMain=#a ;The main hotkey to show/hide the search window. ;Default=#a ShowIcons=1 ;Show icons in the list ;Type=boolean FindInPath=0 ;To search also in the path of files ;Otherwise, it only searches the file name ;Type=boolean ;Default=0 ShowTTip=0 ;To show tooltip with detailed file info under the main window ;Type=boolean ShowBigView=0 ;Type=boolean ;To use the extended view of the main window GuiFont=Tahoma ;Default=Trebushet MS Bold ;Font to be used in the main window in case of small view ListColor=000022 ;Default=000022 ;Background color of the result list GuiColor=000011 ;Default=000011 ;Background color of the main window TransWin=1 ;Start with Background transparency ;Type=boolean ;Default=1 GuiTrans=180 ;Default=180 ;Background transparency of the main window MaxItems=25 ;Maximum number of search items to find MaxTxtItems=25 ;Maximum number of search items to find in the ExtraTxtFile GuiX= ;X coordinate of the gui window - leave it blank to make it center on the screen GuiY= ;Y coordinate of the gui window - leave it blank to make it center on the screen [Advanced] OpenFolderWith=Explorer ;Default=Explorer ;What program do you want to use to open folders of searched items MaxLastUsed=25 ;Maximum number of opened items to store in order to show when no search text is entered WaitTime=200 ;Default=200 ;Milliseconds to wait for key strokes before search starts when you enter search text MinLen=2 ;Default=2 ;Minimum characters before search starts ShellIntegration=0 ;Default=No ;Type=boolean ;Works only if compiled to exe! ;Shell Integration adds this script to all files' context menu, so that you can launch a file with any application selected in the script. SilentProgramUpdate=1 ;Default=Yes ;Type=boolean ;Program updates are installed silently - without user interaction. UsedList=| ;DON'T EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING ;This contains the last opened items ),%IniFile% Reload Return ReWriteIni: ;ReWriting ini File Loop, 10 { Sleep, 500 FileDelete, %IniFile% If not ERRORLEVEL Break } StringReplace,TypeList,TypeList,`,,|,All StringReplace,ExcludeList,ExcludeList,`,,|,All StringReplace,IncludeList,IncludeList,`,,|,All FileAppend, ( [Scanning] PathList=%PathList% ;List of paths to scan when doing full-scan ;Default=`%A_MyDocuments`%|`%A_StartMenuCommon`%|`%A_StartMenu`%|`%A_Desktop`%|`%UserProfile`%\Favorites|`%UserProfile`%\Recent|`%AppData`%\Microsoft\Internet Explorer\Quick Launch|`%A_ProgramFiles`% ScanPeriod=%ScanPeriod% ;in hours. Full-Scan in background every X hours. WaitIdleSecBeforeScanning=%WaitIdleSecBeforeScanning% ;in seconds. Wait X sec. idle time (no user actions) before starting scanning. ;Default=300 FastScanList=%FastScanList_orig% ;List of paths to scan when doing fast-scan ;Default=`%A_StartMenuCommon`%|`%A_StartMenu`%|`%A_Desktop`%|`%UserProfile`%\Favorites|`%UserProfile`%\Recent|`%AppData`%\Microsoft\Internet Explorer\Quick Launch FastScanPeriod=%FastScanPeriod% ;in minutes. Fast-Scan in background every X minutes. TypeList=%TypeList% ;List of extensions to scan for ;Default=exe|lnk|ahk|doc|xls|ppt|pdf|dot|xlt|pot|jpg|jpeg|tif|ico|wmf|emf|exif|ani|cur|mpg|mpeg|avi|mov|wmv|asf|url|txt|ini|log|gif|png|dir ;Use dir for scanning folders ;Use *** for scanning any extension (might be time consuming to scan!) ExcludeList=%ExcludeList% ;Default=about|history|readme|remove|unins|license ;Strings to exclude from scanning IncludeList=%IncludeList% ;Default=mustreadme|readmeanyway|zsoft ;Strings to still include, even if in exclude list ;Example: All "uninst" are excluded, but ZSoft Uninstaller is still in ScanFirefox=%ScanFirefox% ;Do you want to scan Firefox Bookmarks? ;Type=boolean ScanUSB=%ScanUSB% ;Do you want to scan USB drives when you plug it in? ;Type=boolean ScanPause=%ScanPause% ;A running scan will pause for this many seconds when you use your computer ListFile=%ListFile% ;Default=RunList.lst ;Name of the main index file ExtraTxtFile=%ExtraTxtFile% ;Default=%A_Desktop%\MyTxtFile.txt ;Name of the extra txt file for content-indexing [Display] HotkeyMain=%HotkeyMain% ;The main hotkey to show/hide the search window. ;Default=#a ShowIcons=%ShowIcons% ;Show icons in the list ;Type=boolean FindInPath=%FindInPath% ;To search also in the path of files ;Otherwise, it only searches the file name ;Type=boolean ;Default=0 ShowTTip=%ShowTTip% ;To show tooltip with detailed file info under the main window ;Type=boolean ShowBigView=%ShowBigView% ;Type=boolean ;To use the extended view of the main window GuiFont=%GuiFont% ;Default=Trebushet MS Bold ;Font to be used in the main window in case of small view ListColor=%ListColor% ;Default=000022 ;Background color of the result list GuiColor=%GuiColor% ;Default=000011 ;Background color of the main window TransWin=%TransWin% ;Start with Background transparency ;Type=boolean ;Default=1 GuiTrans=%GuiTrans% ;Default=180 ;Background transparency of the main window MaxItems=%MaxItems% ;Maximum number of search items to find MaxTxtItems=%MaxTxtItems% ;Maximum number of search items to find in the ExtraTxtFile GuiX=%GuiX% ;X coordinate of the gui window - leave it blank to make it center on the screen GuiY=%GuiY% ;Y coordinate of the gui window - leave it blank to make it center on the screen [Advanced] OpenFolderWith=%OpenFolderWith% ;Default=Explorer ;What program do you want to use to open folders of searched items MaxLastUsed=%MaxLastUsed% ;Maximum number of opened items to store in order to show when no search text is entered WaitTime=%WaitTime% ;Default=200 ;Milliseconds to wait for key strokes before search starts when you enter search text MinLen=%MinLen% ;Default=2 ;Minimum characters before search starts ShellIntegration=%ShellIntegration% ;Default=No ;Type=boolean ;Works only if compiled to exe! ;Shell Integration adds this script to all files' context menu, so that you can launch a file with any application selected in the script. SilentProgramUpdate=%SilentProgramUpdate% ;Default=Yes ;Type=boolean ;Program updates are installed silently - without user interaction. UsedList=%UsedList% ;DON'T EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING ;This contains the last opened items ),%IniFile% Return makeMenus: If menuReady { Menu, MyContextMenu, DeleteAll Menu, Tray, DeleteAll Menu, skins, DeleteAll } GoSub,skinInit Menu, MyContextMenu, Add, Open`tEnter, ButtonOpen Menu, MyContextMenu, Add, Open containing folder`tShift-Enter, ButtonDir Menu, MyContextMenu, Add, Open target folder, ButtonDirTg Menu, MyContextMenu, Add, Show file info`tWin-Enter, MenuWin Menu, MyContextMenu, Add, Delete from list`tCtrl-Del, MenuDel Menu, MyContextMenu, Add Menu, MyContextMenu, Add, Full Scan Now! (Scan all folders), ButtonScan Menu, MyContextMenu, Add, Fast-Scan Now!, FastScanNow Menu, MyContextMenu, Add, FireFox Scan Now!, ScanFirefoxNow Menu, MyContextMenu, Add, Scan Network... (Selected drives), ScanNetworkNow Menu, MyContextMenu, Add, Show Scan-Statistics, ScanStat Menu, MyContextMenu, Add Menu, MyContextMenu, Add, Change View, ChangeView_Menu Menu, MyContextMenu, Add Menu, MyContextMenu, Add, Load Skin..., :skins Menu, MyContextMenu, Add, Save Current Design as a Skin..., skinSave Menu, MyContextMenu, Add, Edit Skins (ini file), skinEdit Menu, MyContextMenu, Add Menu, MyContextMenu, Add, Setup Options, MenuSetup Menu, MyContextMenu, Add, Manually edit settings (ini file), MenuIni Menu, MyContextMenu, Add, Restore default settings, WriteIni Menu, MyContextMenu, Add Menu, MyContextMenu, Add, Open Script-Folder, MenuFold Menu, MyContextMenu, Add, Edit this script, MenuEdit Menu, MyContextMenu, Add, Reload this script, MenuRel Menu, MyContextMenu, Add Menu, MyContextMenu, Add, Check program update, CheckUpdateMenu Menu, MyContextMenu, Add, Exit, MenuEx Menu, Tray, NoStandard Menu, Tray, Add, Open Search Window, myShow320 Menu, Tray, Default, Open Search Window Menu, Tray, Add Menu, Tray, Add, Full Scan Now! (Scan all folders), ButtonScan Menu, Tray, Add, Fast-Scan Now!, FastScanNow Menu, Tray, Add, FireFox Scan Now!, ScanFirefoxNow Menu, Tray, Add, Scan network... (Selected drives), ScanNetworkNow Menu, Tray, Add, Show Scan-Statistics, ScanStat Menu, Tray, Add Menu, Tray, Add, Change View, ChangeView_Menu Menu, Tray, Add Menu, Tray, Add, Load Skin..., :skins Menu, Tray, Add, Save Current Design as a Skin..., skinSave Menu, Tray, Add, Edit Skins (ini file), skinEdit Menu, Tray, Add Menu, Tray, Add, Setup Options, MenuSetup Menu, Tray, Add, Manually edit settings (ini-file), MenuIni Menu, Tray, Add, Restore default settings, WriteIni Menu, Tray, Add Menu, Tray, Add, Open Script-Folder, MenuFold Menu, Tray, Add Menu, Tray, Add, Check program update, CheckUpdateMenu Menu, Tray, Add Menu, Tray, Standard menuReady = 1 Return ;---------------GET TEXT---------------------- GetText: ;Critical Hotkey,esc,Off ControlGet, FindInPath, Checked,, Button2, ahk_id %id320% ;A FindInPath checkbox állapota ControlGetText, MaxItems, Edit2, ahk_id %id320% ControlGetText, CurrText, Edit1, ahk_id %id320% IfEqual, CurrText, %LastText% Return StringLen, Check, CurrText IfGreater, Check, 0 IfLess, Check, %MinLen% Return LastText := CurrText StartTime := A_TickCount LastQuery := A_TickCount moreth = ;from last used_____________________________ IfEqual, CurrText, { If ShowIcons { IL_Destroy(ImageListID1) ; Create an ImageList so that the ListView can display some icons: ImageListID1 := IL_Create(10, 10, IconSize) ; Attach the ImageLists to the ListView so that it can later display the icons: LV_SetImageList(ImageListID1) } LV_Delete() Count = StringTrimLeft, UsedList0, UsedList, 1 Loop, Parse, UsedList0, | { ;check for change in search query ControlGetText, CurrText, Edit1, ahk_id %id320% IfNotEqual, CurrText, %LastText%, Goto, GetText ;Firefox cucc feldolg CurrItem1 = CurrItem2 = StringSplit,CurrItem,A_LoopField,¤ If CurrItem2 { FDir = %CurrItem1% FNameNoExt = %CurrItem2% FExt = FFurl FName = %CurrItem2%.%FExt% } else ;firefox feldolg vége { SplitPath, A_LoopField, FName, FDir, FExt, FNameNoExt IfNotExist,%A_LoopField% { ;del from list StringReplace, UsedList, UsedList, |%A_LoopField%,, A IniWrite, %UsedList%, %IniFile%, Advanced, UsedList Continue } } Count ++ IfGreater, Count, %MaxLastUsed%, Break If ShowIcons { IfInString,FDir,:// { IL_Add(ImageListID1,A_ProgramFiles "\Mozilla Firefox\firefox.exe",2) ;FExt := "FFurl" } else IfEqual,FExt,url { IL_Add(ImageListID1,A_ProgramFiles "\Internet Explorer\iexplore.exe",2) } else { hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, A_LoopField, UShortP, iIndex) DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon) DllCall("DestroyIcon", Uint, hIcon) } } LV_Add("Icon" Count, FNameNoExt, FExt, FDir ) } } ;from all items_____________________________ IfNotEqual, CurrText, { If ShowIcons { IL_Destroy(ImageListID1) ; Create an ImageList so that the ListView can display some icons: ImageListID1 := IL_Create(10, 10, IconSize) ; Attach the ImageLists to the ListView so that it can later display the icons: LV_SetImageList(ImageListID1) } LV_Delete() ;___________________________________________ ; Advanced Search MatchPList1 = MatchPList2 = MatchPList3 = Count = 0 Count2 = 0 ln = 0 GuiControl,, Results, Searching... Hotkey,esc,On ;Loop, Parse, ItemList, | Loop, Parse, ItemList, `n, `r { ;check for change in search query If (A_TickCount - LastQuery > 500) { ControlGetText, CurrText, Edit1, ahk_id %id320% LastQuery := A_TickCount } IfNotEqual, CurrText, %LastText%, Goto, GetText If StopSearchNow { StopSearchNow = GuiControl,, Results, Stopped. Hotkey,esc,Off GoTo, GetText } CurrItem = %A_LoopField% ;Firefox cucc feldolg CurrItem1 = CurrItem2 = IfInString,CurrItem,:// { StringSplit,CurrItem,A_LoopField,¤ If CurrItem2 { FDir = %CurrItem1% FNameNoExt = %CurrItem2% FExt = FFurl FName = %CurrItem2%.%FExt% } } else { ;firefox feldolg vége SplitPath, CurrItem, FName, FDir, FExt, FNameNoExt, FDrive ;StringLower,FExt,FExt } ;fuzzy search If FindInPath { CurrItemCorrected = %FDir%\%FNameNoExt% If FExt CurrItemCorrected = %FDir%\%FNameNoExt%.%FExt% } else { CurrItemCorrected := FName } MatchFound = Y Loop, Parse, CurrText, %A_Space% { StringLeft,opst,A_LoopField,1 IfEqual,opst,- { IfEqual,A_LoopField,-dir { CurrAttrib = IfEqual, FExt, lnk { FileGetShortcut, %CurrItem%, TargItem FileGetAttrib,CurrAttrib,%TargItem% } else IfNotEqual,FExt, { FileGetAttrib,CurrAttrib,%CurrItem% } else MatchFound = N IfInString,CurrAttrib,D MatchFound = N } else { StringTrimLeft,Srch,A_LoopField,1 IfInString, CurrItemCorrected, %Srch% MatchFound = N } } else ;not -excludeword { IfEqual,A_LoopField,dir { IfEqual, FExt, lnk { ; FileGetShortcut, %CurrItem%, TargItem ; SplitPath, TargItem, TargFName, TargFDir, TargFExt, TargFNameNoExt, TargFDrive ; IfNotEqual,TargFExt, ; MatchFound = N FileGetShortcut, %CurrItem%, TargItem FileGetAttrib,CurrAttrib,%TargItem% IfNotInString,CurrAttrib,D MatchFound = N } ; else IfNotEqual,FExt, ; MatchFound = N else { FileGetAttrib,CurrAttrib,%CurrItem% IfNotInString,CurrAttrib,D MatchFound = N } } else If A_LoopField in rec,recent { IfNotInString,FDir,\Recent MatchFound = N } else IfNotInString, CurrItemCorrected, %A_LoopField% MatchFound = N } } IfEqual, MatchFound, Y { Count2 ++ IfGreater, Count2, %MaxItems% { moreth := "+" Break } MatchPList2 = %MatchPList2%|%CurrItem% GuiControl,,Results,Searching...`n%Count2% GoSub, AddResultLine Continue } } ;end of loop parse searchlist at line 479 ;Addition search in %ExtraTxtFile% for %CurrText% parsed by space Count3 = 0 Loop, read, %ExtraTxtFile% { CurrItemCorrected := A_LoopReadLine MatchFound = Y Loop, Parse, CurrText, %A_Space% { IfEqual,opst,- { StringTrimLeft,Srch,A_LoopField,1 IfInString, CurrItemCorrected, %Srch% MatchFound = N } else ;not -excludeword { IfNotInString, CurrItemCorrected, %A_LoopField% ;vagy FName helyett CurrItem MatchFound = N } } IfEqual, MatchFound, Y { ;AddResultLine Count2 ++ Count3 ++ IfGreater, Count3, %MaxTxtItems% { moreth := "+" Break } ;DllCall("DestroyIcon", Uint, hIcon) IL_Add(ImageListID1,"Shell32.dll",56) ;or 71 StringReplace,My_LoopReadLine,A_LoopReadLine,%A_Tab%,%A_Space%,all LV_Add("Icon" (Count2), SubStr(My_LoopReadLine,1,30) "...", "Line " A_Index, My_LoopReadLine) LV_ModifyCol() } } ;end of Addition search in %ExtraTxtFile% for %CurrText% parsed by space Hotkey,esc,Off IfEqual, Count, LV_Delete() } ;post results Results := LV_GetCount() . moreth ElapsedTime := (A_TickCount - StartTime)/1000 Fstop := round(ElapsedTime,2) GuiControl,, Results, %Results% results (%Fstop% sec) LV_ModifyCol() ;Check CurrText ControlGetText, CurrText, Edit1, ahk_id %id320% IfNotEqual, CurrText, %LastText%, Goto, GetText ;select first item ;ToolTip, HK=%ThisHK% If ThisHK not in up,down,home,end,pgup,pgdn ControlSend, SysListView321, {Down}, ahk_id %id320% ;Control, Choose, 1, SysListView321, ahk_id %id320% Return AddResultLine: ;working with CurrItem from GetText If ShowIcons { IfInString,FDir,:// ;FireFox FF { IL_Add(ImageListID1,A_ProgramFiles "\Mozilla Firefox\firefox.exe",2) } else If FDrive not in %NetDrives% ;file on unavailable network { IL_Add(ImageListID1,"Shell32.dll",86) ;or 11 } else If (InStr(FileExist(CurrItem), "D")) ;else IfEqual,FExt, ;dir { IfInString,CurrItem,Vezérlőpult Control Panel { hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, CurrItem, UShortP, iIndex) DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon) } else IL_Add(ImageListID1,"explorer.exe",14) } else IfEqual,FExt,url ;IE url { IL_Add(ImageListID1,A_ProgramFiles "\Internet Explorer\iexplore.exe",2) } else ;normal extensions on available drives (C: and online network drives) { FExt_mod := RegExReplace(FExt,"[^a-zA-Z0-9_]","_") If FExt in exe,ico,bmp,lnk,cpl,cur { hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, CurrItem, UShortP, iIndex) } else If not Icon_%FExt_mod% { hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, CurrItem, UShortP, iIndex) Icon_%FExt_mod% := hIcon } else { hIcon := Icon_%FExt_mod% } DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon) ;DllCall("DestroyIcon", Uint, hIcon) } } LV_Add("Icon" Count2, FNameNoExt, FExt, FDir ) LV_ModifyCol() Return ;------------------SCAN---------------------- DoScan: WaitIdleSecBeforeScanningNetwork = 30 ScanCheckTimerInt := 1 * (1*1000) ;mins SinceLast := A_TickCount-LastScanTick LastScanTick := A_TickCount SetTimer, DoScan, %ScanCheckTimerInt% GoSub, CheckScanDate DoScanNow = If (fastFDDiff < (-1*FastScanPeriod/60)) ;minutes DoScanNow = fast If (FDDiff < (-1*ScanPeriod)) ;less than -X hours old listfile DoScanNow = normal Ret = If not DoScanNow Ret=1 If (SinceLast-ScanCheckTimerInt > 10000) ;more than X msec late - coming from hibernate Ret=2 If (A_TimeIdle < (WaitIdleSecBeforeScanning*1000)) ;Idle for X sec before scanning Ret=3 If (SuspendIsOn) ;Suspend { Ret=4 ScanCheckTimerInt += 30000 ScanTx2 := ScanTx2 " Suspend is On. Waiting " round(ScanCheckTimerInt/1000) " sec." GuiControl,,Status2,%ScanTx2% LastScanTick := A_TickCount SetTimer, DoScan, %ScanCheckTimerInt% Return } If not NetMsg { NetMsg := " Network: ??? (" WaitIdleSecBeforeScanningNetwork " sec idle-time to check)" LastNetCheck := 0 LastRecCheck := 0 ;*************************** ;NetDrives = C: DriveGet,Drives,List NetDrives = FixedDrives = Loop, parse, Drives { DriveGet,DriveType,Type,%A_LoopField%: If DriveType not in Fixed,Removable Continue FixedDrives = %FixedDrives%,%A_LoopField%: If DriveType in Removable IfNotInString,DriveList,%A_LoopField% DriveList = %DriveList%%A_LoopField% } FixedDrives := SubStr(FixedDrives,2) NetDrives = %FixedDrives% ;*************************** NetOnLine = } ;IfEqual,Ret,1 If (A_TimeIdle > (WaitIdleSecBeforeScanningNetwork*1000)) ;Idle for X sec before scanning network { ;delete dead recent If (A_TickCount-LastRecCheck > (30*60*1000) or !LastRecCheck) { GuiControl,, Status,Recent - deleting dead links GuiControl,, Status2, LastRecCheck := A_TickCount RDirToScan = %USERPROFILE%\Recent\ Loop, %RDirToScan%*.*, 1, 1 { FileGetShortcut,%A_LoopFileFullPath%,RScanTarget IfInString,RScanTarget,c: IfNotExist,%RScanTarget% { FileDelete, %A_LoopFileFullPath% Continue } } } ;check network IPS := A_IPAddress1 A_IPAddress2 A_IPAddress3 A_IPAddress4 If (A_TickCount-LastNetCheck > (30*60*1000) or IPS != netIPS or !LastNetCheck) { netIPS := A_IPAddress1 A_IPAddress2 A_IPAddress3 A_IPAddress4 LastNetCheck := A_TickCount NetOnLine = ;NetMsg := " Network is OFF" NetMsg := " Network drives:" GuiControl,, Status,Checking network: DriveGet,Drives,List ;*************************** ;NetDrives = C: NetDrives = FixedDrives = Loop, parse, Drives { DriveGet,DriveType,Type,%A_LoopField%: If DriveType not in Fixed,Removable Continue FixedDrives = %FixedDrives%,%A_LoopField%: If DriveType in Removable IfNotInString,DriveList,%A_LoopField% DriveList = %DriveList%%A_LoopField% } FixedDrives := SubStr(FixedDrives,2) NetDrives = %FixedDrives% ;*************************** Loop, parse, Drives { ;myshow("Waiting for drive " A_LoopField ":","Checking network status","TT",0,0) GuiControl,, Status2,Drive %A_LoopField%: ;SoundBeep,3000,30 DriveGet,NetType,Type,%A_LoopField%: If (NetType != "Network") Continue ;DriveGet,NetStatus,Status,%A_LoopField%: RunWait, %comspec% /c dir %A_LoopField%:\, ,Hide UseErrorLevel ;If (NetType = "Network" and NetStatus = "Ready") If not ErrorLevel { NetMsg = %NetMsg%%A_LoopField%%A_Space% NetDrives = %NetDrives%,%A_LoopField%: NetOnLine = 1 } } If not NetOnLine NetMsg := " Network: no drives" ;myshow("OFF") } } ScanTx = ScanTx2 = ScanTx := ScanTx "Fast-scan: " round((fastFDDiff-(-1*FastScanPeriod/60))*60,1) " min" ScanTx := ScanTx " Full scan: " round((FDDiff-(-1*ScanPeriod))*60,1) " min" " (Idle-time: " WaitIdleSecBeforeScanning " sec)" ScanTx2 := ScanTx2 "Idle time: " round(A_TimeIdle/1000) " sec" " USB: " DriveList ;ScanTx2 := ScanTx2 " Punctuality: " round(SinceLast-ScanCheckTimerInt,2) " msec" ScanTx2 := ScanTx2 NetMsg ;GuiControl,,ScanTx,%A_Space% GuiControl,,Status,%ScanTx% GuiControl,,Status2,%ScanTx2% IfEqual,Ret,2 { ScanCheckTimerInt += 30000 ScanTx2 := ScanTx2 " Coming from hibernate. Waiting " round(ScanCheckTimerInt/1000) " sec" GuiControl,,Status2,%ScanTx2% } If Ret { LastScanTick := A_TickCount SetTimer, DoScan, %ScanCheckTimerInt% Return } SetTimer, DoScan, Off IfEqual, DoScanNow, normal GoSub, ButtonScan else GoSub, FastScanNow LastScanTick := A_TickCount SetTimer, DoScan, %ScanCheckTimerInt% Return ReadScanFile: rely := tGuiY+GuiMargin-13 relx := tGuiX+newEditPosX relw := newEditWidth Spl_Design4 = y%rely% x%relx% w%relw% M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM7 FS7 WM600 WS400 ;myshow("","Loading index...",4,0,1) myshow(IndexFile,"Loading index...","TT",3,0) ;Sleep, 50 xItemList = ItemList = ; FileGetSize, LFSize1, %IndexFile% ;normal or network ; FileGetSize, LFSize2, %IndexDir%\Fast_%ListFile% ; FileGetSize, LFSize3, %IndexDir%\FF_%ListFile% ; FileGetSize, LFSize4, %IndexDir%\Recent_%ListFile% ; Loop,parse,DriveList ; { ; mix := A_Index+4 ; DriveGet,tUSB_serial,Serial,%A_LoopField%:\ ; FileGetSize, LFSize%mix%, %IndexDir%\USB_%tUSB_serial%_%ListFile% ; } ; LFSizeAll = 0 ; Loop,%mix% ; LFSizeAll := LFSizeAll + LFSize%A_Index% ; VarSetCapacity(xItemList,LFSizeAll) ; VarSetCapacity(ItemList,LFSizeAll) ;load before If not AltIndex { FileRead,xIF,%IndexDir%\Recent_%ListFile% xItemList = %xItemList%`n%xIF% FileRead,xIF,%IndexDir%\Fast_%ListFile% xItemList = %xItemList%`n%xIF% Loop,parse,DriveList { DriveGet,tUSB_serial,Serial,%A_LoopField%:\ FileRead,xIF,%IndexDir%\USB_%tUSB_serial%_%ListFile% xItemList = %xItemList%`n%xIF% } FileRead,ffidx,%IndexDir%\FF_%ListFile% xItemList = %xItemList%`n%ffidx% } ;load main index FileRead,xIF,%IndexFile% ;normal or Net_ xItemList = %xItemList%`n%xIF% xIF = ;load after If (SubStr(cIndexN,1,5) = "Start") { FileRead,ffidx,%IndexDir%\FF_%ListFile% xItemList = %xItemList%`n%ffidx% } If (not AltIndex) Sort, xItemList, R P1 U ItemList := RegExReplace(xItemList,"m)^\s*\d*\s","") ; StringReplace,ItemList,ItemList,`n,|,All ; StringReplace,ItemList,ItemList,`r,,All ItemList = %ItemList% ;MsgBox,%ItemList% xItemList = myshow("OFF") Return ScanNetworkNow: NetworkScan = 1 PathListX_save := PathListX PathListX = ScanFirefox_save := ScanFirefox ScanFirefox = DriveGet,XNetDrives,List,NETWORK Loop, Parse, XNetDrives PathListX = %PathListX%%A_LoopField%:\| PathListX := SubStr(PathListX,1,-1) InputBox, PathListX, Network drives, Edit your network drives/folders to scan`nSeparated by pipe(|),,,,,,,,% PathListX If (not ERRORLEVEL and PathListX) GoSub, ButtonScan ;based on PathListX PathListX := PathListX_save ScanFirefox := ScanFirefox_save NetworkScan = Return ScanUSBNow: USBScan = 1 AgressiveScan = 1 PathListX_save := PathListX PathListX = %USB_target% ScanFirefox_save := ScanFirefox ScanFirefox = GoSub, ButtonScan ;based on PathListX PathListX := PathListX_save ScanFirefox := ScanFirefox_save USBScan = AgressiveScan = Return ScanFirefoxNow: FFScan = 1 ScanFirefox_save := ScanFirefox ScanFirefox = 1 GoSub, ButtonScan ;based on PathListX ScanFirefox := ScanFirefox_save FFScan = Return FastScanNow: FastScan = 1 PathListX_save := PathListX PathListX = %FastScanList% ScanFirefox_save := ScanFirefox ScanFirefox = GoSub, ButtonScan ;based on PathListX PathListX := PathListX_save ScanFirefox := ScanFirefox_save FastScan = Return RecentScanNow: RecentScan = 1 GoSub, Recent_ButtonScan RecentScan = Return Recent_ButtonScan: GuiControl,, Status,Scanning Recent... StringReplace,TypeList,TypeList,|,`,,All StringReplace,ExcludeList,ExcludeList,|,`,,All StringReplace,IncludeList,IncludeList,|,`,,All RScanItemList = RDirToScan = %USERPROFILE%\Recent\ IfInString,A_OSVersion,vista RDirToScan = %A_AppData%\Microsoft\Windows\Recent\ GuiControl,, Status2,%RDirToScan% Loop, %RDirToScan%*.*, 1, 1 { ;FileGetShortcut,%A_LoopFileFullPath%,RScanTarget ;IfNotInString,RScanTarget,c: ; Continue RCont = 0 ;excluding items based on ExcludeList If A_LoopFileFullPath contains %ExcludeList% RCont = 1 ;including items based on IncludeList If A_LoopFileFullPath contains %IncludeList% RCont = 0 IfEqual, RCont, 1 Continue ;reaching here means that file is not to be excluded If (A_Index/100 = round(A_Index/100)) ;every 100th time GuiControl,, Status2,%A_LoopFileDir% RScanItemList = %RScanItemList%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n } ;--sort by mod-date------------------------------------------------------ Sort, ScanItemList, R ;Reverse sort RthisFile = %IndexDir%\Recent_%ListFile% FileDelete, %RthisFile% FileAppend,%RScanItemList%,%RthisFile% RScanItemList = GoSub, ReadScanFile LastText = oiuqwoiuqowiuqowieuoqwieu GuiControl,, Status, GuiControl,, Status2, Return ButtonScan: Menu, Tray, Icon, Shell32.dll, %iconScanning% Sleep, 500 SetTimer, DoScan, OFF If not AgressiveScan SetTimer, CheckScanPause, 500 If FFScan Goto, FFScanHere StringReplace,TypeList,TypeList,|,`,,All StringReplace,ExcludeList,ExcludeList,|,`,,All StringReplace,IncludeList,IncludeList,|,`,,All FullScan = If (!FastScan and !NetworkScan and !USBScan) FullScan = 1 ScanItemList = Loop,30 ScanItemList%A_Index% = Loop, Parse, PathListX, | { DirToScan = %A_LoopField% ;Recent for Vista IfInString,DirToScan,%USERPROFILE%\Recent IfInString,A_OSVersion,vista StringReplace,DirToScan,DirToScan,%USERPROFILE%\Recent,%A_AppData%\Microsoft\Windows\Recent\,All If (SubStr(DirToScan,0)<>"\") DirToScan = %DirToScan%\ IfNotExist, %DirToScan% Continue GuiControl,, Status,Scanning %DirToScan% Loop, %DirToScan%*.*, 1, 1 { IfNotInString,TypeList,*** ;exemine extension { If InStr(FileExist(A_LoopFileFullPath), "D") ;Dir { thisDir = 1 IfNotInString,TypeList,dir ;dir not to scan Continue } else ;its a file { thisDir = 0 If A_LoopFileExt not in %TypeList% ;ext not to scan Continue } } Cont = 0 ;excluding items based on ExcludeList If A_LoopFileFullPath contains %ExcludeList% Cont = 1 ;including items based on IncludeList If A_LoopFileFullPath contains %IncludeList% Cont = 0 IfEqual, Cont, 1 Continue ;reaching here means that file is not to be excluded If (A_Index/100 = round(A_Index/100)) ;every 100th time { StringReplace,subdir,A_LoopFileFullPath,%DirToScan%,,All GuiControl,, Status2,%subdir% } ;Put in the index ScanItemList = %ScanItemList%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n ;Do Extra Scan Files plusItems = 0 If (FullScan) { If (InStr(FileExist(A_LoopFileFullPath), "D")) { ;Dirs ScanItemList1 = %ScanItemList1%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n } else If A_LoopFileDir contains %A_StartMenu%,%A_StartMenuCommon%,%A_MyDocuments%\AutoHotkey scripts\MyKeysMenu,%AppData%\Microsoft\Internet Explorer\Quick Launch { ;Start Menu ScanItemList4 = %ScanItemList4%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n } If A_LoopFileExt in com,exe { ;Exe's ScanItemList2 = %ScanItemList2%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n } IfInString,A_LoopFileDir,%A_MyDocuments% { ;MyDoc ScanItemList3 = %ScanItemList3%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n } ;Total Extra files: plusItems = 4 ScanItemName1 = Dirs_ ScanItemName2 = Exe_ ScanItemName3 = MyDoc_ ScanItemName4 = Start_ } else If (FastScan) { IfInString,PathListX,%A_MyDocuments% { ;MyDoc IfInString,A_LoopFileDir,%A_MyDocuments% { ScanItemList1 = %ScanItemList1%%A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n } ;Total Extra files: plusItems = 1 ScanItemName1 = MyDoc_ } } } } ;--sort by mod-date------------------------------------------------------ GuiControl,, Status,Sorting by mod date... GuiControl,, Status2, If (FullScan or FastScan) { Loop,%plusItems% { pScanItemList := ScanItemList%A_Index% Sort, pScanItemList, R ;Reverse sort thisFile := IndexDir "\" ScanItemName%A_Index% ListFile FileDelete, %thisFile% FileAppend,%pScanItemList%,%thisFile% pScanItemList = ScanItemList%A_Index% = } } Sort, ScanItemList, R ;Reverse sort If RecentScan thisFile = %IndexDir%\Recent_%ListFile% else If USBScan { USB_ID := driveserial thisFile = %IndexDir%\USB_%USB_ID%_%ListFile% } else If NetworkScan thisFile = %IndexDir%\Net_%ListFile% else If FastScan { thisFile = %IndexDir%\Fast_%ListFile% fastFDTime = } else { thisFile = %IndexDir%\%ListFile% FDTime = } FileDelete, %thisFile% FileAppend,%ScanItemList%,%thisFile% ScanItemList = ;--sort by mod-date v?ge------------------------------------------------- FFScanHere: If ScanFirefox { GuiControl,, Status,Scanning Firefox bookmarks... GuiControl,, Status2, GoSub, ScanFirefoxBM } SetTimer, CheckScanPause, OFF GoSub, ReadScanFile LastText = oiuqwoiuqowiuqowieuoqwieu GuiControl,, Status, GuiControl,, Status2, SetTimer, DoScan, %ScanCheckTimerInt% Menu, Tray, Icon, Shell32.dll, %iconBasic% If FullScan GoSub, FastScanNow Return CheckScanPause: If (A_TimeIdle >= (ScanPause * 1000)) Return Menu, Tray, Icon, Shell32.dll, %iconPause% scanType = scanning If AgressiveScan scanType = agressive scanning scanTarget = Full_ScanList If FastScan scanTarget = Fast_ScanList If NetworkScan scanTarget = Network If USBScan scanTarget = USB If FFScan scanTarget = FireFox If RecentScan scanTarget = Recent myshow("Computer in use.`nWaiting " ScanPause " sec.","Paused " scanType " " scanTarget ".","TT",ScanPause,0) ;myshow("Computer in use.`nWaiting " ScanPause " sec.","Paused " scanType " " scanTarget ".","TT") Sleep, % (ScanPause * 1000) ;myshow("OFF") Menu, Tray, Icon, Shell32.dll, %iconScanning% Return ScanFirefoxBM: FFScan_ProfileName = default,Zsolt ;FFScan_ProfileName = All FFini = %A_AppData%\Mozilla\Firefox\profiles.ini IfNotExist, %FFini% { MsgBox, Cannot index Firefox BookMarks: `nDoes not exist %FFini% Return } ;get path to bookmarks file BMFiles = 0 ProfilesToScan = 25 Loop %ProfilesToScan% { Count := ProfilesToScan-A_Index ;see if current profile is Default ezkell = 0 IniRead, IsDefault, %FFini%, Profile%Count%, Default, %A_Space% IniRead, FFxName, %FFini%, Profile%Count%, Name, %A_Space% If not FFScan_ProfileName FFScan_ProfileName = All IfNotEqual,FFScan_ProfileName,All { If FFxName contains %FFScan_ProfileName% ezkell = 1 } else ezkell = 1 If not ezkell Continue If ezkell { ;get path to default profile IniRead, PPath, %FFini%, Profile%Count%, Path, %A_Space% IniRead, IsRelative, %FFini%, Profile%Count%, IsRelative, %A_Space% StringReplace,PPath,PPath,/,\,All ;Retrieve file names sorted by modification date: fFileList = If IsRelative FPPath = %A_AppData%\Mozilla\Firefox\%PPath% else FPPath = %PPath% Loop, %FPPath%\bookmarkbackups\*.json fFileList = %fFileList%%A_LoopFileTimeModified%`t%A_LoopFileName%`n Sort, fFileList, R ; Sort by date. Loop, parse, fFileList, `n { if A_LoopField = ; Omit the last linefeed (blank item) at the end of the list. continue StringSplit, fFileItem, A_LoopField, %A_Tab% ; Split into two parts at the tab char. Break } BMFile = %FPPath%\bookmarkbackups\%fFileItem2% IfExist, %BMFile% BMFile = %BMFile% ;check alternative files Else IfExist, %PPath%\bookmarks.html BMFile = %PPath%\bookmarks.html Else IfExist, %A_AppData%\Mozilla\Firefox\%PPath% BMFile = %A_AppData%\Mozilla\Firefox\%PPath%\bookmarks.html Else { ;read last saved bookmarks file path IniRead, BMFile, %A_ScriptFullPath%, Plugin Settings, Bookmarks, %A_Space% IfNotExist, %BMFile% { MsgBox,, 320MPH Firefox Bookmarks plugin, FireFox Bookmarks file not found.`nIn the next window, please select the file from Firefox Profile folder. FileSelectFile, BMFile, 3, bookmarks.html, Select FireFox Bookmarks file, HTML Documents (*.html) IfNotExist, %BMFile% Return If not A_IsCompiled IniWrite, %BMFile%, %A_ScriptFullPath%, Plugin Settings, Bookmarks } } ;Break BMFiles++ BMFile%BMFiles% = %BMFile% } } ;give up finally If not BMFiles Return List2Write = Sclp := ClipboardAll Loop %BMFiles% { BMFile := BMFile%A_Index% FileRead, BookMarks, %BMFile% IfNotInString,BMFile,.json { Loop, Parse, BookMarks, `n, `r { RE = U)\QHREF="\E.*" ;RE = i)href=('|")?([^\s'"]+) RegExMatch(A_LoopField, RE, ToRun) ;ToRun = %ToRun2% IfEqual, ToRun,, Continue StringTrimLeft, ToRun, ToRun, 6 StringTrimRight, ToRun, ToRun, 1 RE = U)">.*\Q\E ;" RegExMatch(A_LoopField, RE, Tags) IfEqual, Tags,, Continue StringTrimLeft, Tags, Tags, 2 StringTrimRight, Tags, Tags, 4 ;LAST_VISIT="1214466884" RE = LAST_VISIT="(.[^"]*)" ;" RegExMatch(A_LoopField, RE, LVDate) ;IfEqual, LVDate1,, Continue var1 = 19700101020000 ; Make it blank so that the below will use the current time instead. var1 += %LVDate1%, seconds LVDate = %var1% ;IMPORTANT for compatability reasons StringReplace, Tags, Tags, |, -, A ;StringReplace, Tags, Tags, ?, -, A Transform, Clipboard, Unicode, %Tags% Tags := Clipboard List2Write = %List2Write%%LVDate%`t`n } } else { StringReplace,BookMarks,BookMarks,`n,,All StringReplace,BookMarks,BookMarks,`r,,All StringReplace,BookMarks,BookMarks,`n`r,,All StringReplace,BookMarks,BookMarks,`r`n,,All Sepp = "index": StringReplace,BookMarks,BookMarks,%Sepp%,¤,All Loop, Parse, BookMarks, ¤ { regex = i)uri":"(.+?)" ;" RegExMatch(A_LoopField,regex,res) ToRun = %res1% IfEqual, res1,, Continue IfNotInString,res1,:// Continue regex = i)title":"(.+?)"," ;" RegExMatch(A_LoopField,regex,res) Tags = %res1% IfEqual, res1,, Continue regex = i)modified":(.+?), ;" RegExMatch(A_LoopField,regex,res) LVDate1 = %res1% var1 = 19700101020000 LVDate1 := round(LVDate1/1000000) var1 += %LVDate1%, seconds LVDate = %var1% ;IMPORTANT for compatability reasons StringReplace, Tags, Tags, |, -, A ;StringReplace, Tags, Tags, ?, -, A Transform, Clipboard, Unicode, %Tags% Tags := Clipboard List2Write = %List2Write%%LVDate%`t`n } } } ;Loop end Clipboard := Sclp Sclp = BookMarks = ;FireFox in nDroid index file StringReplace,List2Write,List2Write,,,All FileDelete, %IndexDir%\FF_%ListFile% FileAppend, %List2Write%, %IndexDir%\FF_%ListFile% List2Write = Return ;------------BUTTONs-MENUs---------------------- Selection: ControlGet, ShowTTip, Checked,, Button3, ahk_id %id320% ;A ShowTTip checkbox ?llapota GetKeyState, Esckey, Esc IfEqual, Esckey, D Return SelItem := LV_GetNext() LV_GetText(0FName, SelItem, 1) LV_GetText(0FExt, SelItem, 2) LV_GetText(0FDir, SelItem, 3) IfInString,0FDir,:// Pth = %0FDir% [%0FName%] else If 0FExt Pth = %0FDir%\%0FName%.%0FExt% else Pth = %0FDir%\%0FName% FTarget = If Pth { if (InStr(0FExt,"lnk")) { FileGetShortcut, %Pth%, FTarget SplitPath, FTarget, mFName, mFDir, mFExt,, mFDrive } else SplitPath, Pth, mFName, mFDir, mFExt,, mFDrive Pth2 := mFDir . "\" . mFName If mFExt in jpg,gif,bmp,png,tif,ico,wmf,emf,exif,ani,cur ;Other images in Gui { If Pth2 contains %NetDrives% { If (FileExist(Pth2)) { If not shPng { WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,% GuiW + 210,%GuiH% ;Make Gui bigger shPng := true GoSub, ShowNetworkSplash } GuiControl,, Static3, *w200 *h-1 %Pth2% If ErrorLevel TrayTip, ErrorLevel = %ErrorLevel%,,,17 } else { SplashImage,9:OFF If shPng { WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Restore Gui size shPng = shIE = GoSub, ShowNetworkSplash } } } else { SplashImage,9:OFF If shPng { WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Restore Gui size shPng = shIE = GoSub, ShowNetworkSplash } } } else ;mFExt not picture { SplashImage,9:OFF If shPng { WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Restore Gui size shPng = shIE = GoSub, ShowNetworkSplash } } } else ;not Pth { SplashImage,9:OFF If shPng { WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Restore Gui size shPng = shIE = GoSub, ShowNetworkSplash } } if (Pth && ShowTTip) ;show tooltip { If Pth2 contains %NetDrives%,:// { if (InStr(0FExt,"lnk")) { FileGetTime, FileCDate, %FTarget%, C ; Retrieves the modification time in case of lnk. FileGetTime, FileDate, %FTarget%, M ; Retrieves the modification time in case of lnk. FileGetSize, FileSize, %FTarget%, K } else if (InStr(Pth2,"://")) { regsrc := SubStr(Pth,1,InStr(Pth," ")-1) pos := InStr(ffidx,regsrc) FD1 := SubStr(ffidx,pos-14-1,14) FileDate =%FD1% FileSize = n.a. } else { FileGetTime, FileCDate, %Pth%, C ; Retrieves the modification time by default. FileGetTime, FileDate, %Pth%, M ; Retrieves the modification time by default. FileGetSize, FileSize, %Pth%, K } FormatTime, FileCDate, %FileCDate%, yyyy.MM.dd HH:mm:ss FormatTime, FileDate, %FileDate%, yyyy.MM.dd HH:mm:ss ToShow = File:`t%Pth%`nTarget:`t%FTarget%`nMod:`t%FileDate%`nCreated:`t%FileCDate%`nSize:`t%FileSize% kB If not wH WinGetPos, wX, wY, wW, wH, ahk_id %id320% IfEqual,WinTrayPos,up ToolTip, %ToShow%, 0, % wH+10 ;below else ToolTip, %ToShow%, 0, -55 ;above } else If (Pth != "Folder\Name.Ext") { ToShow = File:`t%Pth%`nTarget:`t%FTarget%`nMod:`t??? (network not available)`nCreated:`t??? (network not available)`nSize:`t??? (network not available) If not wH WinGetPos, wX, wY, wW, wH, ahk_id %id320% IfEqual,WinTrayPos,up ToolTip, %ToShow%, 0, % wH+10 ;below else ToolTip, %ToShow%, 0, -55 ;above } else ToolTip } ;ToolTip, % A_GuiControlEvent "-" A_GuiEvent "-" A_EventInfo IfEqual, A_GuiControlEvent, DoubleClick GoTo, ButtonOpen Return ButtonOpen: ControlGetFocus, curFoc, ahk_id %id320% IfEqual, curFoc, Edit2 { ControlFocus, Edit1, ahk_id %id320% Return } Gui, Submit, NoHide GetKeyState, ShKey, Shift GetKeyState, CtKey, Control GetKeyState, WinKey, LWin ControlFocus, SysListView321, ahk_id %id320% SelItem := LV_GetNext() RunSearch = IfEqual, SelItem, 0 RunSearch = 1 IfEqual, CtKey, D RunSearch = 1 ;run unrecognised cmd IfEqual, RunSearch, 1 { RunItem = %CurrText% Run, %RunItem% Return } ;running a found file/folder LV_GetText(FName, SelItem, 1) LV_GetText(FExt, SelItem, 2) LV_GetText(FDir, SelItem, 3) IfInString,FDir,:// ;url RunItem = %FDir% else IfEqual, FExt, ;dir RunItem = %FDir%\%FName% else If (InStr(FExt, "Ln ",true) or InStr(FExt, "Line ",true)) { MsgBox, %FDir% Return } else IfNotEqual, FExt, RunItem = %FDir%\%FName%.%FExt% FileExist = 1 ;remove the last \ from a launched folder's name StringRight, check, RunItem, 1 IfEqual, check, \ StringTrimRight, RunItem, RunItem, 1 ;add the \ back if the target is a drive path StringLen, check, RunItem IfLess, check, 3 RunItem = %RunItem%\ ;FireFox IfInString,RunItem,:// { FFurl = 1 Add2History = %RunItem%?%FName% } else { FFurl = Add2History = %RunItem% } ;File info box If (nyomi2 = 1 or WinKey = "D") { FileGetShortcut, %RunItem%, LnkTarget MsgBox RunItem = %RunItem% `n`nLnkTarget = %LnkTarget% Return } ;get real file path from shortcut StringRight, check, RunItem, 4 if (InStr(check,".lnk")) { if LnkDir { FileGetShortcut, %RunItem%, LnkTarget IfNotInString, LnkTarget, { IfNotInString, LnkTarget, } RunItem = %LnkTarget% } } ;SplitPath, RunItem, FName, FDir, FExt, FNameNoExt, FDrive ;shift key down opens host folder ;Dir button opens host folder If (nyomi = 1 or ShKey = "D") If not FFurl { Run, Explorer /select`,"%RunItem%",, UseErrorLevel ;Run, %OpenFolderWithX% "%FDir%" GoSub, Hide320 Return } else { GoSub, Hide320 Return } ;simple run IfEqual, RParam, Run, "%RunItem%", %FDir%, UseErrorLevel ;runtime param IfNotEqual, RParam, Run, "%RunItem%" "%RParam%", %FDir%, UseErrorLevel AddToList: IfNotInString,RunItem,\Recent\ If (Add2History and AltIndex!=1) { StringReplace, UsedList, UsedList, |%Add2History%,, A UsedList = |%Add2History%%UsedList% ;leave only max items in list ;StringReplace,UsedList,UsedList,||,|,All StringTrimLeft, UsedList, UsedList, 1 StringSplit, UsedItem, UsedList, | UsedList = ulnum = 0 ;Loop, % MaxLastUsed Loop, % UsedItem0 { CurrItem := UsedItem%A_Index% IfEqual, CurrItem,, Continue UsedList = %UsedList%|%CurrItem% ulnum ++ If (ulnum >= MaxLastUsed) Break } IniWrite, %UsedList%, %IniFile%, Advanced, UsedList } GoSub, Hide320 Return ;;End ButtonOpen ButtonDir: nyomi = 1 GoSub, ButtonOpen nyomi = Return ButtonDirTg: LnkDir = 1 nyomi = 1 GoSub, ButtonOpen LnkDir = nyomi = Return MenuFold: Run, %A_ScriptDir% Return MenuEdit: Run, edit %A_ScriptFullPath% Return MenuSetup: GoSub, Hide320 GoSub, IniGui_Setup ;Reload Return MenuIni: RunWait, %IniFile% Reload Sleep, 1300 Return MenuWriteIni: MsgBox,4,Restore default settings,This will restore default settings.`n`nAre you sure? IfMsgBox,yes GoSub, WriteIni Return MenuRel: Reload Sleep, 300 Return MenuEx: ExitApp return MenuWin: nyomi2 = 1 GoSub, ButtonOpen nyomi2 = Return MenuDel: IfWinNotActive, ahk_id %id320%,, Return ControlGetText, CurrText, Edit1, ahk_id %id320% IfNotEqual, CurrText,, Return SelItem := LV_GetNext() LV_GetText(FName, SelItem, 1) LV_GetText(FExt, SelItem, 2) LV_GetText(FDir, SelItem, 3) IfInString,FDir,:// Pth = %FDir%?%FName% else IfNotEqual,FExt, Pth = %FDir%\%FName%.%FExt% else IfEqual,FExt, Pth = %FDir%\%FName% StringReplace, UsedList, UsedList, |%pth%,, A IniWrite, %UsedList%, %IniFile%, Advanced, UsedList LastText = xkhdkhsaoihdiiouwoeiue Goto, GetText Return ScanStat: mExtList = ;Loop, Parse, ItemList, | Loop, Parse, ItemList, `n, `r { If not A_LoopField Continue CurrItem = %A_LoopField% IfInString,CurrItem,:// FExt := "FFurl" else SplitPath, CurrItem, FName, FDir, FExt, FNameNoExt, FDrive If not FExt If InStr(FileExist(CurrItem), "D") ;Dir FExt := "DIR" mExtList = %mExtList%|%FExt% } stringTrimLeft, mExtList, mExtList, 1 Sort, mExtList, D| mExt = mCn = aCn = mSg = Loop, Parse, mExtList, | { ;If not A_LoopField ; Continue aCn ++ IfEqual, mExt, %A_LoopField% { mCn ++ } else { mSg = %mSg%`t`t%mExt%`t%mCn%`t`t`t`n mExt = %A_LoopField% mCn = 1 } } ;MsgBox, %mSg%`n`n`t`tAll`t%aCn% stats = %mSg%`n`n`t`tAll`t%aCn% Gui,31:Add,Edit,w600 h500 vMyEdit GuiControl,31:, MyEdit, %stats% Gui,31:Show,,my Stat Window WinWaitClose,my Stat Window Gui,31:Destroy mExtList = Return ChangeIndexFile: ;Critical Gui, Submit, NoHide ;give value to SearchTab If (A_GuiControl = "SearchTab") { CurrIndex := SearchTab-1 ThisHotkey = ThisHK = GuiControl,Focus,Edit1 } else { ThisHotkey := A_ThisHotkey ThisHK := A_ThisHotkey } ;MsgBox, %A_GuiControl% - %SearchTab% - %CurrIndex% If (AltIndex = 1) ;Network Return If not CurrIndex CurrIndex = 0 IfEqual,ThisHotkey,right CurrIndex++ IfEqual,ThisHotkey,left CurrIndex-- If (CurrIndex < 0) CurrIndex := szml If (CurrIndex > szml) CurrIndex = 0 cIndexN := IndexN%CurrIndex% AltIndex = 2 If (SubStr(cIndexN,1,4) = "Full") AltIndex = 0 IndexFile := IndexF%CurrIndex% GoSub, ReadScanFile GoSub, ShowNetworkSplash LastText = owiuepoiqoiquwpoi GoTo, GetText Return AltIndexFile: If not AltIndex { IfNotExist,%IndexDir%\Net_%ListFile% { FileSelectFile, IndexFile2, 3, %A_ScriptDir%, Open a NETWORK IndexFile, *.lst If not IndexFile2 { GuiControl,,AltNetInd,0 Return } IndexFile := IndexFile2 } else IndexFile = %IndexDir%\Net_%ListFile% AltIndex = 1 GuiControl,,AltNetInd,1 cIndexN = Network } else { AltIndex = GuiControl,,AltNetInd,0 IndexFile = %IndexDir%\%ListFile% cIndexN := IndexN0 } GoSub, ReadScanFile GoSub, ShowNetworkSplash LastText = owiuepoiqoiquwpoi GoTo, GetText Return Google: doma = com If (A_Language = "040e") doma = hu ControlGetText,Txt,Edit1,ahk_id %id320% Run, www.google.%doma%/search?q=%Txt% Return Wikipedia: doma = en If (A_Language = "040e") doma = hu ControlGetText,Txt,Edit1,ahk_id %id320% Run, http://%doma%.wikipedia.org/?search=%Txt% Return ChangeView: ;IfWinNotActive, ahk_id %id320%,, Return IfWinNotActive,ahk_id %id320% GoSub,myShow320 Gui, Submit, NoHide ShowBigView = 0 If ShowBigViewCtrl ShowBigView = 1 ;IfEqual, CurrentView, ;LargeIcons If ShowBigViewCtrl { ;Make it BIG Report IconSize = 0 sGuiW := GuiW sGuiH := GuiH sGuiX := GuiX GuiW := GuiW + 350 GuiH := GuiH If (GuiX > 350) GuiX := GuiX - 350 if shPng WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,% GuiW + 210,%GuiH% ;Make Gui bigger else WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Make Gui restored Gui, Font, s8, Tahoma GuiControl, Font, SysListView321 GuiControl, +%ListTextC%, SysListView321 GuiControl, MoveDraw, SysListView321, % "w" LVGuiW + 350 GuiControl, MoveDraw, SearchTab, % "w" LVGuiW + 350 GuiControl, +Report, SysListView321 ;GuiControl, +BackgroundBlack +CWhite, SysListView321 GuiControl, MoveDraw, Static3, % "x" GuiW LV_ModifyCol() CurrentView = Report IniWrite, 1, %IniFile%, Display, ShowBigView } else { ;Make it SMALL Tile IconSize = 1 GuiW := sGuiW GuiH := sGuiH GuiX := sGuiX if shPng WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,% GuiW + 210,%GuiH% ;Make Gui bigger else WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Make Gui restored Gui, Font, s9, %GuiFont% GuiControl, Font, SysListView321 GuiControl, +%ListTextC%, SysListView321 GuiControl, MoveDraw, SysListView321, % "w" LVGuiW GuiControl, MoveDraw, SearchTab, % "w" LVGuiW GuiControl, +Tile, SysListView321 ;GuiControl, +BackgroundBlack +CWhite, SysListView321 GuiControl, MoveDraw, Static3, % "x" GuiW LV_ModifyCol() CurrentView = IniWrite, 0, %IniFile%, Display, ShowBigView } GoSub, ShowNetworkSplash GuiControl, Move, MOVER, w%GuiW% h%GuiH% ControlFocus, Edit1, ahk_id %id320% LastText = lskldjfiwjesakjdwoidj GoTo, GetText Return TransWinToggle: Gui, Submit Gui, Destroy id320 = -1 IniWrite, %TransWin%, %IniFile%, Display, TransWin GoTo, Start320 Return GuiEscape: GoSub, Hide320 Return GuiClose: GoSub, Hide320 Return GuiMove: ;Critical PostMessage, 0xA1, 2,,, ahk_id %id320% Sleep, 200 GoSub,ShowNetworkSplash WinGetPos, GuiX, GuiY,,, ahk_id %id320% IniWrite, %GuiX%, %IniFile%, Display, GuiX IniWrite, %GuiY%, %IniFile%, Display, GuiY ;Critical, Off Return ;Chris made this long ago! Hide320: ControlFocus, SysListView321, ahk_id %id320% ;removes long name tooltip ; If shPng ; WinMove,ahk_id %id320%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ControlGetText, zz, Edit1, ahk_id %id320% if id320 <> -1 { WinHide, ahk_id %id320% } ToolTip TrayTip SplashImage,8:OFF SplashImage,9:OFF If not IniReWritten { GoSub, ReWriteIni IniReWritten = 1 } Return myShow320: ignoreThis = 1 GoSub,Show320 ignoreThis = 0 Return Show320: SetTimer,Show320,OFF if id320 <> -1 { ;GoSub, ReadScanFile ; OR GoSub, Start320 DetectHiddenWindows, ON GoSub, ShowNetworkSplash WinShow, ahk_id %id320% WinActivate, ahk_id %id320% ControlFocus, Edit1, ahk_id %id320% DetectHiddenWindows, OFF ;Reload ItemList } if (zz) { ControlSetText,Edit1,%zz%,ahk_id %id320% LastText = %zz% } Send, ^a ;select all GoSub, RecentScanNow Return ;; Control the focus of main window. When it lose focus, hide it. ;-------------HELPING FUNC---------------------- skinInit: skin_Names = 0 Loop,50 skin_Name%A_Index% = FileRead,skinFile,%skin_IniFile% Loop,parse,skinFile,`n,`r { If (!A_LoopField or SubStr(A_LoopField,1,1)=";") Continue If (SubStr(A_LoopField,1,1)="[") { StringReplace,skin_Sect,A_LoopField,[,,All StringReplace,skin_Sect,skin_Sect,],,All skin_Names++ skin_Name%skin_Names% = %skin_Sect% Menu, skins, Add, %skin_Sect%, skinLoad } } ;Menu, skins, Add skinFile = Return skinEdit: Run, edit %skin_IniFile% Return skinLoad: skin_LoadName := A_ThisMenuItem Loop, Read, %skin_IniFile% { If (!A_LoopReadLine or SubStr(A_LoopReadLine,1,1)=";") Continue If (SubStr(A_LoopReadLine,1,1)="[") { StringReplace,skin_Sect,A_LoopReadLine,[,,All StringReplace,skin_Sect,skin_Sect,],,All } } Loop, Read, %skin_IniFile% { If (!A_LoopReadLine or SubStr(A_LoopReadLine,1,1)=";") Continue If (SubStr(A_LoopReadLine,1,1)="[") { StringReplace,skin_Sect,A_LoopReadLine,[,,All StringReplace,skin_Sect,skin_Sect,],,All } else { IfEqual,skin_Sect,%skin_LoadName% { StringSplit,skin_Item,A_LoopReadLine,= skin_Par = %skin_Item1% IniRead,%skin_Par%,%skin_IniFile%,%skin_Sect%,%skin_Par% ;MsgBox, IniRead-%IniGui_Item1%-%IniGui_IniFile%-%IniGui_Sect%-%IniGui_Item1% } } } GoSub,ReWriteIni Gui, Submit Gui, Destroy id320 = -1 GoTo, Start320 Return skinSave: InputBox,skin_SaveName,Save Skin,Save current view as a skin. Skin name?,,,,,,,,Skin_%A_YYYY%%A_MM%%A_DD%_%A_Hour%%A_Min%%A_Sec% If (ErrorLevel or !skin_SaveName) Return FileAppend,`r`n,%skin_IniFile% IniWrite, %ShowIcons%, %skin_IniFile%, %skin_SaveName%, ShowIcons IniWrite, %ShowBigView%, %skin_IniFile%, %skin_SaveName%, ShowBigView IniWrite, %GuiFont%, %skin_IniFile%, %skin_SaveName%, GuiFont IniWrite, %ListColor%, %skin_IniFile%, %skin_SaveName%, ListColor IniWrite, %GuiColor%, %skin_IniFile%, %skin_SaveName%, GuiColor IniWrite, %TransWin%, %skin_IniFile%, %skin_SaveName%, TransWin IniWrite, %GuiTrans%, %skin_IniFile%, %skin_SaveName%, GuiTrans GoSub,makeMenus MsgBox,0,Skin Saved.,Skin successfully saved as %skin_SaveName%.,10 Return CheckScanDate: If not FDTime FileGetTime, FDTime, %IndexDir%\%ListFile%, M ; Retrieves the modification time by default. FDDiff := FDTime EnvSub, FDDiff, %A_Now%, seconds FDDiff := round(FDDiff/60/60,3) ;in hours fastFDDiff = 0 IfExist, %IndexDir%\Fast_%ListFile% { If not fastFDTime FileGetTime, fastFDTime, %IndexDir%\Fast_%ListFile%, M ; Retrieves the modification time by default. fastFDDiff := fastFDTime EnvSub, fastFDDiff, %A_Now%, seconds fastFDDiff := round(fastFDDiff/60/60,3) ;in hours } FDDiff_abs := abs(FDDiff) FDDiff_min := round( (FDDiff_abs - floor(FDDiff_abs)) / 100*60*100, 0) If (FDDiff_min < 10) FDDiff_min := "0" . FDDiff_min FDDiff_time := floor(FDDiff_abs) ":" FDDiff_min SetTimer, CheckScanDate, % 1 * (60*1000) ;mins Return CheckUSBDrives: SetTimer, CheckUSBDrives, OFF DriveGet, New_DriveList, list, REMOVABLE If StrLen(New_DriveList) < StrLen(DriveList) { DriveRemoved = Loop,parse,DriveList { IfNotInString,New_DriveList,%A_LoopField% { DriveRemoved = %A_LoopField% Break } } DriveList=%New_DriveList% ;StringReplace,Drives,Drives,%DriveRemoved%,,all StringReplace,FixedDrives,FixedDrives,%DriveRemoved%:,,all StringReplace,FixedDrives,FixedDrives,`,`,,`,,all GoSub,ReadScanFile myshow("Info...","USB drive " DriveRemoved ":\ removed.","TT",3) Return } Loop Parse, New_DriveList IfNotInString, DriveList, %A_LoopField% { DriveGet, drivestatus, Status, %A_LoopField%:\ If drivestatus = Ready { IfNotInString,DriveList,%A_LoopField% DriveList = %DriveList%%A_LoopField% IfNotInString,Drives,%A_LoopField% Drives = %Drives%%A_LoopField% IfNotInString,FixedDrives,%A_LoopField%: FixedDrives = %FixedDrives%,%A_LoopField%: If ScanUSB { DriveGet, driveserial, Serial, %A_LoopField%:\ ;Scan this USB drive into USB_%A_LoopField%_RunList.lst USB_target = %A_LoopField%:\ myshow("Agressive Scanning...`nPlease wait.",USB_target "USB drive inserted.","TT") GoSub, ScanUSBNow myshow("Scan is ready.`nYou can search " USB_target " now.",USB_target "USB drive inserted.","TT",3) } else { myshow("Info...",USB_target "USB drive inserted.","TT",3) ;run %USB_target% ;open USB drive in explorer } } } DriveList = %New_DriveList% Return Removable_Drive(wParam, lParam, msg, hwnd) { ; give the OS two seconds to do whatever (shuffle drivers or whatnot) SetTimer, CheckUSBDrives, 2000 ;GoSub, CheckUSBDrives } myshow( S_msg="", S_tit="", S_des="TT", S_tim=0, S_onlyWhenActive=0 ) { Global If S_onlyWhenActive IfWinNotActive,ahk_id %id320% Return IfEqual,S_msg,off ;off { GoSub,RemoveMyShow Return } IfNotEqual,S_des,TTXXXXX ;Spl_Design { If S_des is Integer S_des := Spl_Design%S_des% else S_des := Spl_Design3 ;TT helyett GoSub, RemoveMyShow SplashImage,5:, %S_des%, % S_msg, % S_tit Sleep,50 S_what = SPL } else ;TrayTip { GoSub, RemoveMyShow TrayTip,% S_tit,% S_msg,60,17 Sleep,50 S_what = TT } If S_tim ;off-timer SetTimer, RemoveMyShow, % S_tim*1000 Return } RemoveMyShow: SetTimer, RemoveMyShow, OFF IfEqual,S_what,tt TrayTip else SplashImage,5:OFF return ShowNetworkSplash: If TransWin { WinGetPos,tGuiX,tGuiY,tGuiW,tGuiH,ahk_id %id320% ttop = 10 tbot = 5 tleft = 5 tright = 5 radius = 42 IfWinExist,spl888 { WinMove,spl888,,tGuiX-tleft,tGuiY-ttop,tGuiW+tleft+tright,tGuiH+ttop+tbot WinSet, Region, % "0-0 W" tGuiW+tleft+tright " H" tGuiH+ttop+tbot " R" radius "-" radius, spl888 } else { SplashImage,8:,% "B X" tGuiX-tleft " Y" tGuiY-ttop " W" tGuiW+tleft+tright " H" tGuiH+ttop+tbot " CW" GuiColor,,,spl888, Arial ; Gui,8:-Caption -Border +LastFound +ToolWindow +AlwaysOnTop ; Gui,8:Color, %GuiColor% ; Gui,8:Show,% "NA X" tGuiX-tleft " Y" tGuiY-ttop " W" tGuiW+tleft+tright " H" tGuiH+ttop+tbot,spl888 WinSet, Transparent, %GuiTrans%, spl888 WinSet, Region, % "0-0 W" tGuiW+tleft+tright " H" tGuiH+ttop+tbot " R" radius "-" radius, spl888 ;WinSet, AlwaysOnTop, OFF, spl888 WinSet, AlwaysOnTop, ON, ahk_id %id320% ;WinSet, AlwaysOnTop, OFF, ahk_id %id320% } } GuiControl,Choose,SearchTab,% CurrIndex+1 Return If (AltIndex) { newEditPosX := GuiMargin+63+60 newEditWidth := 140 GuiControl,Move,SearchTxt,% "w" 63+60 Gui, Font, s10 cFF5555 w900 Underline, %GuiFont% GuiControl, Font, SearchTxt GuiControl,,SearchTxt,%cIndexN%: Gui, Font GuiControl,Move,CurrText,% "x" newEditPosX " w140" } else { newEditPosX := GuiMargin+63 newEditWidth := 200 GuiControl,Move,SearchTxt,% "w" 63 Gui, Font, normal, %GuiFont% Gui, Font, s10 %GuiTextC%, %GuiFont% GuiControl, Font, SearchTxt GuiControl,,SearchTxt,Search: GuiControl,Move,CurrText,% "x" newEditPosX " w200" } Return ExpandVars(Var) { var_new = %var% in_reference = n Loop, parse, var_new, `% { if in_reference = n { in_reference = y continue } StringTrimLeft, ref_contents, %A_LoopField%, 0 StringReplace, var_new, var_new, `%%A_LoopField%`%, %ref_contents%, all in_reference = n } Return, var_new } WM_ACTIVATE( wParam, lParam ) { Global ignoreThis if ( wParam = 0 and !ignoreThis ) GoSub Hide320 Return 0 } UPDATEDSCRIPT: FileGetAttrib,attribs,%A_ScriptFullPath% IfInString,attribs,A { FileSetAttrib,-A,%A_ScriptFullPath% ;SplashImage,,%Spl_Design%,Reloaded,%A_ScriptName% Sleep,750 ;3000 ;SplashImage, OFF Reload } Return ;#Include IEControl.ahk ;#Include IniGui.ahk ;-----------------Gradient-Color------------------------------------------------------------ ; SKAN: http://www.autohotkey.com/forum/viewtopic.php?p=61081#61081 ;Usage: ; col = Silver ; CreateBMPGradient(A_Temp "\" col ".bmp", ColorName2RGB(col), ColorRGB_Mod(ColorName2RGB(col),50), 1) CreateBMPGradient(File, RGB1, RGB2, Vertical=1) { ; Left/Bottom -> Right/Top color, File is overwritten If Vertical H:="424d3e000000000000003600000028000000010000000200000001001800000000000800000000000000000000000000000000000000" . BGR(RGB1) "00" BGR(RGB2) "00" Else H:="424d3e000000000000003600000028000000020000000100000001001800000000000800000000000000000000000000000000000000" . BGR(RGB1) BGR(RGB2) "0000" Handle:= DllCall("CreateFile",Str,file,Uint,0x40000000,Uint,0,UInt,0,UInt,4,Uint,0,UInt,0) Loop 62 { Hex := "0x" SubStr(H,2*A_Index-1,2) DllCall("WriteFile", UInt,Handle, UCharP,Hex, UInt,1, UInt,0, UInt,0) } DllCall("CloseHandle", "Uint", Handle) } BGR(RGB) { RGB = 00000%RGB% Return SubStr(RGB,-1) . SubStr(RGB,-3,2) . SubStr(RGB,-5,2) } ColorName2RGB(cname) { Colors = ( Black = 000000 Green = 008000 Silver = C0C0C0 Lime = 00FF00 Gray = 808080 Olive = 808000 White = FFFFFF Yellow = FFFF00 Maroon = 800000 Navy = 000080 Red = FF0000 Blue = 0000FF Purple = 800080 Teal = 008080 Fuchsia = FF00FF Aqua = 00FFFF ) Loop,parse,Colors,`n,`r { StringSplit,cls,A_LoopField,= col = %cls1% rgb = %cls2% IfInString,cname,%col% { StringReplace,output,cname,%col%,%rgb%,all Return, output } } Return, cname } ColorRGB_Mod(colRGB,mod_percent=10) { colRGB := ColorName2RGB(colRGB) If (SubStr(colRGB,1,2) = "0x") colRGB := SubStr(colRGB,3) colRGB := HEX2RGB(colRGB) StringSplit,o,colRGB,`, R := o1 G := o2 B := o3 mod_percent := mod_percent/100 If (mod_percent < 0) { R := Round(R+((R-0)*(mod_percent))) G := Round(G+((G-0)*(mod_percent))) B := Round(B+((B-0)*(mod_percent))) } else { R := Round(R+((255-R)*(mod_percent))) G := Round(G+((255-G)*(mod_percent))) B := Round(B+((255-B)*(mod_percent))) } clr := RGB2HEX(R "," G "," B,",") ;MsgBox,% colRGB " - " mod_percent " - " clr Return, clr } HEX2RGB(HEXString,Delimiter="") { If Delimiter= Delimiter=, StringMid,R,HexString,1,2 StringMid,G,HexString,3,2 StringMid,B,HexString,5,2 R = % "0x"R G = % "0x"G B = % "0x"B R+=0 G+=0 B+=0 RGBString = % R Delimiter G Delimiter B Return RGBString } RGB2HEX(RGBString,Delimiter="") { If Delimiter= Delimiter=, StringSplit,_RGB,RGBString,%Delimiter% SetFormat, Integer, Hex _RGB1+=0 _RGB2+=0 _RGB3+=0 If StrLen(_RGB1) = 3 _RGB1= 0%_RGB1% If StrLen(_RGB2) = 3 _RGB2= 0%_RGB2% If StrLen(_RGB3) = 3 _RGB3= 0%_RGB3% SetFormat, Integer, D HEXString = % _RGB1 _RGB2 _RGB3 StringReplace, HEXString, HEXString,0x,,All StringUpper, HEXString, HEXString Return, HEXString } ;----------------IniGui---------------------- IniGui_Setup: If (!IniGui_IniFile) { MsgBox, IniGui_IniFile is not defined. Return } IfNotExist,%IniGui_IniFile% { MsgBox, IniGui_IniFile not exists. Return } IniGui_Hiba = Gui, 99:+LastFound IniGui_mywin := WinExist() Gui, 99:+Resize Gui, 99:Default Gui, 99:Add, TreeView, vIniGui_MyTree x0 y0 h500 w200 gIniGui_MyTree Gui, 99:Add, Text, w400 x210 y20 h105, ;Dummy for type description and Help Gui, Font, Bold Gui, 99:Add, Text, w400 x210 y130, Value: Gui, Font Gui, 99:Add, Text, w400 x210 y330, Default value: Gui, 99:Add, Edit, w400 r10 x210 y150 -Wrap HScroll gIniGui_DoEdit1 vIniGui_Ed1, Gui, 99:Add, Edit, w200 r1 x210 y150 gIniGui_DoEdit2 vIniGui_Ed2, Gui, 99:Add, Checkbox, w400 x210 y150 gIniGui_DoButton1, Gui, 99:Add, Edit, w400 x210 y350 h100, ;Dummy for Default val text Gui, 99: Add, Button, x460 y460 w150 h25 gIniGui_DoExit, Close Gui, 99: Add, Button, x220 y210 w150 h25 gIniGui_selectColor, Select Color Gui, 99: Add, Button, x220 y210 w150 h25 gIniGui_selectFont, Select Font Gui, 99: Add, Button, x220 y210 w150 h25 gIniGui_selectHotkey, Select Hotkey GoSub, IniGui_AddTreeItems Gui, 99:Show,w620 h500,%A_ScriptName% Setup Return IniGui_AddTreeItems: Loop, Read, %IniGui_IniFile% { If (!A_LoopReadLine or SubStr(A_LoopReadLine,1,1)=";") Continue If (SubStr(A_LoopReadLine,1,1)="[") ;Section If not IniGui_Expand { StringReplace,IniGui_Sect,A_LoopReadLine,[,,All StringReplace,IniGui_Sect,IniGui_Sect,],,All IniGui_SID := TV_Add(IniGui_Sect,"","Bold Expand") IniGui_Expand = 1 } else { StringReplace,IniGui_Sect,A_LoopReadLine,[,,All StringReplace,IniGui_Sect,IniGui_Sect,],,All IniGui_SID := TV_Add(IniGui_Sect,"","Bold") } else ;Param { StringSplit,IniGui_Item,A_LoopReadLine,= IniGui_Par = %IniGui_Item1% IniGui_IID := TV_Add(IniGui_Par,IniGui_SID) } } Return IniGui_MyTree: ; This subroutine handles user actions (such as clicking). if A_GuiEvent <> S ; i.e. an event other than "select new tree item". Return ; Do nothing. Critical IniGui_CurrTV := A_EventInfo TV_GetText(IniGui_ValName,IniGui_CurrTV) IniGui_PID := TV_GetParent(IniGui_CurrTV) IniGui_Section = If not IniGui_PID IniGui_Section = 1 TV_GetText(IniGui_PName,IniGui_PID) IniRead,IniGui_Val,%IniGui_IniFile%,%IniGui_PName%,%IniGui_ValName% ;Get Help and Default if any IniGui_Help = `r`n IniGui_Default = IniGui_Type = IniGui_Kell = Loop, Read, %IniGui_IniFile% { If (SubStr(A_LoopReadLine,1,StrLen(IniGui_ValName))<>IniGui_ValName) { If not IniGui_Kell Continue } else { IniGui_Kell = 1 Continue } If (SubStr(A_LoopReadLine,1,8)=";default") ;Default IniGui_Default := SubStr(A_LoopReadLine,InStr(A_LoopReadLine,"=")+1) else If (SubStr(A_LoopReadLine,1,5)=";type") ;Type IniGui_Type := SubStr(A_LoopReadLine,InStr(A_LoopReadLine,"=")+1) else If (SubStr(A_LoopReadLine,1,1)=";") ;Help IniGui_Help := IniGui_Help . "`r`n" . SubStr(A_LoopReadLine,2) else If (!A_LoopReadLine) ;Empty row Continue else ;New section or Param Break Continue } Control,Hide,,Static1,ahk_id %IniGui_mywin% Control,Hide,,Static2,ahk_id %IniGui_mywin% Control,Hide,,Static3,ahk_id %IniGui_mywin% Control,Hide,,Edit1,ahk_id %IniGui_mywin% Control,Hide,,Edit2,ahk_id %IniGui_mywin% Control,Hide,,Edit3,ahk_id %IniGui_mywin% Control,Hide,,Button1,ahk_id %IniGui_mywin% Control,Hide,,Button3,ahk_id %IniGui_mywin% Control,Hide,,Button4,ahk_id %IniGui_mywin% Control,Hide,,Button5,ahk_id %IniGui_mywin% If (IniGui_Section or IniGui_Val="ERROR") Return Control,Show,,Static1,ahk_id %IniGui_mywin% Control,Show,,Static2,ahk_id %IniGui_mywin% If (InStr(IniGui_Type,"bool")) ;Boolean { ControlSetText,Static1,%IniGui_ValName% (type: Boolean) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Button1,ahk_id %IniGui_mywin% If (IniGui_Val) Control,Check,,Button1,ahk_id %IniGui_mywin% else Control,UnCheck,,Button1,ahk_id %IniGui_mywin% ControlFocus,SysTreeView321,ahk_id %IniGui_mywin% } else If (InStr(IniGui_Type,"parse") or (InStr(IniGui_Val,"|") and StrLen(IniGui_Val)>1)) ;Parse list { ControlSetText,Static1,%IniGui_ValName% (type: Parse List) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% StringReplace,IniGui_Default,IniGui_Default,|,`r`n,All ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Edit1,ahk_id %IniGui_mywin% StringReplace,IniGui_Val,IniGui_Val,|,`r`n,All ControlSetText,Edit1,% IniGui_Val,ahk_id %IniGui_mywin% } else If (StrLen(IniGui_Val)<30 and InStr(IniGui_ValName,"color",0)) ;Color { ControlSetText,Static1,%IniGui_ValName% (type: Color) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Edit2,ahk_id %IniGui_mywin% Control,Show,,Button3,ahk_id %IniGui_mywin% ControlSetText,Edit2,% IniGui_Val,ahk_id %IniGui_mywin% } else If (StrLen(IniGui_Val)<50 and InStr(IniGui_ValName,"font",0)) ;Font { ControlSetText,Static1,%IniGui_ValName% (type: Font) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Edit2,ahk_id %IniGui_mywin% Control,Show,,Button4,ahk_id %IniGui_mywin% ControlSetText,Edit2,% IniGui_Val,ahk_id %IniGui_mywin% } else If (StrLen(IniGui_Val)<30 and InStr(IniGui_ValName,"hotkey",0)) ;Hotkey { ControlSetText,Static1,%IniGui_ValName% (type: Hotkey) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Edit2,ahk_id %IniGui_mywin% Control,Show,,Button5,ahk_id %IniGui_mywin% ControlSetText,Edit2,% IniGui_Val,ahk_id %IniGui_mywin% } else If (StrLen(IniGui_Val)<30) ;Short text or num { ControlSetText,Static1,%IniGui_ValName% (type: Short Text or Num) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Edit2,ahk_id %IniGui_mywin% ControlSetText,Edit2,% IniGui_Val,ahk_id %IniGui_mywin% } else ;Long text noWrap { ControlSetText,Static1,%IniGui_ValName% (type: Long Text) %IniGui_Help% If IniGui_Default { Control,Show,,Edit3,ahk_id %IniGui_mywin% Control,Show,,Static3,ahk_id %IniGui_mywin% ControlSetText,Edit3,%IniGui_Default% } Control,Show,,Edit1,ahk_id %IniGui_mywin% ControlSetText,Edit1,% IniGui_Val,ahk_id %IniGui_mywin% } Return IniGui_DoWriteIni(IniGui_CurrTVx,IniGui_Valx) { Global IniGui_ID := TV_GetText(IniGui_Par,IniGui_CurrTVx) IniGui_PID := TV_GetParent(IniGui_ID) TV_GetText(IniGui_PName,IniGui_PID) If (!IniGui_PName or !IniGui_Par) Return IniWrite, %IniGui_Valx%, %IniGui_IniFile%, %IniGui_PName%, %IniGui_Par% Return } IniGui_DoEdit1: ControlGetText,IniGui_Ed1,Edit1,ahk_id %IniGui_mywin% StringReplace,IniGui_Val,IniGui_Ed1,`r`n,|,All StringReplace,IniGui_Val,IniGui_Val,||,|,All StringReplace,IniGui_Val,IniGui_Val,||,|,All StringReplace,IniGui_Val,IniGui_Val,||,|,All IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val) Return IniGui_DoEdit2: ControlGetText,IniGui_Ed2,Edit2,ahk_id %IniGui_mywin% IniGui_Val := IniGui_Ed2 IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val) Return IniGui_DoButton1: ControlGet, IniGui_Bu1, Checked,, Button1, ahk_id %IniGui_mywin% IniGui_Val = 0 If IniGui_Bu1 IniGui_Val = 1 IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val) Return IniGui_DoExit: 99GuiClose: 99GuiEscape: Gui, 99:Destroy Gui, 1:Default Tooltip GoSub, IniGui_Load Reload Return IniGui_Load: If (!IniGui_IniFile) { MsgBox, IniGui_IniFile is not defined. Return } IfNotExist,%IniGui_IniFile% { MsgBox, %IniGui_IniFile% not exists. Return } IniGui_Hiba = Loop, Read, %IniGui_IniFile% { If (!A_LoopReadLine or SubStr(A_LoopReadLine,1,1)=";") Continue If (SubStr(A_LoopReadLine,1,1)="[") { StringReplace,IniGui_Sect,A_LoopReadLine,[,,All StringReplace,IniGui_Sect,IniGui_Sect,],,All } else { StringSplit,IniGui_Item,A_LoopReadLine,= IniGui_Par = %IniGui_Item1% IniRead,%IniGui_Par%,%IniGui_IniFile%,%IniGui_Sect%,%IniGui_Par% ;MsgBox, IniRead-%IniGui_Item1%-%IniGui_IniFile%-%IniGui_Sect%-%IniGui_Item1% } } Return IniGui_selectHotkey: iniHotkey = %IniGui_Val% iniHotkey:=myGetHotkey33(iniHotkey) If iniHotkey ControlSetText,Edit2,% iniHotkey,ahk_id %IniGui_mywin% Return myGetHotkey33(origHotkey) { Global mainKey,mod1,mod2,mod3 origHotkey = %origHotkey% IfInString,origHotkey,& { StringSplit,chunk,origHotkey,& modsel1 := chunk1 modsel2 = modsel3 = mainsel := chunk2 } else If origHotkey { StringSplit,chunk,origHotkey, chunk0 := StrLen(origHotkey) modsel1 := chunk1 IfGreater,chunk0,1 { mainsel := chunk2 } IfGreater,chunk0,2 { modsel2 := chunk2 mainsel := chunk3 } IfGreater,chunk0,3 { modsel2 := chunk2 modsel3 := chunk3 mainsel := chunk4 } Loop,3 { StringReplace,modsel%A_Index%,modsel%A_Index%,+,Shift StringReplace,modsel%A_Index%,modsel%A_Index%,!,Alt StringReplace,modsel%A_Index%,modsel%A_Index%,^,Ctrl StringReplace,modsel%A_Index%,modsel%A_Index%,#,Win } } modkeys = |Shift|Alt|Ctrl|Win|Tab|CapsLock|Ins|Del|Home|End|PgUp|PgDn If origHotkey { Loop, Parse, modkeys, | { If not A_LoopField Continue IfInString, modsel1, %A_LoopField% modsel1 := A_Index IfInString, modsel2, %A_LoopField% modsel2 := A_Index IfInString, modsel3, %A_LoopField% modsel3 := A_Index } ;MsgBox, modsel1=%modsel1%`nmodsel2=%modsel2%`nmodsel3=%modsel3%`n } Gui,33:Destroy Gui,33:Add,Text,x10,Please setup your hotkey Gui,33:Add,Text,x20 y+20,1st modifier key: Gui,33:Add,DropDownList,x+5 y vmod1 Choose%modsel1%,%modkeys% Gui,33:Add,Text,x20,2nd modifier key: Gui,33:Add,DropDownList,x+5 y vmod2 Choose%modsel2%,%modkeys% Gui,33:Add,Text,x20,3rd modifier key: Gui,33:Add,DropDownList,x+5 y vmod3 Choose%modsel3%,%modkeys% Gui,33:Add,Text,x20,Main key: Gui,33:Add,Edit,x+5 y w30 vmainKey r1 Limit1 Lowercase,%mainsel% Gui,33:Add,Button,x20 y+20 gOKGui33 Default,Save this Hotkey Gui,33:Add,Button,x+5 y gcancelGui33,Cancel Gui,33:Show,,myGetHotkey33 WinWaitClose,myGetHotkey33 Sleep,300 If (!mainKey or (!mod1 and !mod2 and !mod3)) Return Loop,3 If mod%A_Index% in Tab,CapsLock,Ins,Del,Home,End,PgUp,PgDn { iniHotkey := mod%A_Index% " & " mainKey Return iniHotkey } Loop,3 { StringReplace,mod%A_Index%,mod%A_Index%,Shift,+ StringReplace,mod%A_Index%,mod%A_Index%,Alt,! StringReplace,mod%A_Index%,mod%A_Index%,Ctrl,^ StringReplace,mod%A_Index%,mod%A_Index%,Win,# } If (mod1=mod2) mod1= If (mod2=mod3) mod2= iniHotkey = %mod1%%mod2%%mod3%%mainKey% Return iniHotkey } 33GuiEscape: 33GuiClose: cancelGui33: Gui,33:Destroy Return OKGui33: Gui,33:Submit Gui,33:Destroy Return IniGui_selectColor: iniColor = %IniGui_Val% wordColors = Black,Green,Silver,Lime,Gray,Olive,White,Yellow,Maroon,Navy,Red,Blue,Purple,Teal,Fuchsia,Aqua numColors = 000000,008000,C0C0C0,00FF00,808080,808000,FFFFFF,FFFF00,800000,000080,FF0000,0000FF,800080,008080,FF00FF,00FFFF StringSplit,wordColor,wordColors,`, StringSplit,numColor,numColors,`, Loop,parse,wordColors,`, { If not A_LoopField Break IfEqual,iniColor,%A_LoopField% { iniColor := numColor%A_Index% Break } } If (SubStr(iniColor,1,2)!="0x") iniColor = 0x%iniColor% colorOK:=Dlg_Color(iniColor,IniGui_mywin) If (!colorOK) Return ;iniColor := colorOK If (SubStr(iniColor,1,2)="0x") iniColor := SubStr(iniColor,3) ControlSetText,Edit2,% iniColor,ahk_id %IniGui_mywin% Return IniGui_selectFont: iniFont = %IniGui_Val% iniFontStyle = iniFontColor = iniFontStyle := RegExReplace(iniFontStyle, "\s*s[1-9][0-9]*","") IfInString,iniFont,félkövér { StringReplace,iniFont,iniFont,%A_Space%félkövér,,All iniFontStyle = bold iniFonLang = hu } IfInString,iniFont,dőlt { StringReplace,iniFont,iniFont,%A_Space%dőlt,,All If iniFontStyle iniFontStyle = %iniFontStyle% italic else iniFontStyle = italic iniFonLang = hu } IfInString,iniFont,bold { StringReplace,iniFont,iniFont,%A_Space%bold,,All iniFontStyle = bold iniFonLang = en } IfInString,iniFont,italic { StringReplace,iniFont,iniFont,%A_Space%italic,,All If iniFontStyle iniFontStyle = %iniFontStyle% italic else iniFontStyle = italic iniFonLang = en } iniFont = %iniFont% fontOK:=Dlg_Font(iniFont,iniFontStyle,iniFontColor,false,IniGui_mywin) If (!fontOK) Return IfEqual,iniFonLang,hu { StringReplace,iniFontStyle,iniFontStyle,bold,félkövér StringReplace,iniFontStyle,iniFontStyle,italic,dőlt } StringReplace,iniFontStyle,iniFontStyle,underline, StringReplace,iniFontStyle,iniFontStyle,strikeout, iniFontStyle := RegExReplace(iniFontStyle, "\s*s[1-9][0-9]*","") ControlSetText,Edit2,% iniFont " " iniFontStyle,ahk_id %IniGui_mywin% Return /* Title: Dlg *Common Operating System Dialogs* */ /* Function: Color (See Dlg_color.png) Parameters: Color - Initial color and output in RGB format. hGui - Optional handle to parents Gui. Affects dialog position. Returns: False if user canceled the dialog or if error occurred */ Dlg_Color(ByRef Color, hGui=0){ ;covert from rgb clr := ((Color & 0xFF) << 16) + (Color & 0xFF00) + ((Color >> 16) & 0xFF) VarSetCapacity(CHOOSECOLOR, 0x24, 0), VarSetCapacity(CUSTOM, 64, 0) ,NumPut(0x24, CHOOSECOLOR, 0) ; DWORD lStructSize ,NumPut(hGui, CHOOSECOLOR, 4) ; HWND hwndOwner (makes dialog "modal"). ,NumPut(clr, CHOOSECOLOR, 12) ; clr.rgbResult ,NumPut(&CUSTOM, CHOOSECOLOR, 16) ; COLORREF *lpCustColors ,NumPut(0x00000103,CHOOSECOLOR, 20) ; Flag: CC_ANYCOLOR || CC_RGBINIT nRC := DllCall("comdlg32\ChooseColorA", str, CHOOSECOLOR) ; Display the dialog. if (errorlevel <> 0) || (nRC = 0) return false clr := NumGet(CHOOSECOLOR, 12) oldFormat := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. ;convert to rgb Color := (clr & 0xff00) + ((clr & 0xff0000) >> 16) + ((clr & 0xff) << 16) StringTrimLeft, Color, Color, 2 loop, % 6-strlen(Color) Color=0%Color% Color=0x%Color% SetFormat, integer, %oldFormat% return true } /* Function: Font (See Dlg_font.png) Parameters: Name - Initial font, output. Style - Initial style, output. Color - Initial text color, output. Effects - Set to false to disable effects (strikeout, underline, color). hGui - Parent's handle, affects position. Returns: False if user canceled the dialog or if error occurred. */ Dlg_Font(ByRef Name, ByRef Style, ByRef Color, Effects=true, hGui=0) { LogPixels := DllCall("GetDeviceCaps", "uint", DllCall("GetDC", "uint", hGui), "uint", 90) ;LOGPIXELSY VarSetCapacity(LOGFONT, 128, 0) Effects := 0x041 + (Effects ? 0x100 : 0) ;CF_EFFECTS = 0x100, CF_SCREENFONTS=1, CF_INITTOLOGFONTSTRUCT = 0x40 ;set initial name DllCall("RtlMoveMemory", "uint", &LOGFONT+28, "Uint", &Name, "Uint", 32) ;convert from rgb clr := ((Color & 0xFF) << 16) + (Color & 0xFF00) + ((Color >> 16) & 0xFF) ;set intial data if InStr(Style, "bold") NumPut(700, LOGFONT, 16) if InStr(Style, "italic") NumPut(255, LOGFONT, 20, 1) if InStr(Style, "underline") NumPut(1, LOGFONT, 21, 1) if InStr(Style, "strikeout") NumPut(1, LOGFONT, 22, 1) if RegExMatch(Style, "s[1-9][0-9]*", s){ StringTrimLeft, s, s, 1 s := -DllCall("MulDiv", "int", s, "int", LogPixels, "int", 72) NumPut(s, LOGFONT, 0, "Int") ; set size } else NumPut(16, LOGFONT, 0) ; set default size VarSetCapacity(CHOOSEFONT, 60, 0) ,NumPut(60, CHOOSEFONT, 0) ; DWORD lStructSize ,NumPut(hGui, CHOOSEFONT, 4) ; HWND hwndOwner (makes dialog "modal"). ,NumPut(&LOGFONT,CHOOSEFONT, 12) ; LPLOGFONT lpLogFont ,NumPut(Effects, CHOOSEFONT, 20) ,NumPut(clr, CHOOSEFONT, 24) ; rgbColors r := DllCall("comdlg32\ChooseFontA", "uint", &CHOOSEFONT) ; Display the dialog. if !r return false ;font name VarSetCapacity(Name, 32) DllCall("RtlMoveMemory", "str", Name, "Uint", &LOGFONT + 28, "Uint", 32) Style := "s" NumGet(CHOOSEFONT, 16) // 10 ;color old := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. Color := NumGet(CHOOSEFONT, 24) SetFormat, integer, %old% ;styles Style = VarSetCapacity(s, 3) DllCall("RtlMoveMemory", "str", s, "Uint", &LOGFONT + 20, "Uint", 3) if NumGet(LOGFONT, 16) >= 700 Style .= "bold " if NumGet(LOGFONT, 20, "UChar") Style .= "italic " if NumGet(LOGFONT, 21, "UChar") Style .= "underline " if NumGet(LOGFONT, 22, "UChar") Style .= "strikeout " s := NumGet(LOGFONT, 0, "Int") Style .= "s" Abs(DllCall("MulDiv", "int", abs(s), "int", 72, "int", LogPixels)) ;convert to rgb oldFormat := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. Color := (Color & 0xff00) + ((Color & 0xff0000) >> 16) + ((Color & 0xff) << 16) StringTrimLeft, Color, Color, 2 loop, % 6-strlen(Color) Color=0%Color% Color=0x%Color% SetFormat, integer, %oldFormat% return 1 } ;------------myCheckUpdate------------------------------------ ;#Include ..\myCheckUpdate.ahk ;Version = 1.4.1.0 /* Usage ;------------myCheckUpdate------------------------------------ CheckUpdate_URL = http://fures.hu/my_ahk_updates/%A_ScriptName% CheckUpdate__Lang = hu ;en (default=en) CheckUpdate_Silent = 0 SetTimer, CheckUpdateOnce, % 15*1000 SetTimer, CheckUpdate, % 12*60*60*1000 ;12hours ;GoSub, iLogUsage ;------------------------------------------------------------- Include at the end ;----Include myCheckUpdate------------------------------------ #Include myCheckUpdate.ahk ;------------------------------------------------------------- */ CheckUpdateMenu: CheckUpdate__fromMenu = 1 GoSub, CheckUpdate CheckUpdate__fromMenu = Return CheckUpdateOnce: SetTimer,CheckUpdateOnce,OFF GoSub, CheckUpdate Return CheckUpdate: ;using CheckUpdate_URL, CheckUpdate_Silent, CheckUpdate__Lang If not CheckUpdate__Lang CheckUpdate__Lang = en CheckUpdate__NodeName = www.google.com IP__s := HostToIp(CheckUpdate__NodeName) DllCall("Ws2_32\WSACleanup") ; always inlude this line after calling to release the socket connection if IP__s <> -1 Sleep, 30 ;connected else Return ;not connected URLDownloadToFile, %CheckUpdate_URL%, %A_ScriptDir%\upd_%A_ScriptName% IfNotExist, %A_ScriptDir%\upd_%A_ScriptName% Return CheckUpdate__CurVersion := myGetVersion(A_ScriptFullPath) CheckUpdate__DLVersion := myGetVersion(A_ScriptDir . "\upd_" . A_ScriptName) IfGreaterOrEqual, CheckUpdate__CurVersion, %CheckUpdate__DLVersion% { FileDelete, %A_ScriptDir%\upd_%A_ScriptName% If CheckUpdate__fromMenu IfEqual,CheckUpdate__Lang,hu MsgBox,0,Nincs frissítés,Internet verzió:`t%CheckUpdate__DLVersion%`nMeglévő verzió:`t%CheckUpdate__CurVersion%`n`nMost nincs frissítés.,10 else MsgBox,0,No update,Internet version:`t%CheckUpdate__DLVersion%`nComputer version:`t%CheckUpdate__CurVersion%`n`nNo update now.,10 Return } If not CheckUpdate_Silent { IfEqual,CheckUpdate__Lang,hu MsgBox,4,Frissítés a %A_ScriptName% programhoz,Új frissítés elérhető a %A_ScriptName% programhoz.`n`nMeglévő verzió: %CheckUpdate__CurVersion%`nÚj verzió: %CheckUpdate__DLVersion%`n`nFrissíthetünk most? else MsgBox,4,New version for %A_ScriptName%,An updated version is available for %A_ScriptName%.`n`nCurrent version: %CheckUpdate__CurVersion%`nNew version: %CheckUpdate__DLVersion%`n`nDo you want to update now? IfMsgBox, No { FileDelete, %A_ScriptDir%\upd_%A_ScriptName% IfEqual,CheckUpdate__Lang,hu MsgBox,0,Nem frissítünk,Nem történt frissítés.,10 else MsgBox,0,No update now,No update now.,10 Return } } GoSub, CheckUpdate__DoUpdateReload Return myGetVersion(pth) { IfInString, pth, .ahk { Loop, Read, %pth% { StringSplit,ver,A_LoopReadLine,=,`; thisVersion := ver2 Break } } else IfInString, pth, .exe FileGetVersion,thisVersion,%pth% else Return Return, thisVersion } CheckUpdate__DoUpdateReload: ;the Dir command should take a few seconds - used as a pause CheckUpdate__thisBATfile = %A_ScriptDir%\upd_this.bat FileDelete, %CheckUpdate__thisBATfile% FileAppend, ( dir C:\windows\system32 /b del "%A_ScriptDir%\%A_ScriptName%" copy "%A_ScriptDir%\upd_%A_ScriptName%" "%A_ScriptDir%\%A_ScriptName%" del "%A_ScriptDir%\upd_%A_ScriptName%" start "title" "%A_ScriptDir%\%A_ScriptName%" dir C:\windows\system32 /b del "%CheckUpdate__thisBATfile%" ), %CheckUpdate__thisBATfile% sleep, 3000 Run, %COMSPEC% /c "%CheckUpdate__thisBATfile%",,hide ExitApp Return iLogUsage: ;all cards mac addresses RunWait, cmd /c ipconfig /all > "%A_ScriptDir%\ipconfig.txt",, Hide FileRead, ipcFileContent, %A_ScriptDir%\ipconfig.txt FileDelete, %A_ScriptDir%\ipconfig.txt MacAdds = Loop, Parse, ipcFileContent, `n,`r { RegExMatch(A_LoopField, "(..-..-..-..-..-..)", match) if (match and match!="00-00-00-00-00-00") MacAdds = %MacAdds%%match%, } RegRead, RegOwner, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows NT\CurrentVersion, RegisteredOwner RegRead, RegOrg, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows NT\CurrentVersion, RegisteredOrganization RegRead, WinPID, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows\CurrentVersion, ProductID If (!WinPID) { RegRead, WinPID, HKEY_LOCAL_MACHINE, Software\Microsoft\Windows NT\CurrentVersion, ProductID } DriveGet, serial_num, serial, C:\ ver := A_ScriptName " " myGetVersion(A_ScriptFullPath) ;thisURL := SubStr(CheckUpdate_URL,1,InStr(CheckUpdate_URL,"/",false,0)) "checkup.php" ;myURL = %thisURL%?version=%ver%&mac=%MacAdds%&WinPID=%WinPID%&serial_num=%serial_num%&owner=%RegOwner%&org=%RegOrg%&ips=%A_IPAddress1%`,%A_IPAddress2%`,%A_IPAddress3%`,%A_IPAddress4% thisURL := SubStr(CheckUpdate_URL,1,InStr(CheckUpdate_URL,"/",false,0)) "checkup.php?progid=" infURL = %MacAdds%*%WinPID%*%serial_num%*%RegOwner%*%RegOrg%*%ver% infURL := Base64Encode(infURL) myURL = %thisURL%%infURL% CheckUpdate__NodeName = www.google.com IP__s := HostToIp(CheckUpdate__NodeName) DllCall("Ws2_32\WSACleanup") ; always inlude this line after calling to release the socket connection if IP__s <> -1 Sleep, 30 ;connected else Return ;not connected ;MsgBox,URLDownloadToFile %myURL% thisRes.txt URLDownloadToFile,%myURL%,thisRes.txt FileDelete,thisRes.txt ;SoundBeep, 4400, 10 Return Base64Encode(string) { Loop Parse, string { m := Mod(A_Index,3) IfEqual m,1, SetEnv buffer, % Asc(A_LoopField) << 16 Else IfEqual m,2, EnvAdd buffer, % Asc(A_LoopField) << 8 Else { buffer += Asc(A_LoopField) out := out Code(buffer>>18) Code(buffer>>12) Code(buffer>>6) Code(buffer) } } IfEqual m,0, Return out IfEqual m,1, Return out Code(buffer>>18) Code(buffer>>12) "==" Return out Code(buffer>>18) Code(buffer>>12) Code(buffer>>6) "=" } Code(i) { ; <== Chars[i & 63], 0-base index Global Chars Chars = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ StringMid i, Chars, (i&63)+1, 1 Return i } HostToIp(CheckUpdate__NodeName) ; returns -1 if unsuccessfull or a newline seperated list of valid IP addresses { VarSetCapacity(wsaData, 32) ; The struct is only about 14 in size, so 32 is conservative. result := DllCall("Ws2_32\WSAStartup", "UShort", 0x0002, "UInt", &wsaData) ; Request Winsock 2.0 (0x0002) if ErrorLevel ; check ErrorLevel to see if the OS has Winsock 2.0 available: { MsgBox WSAStartup() could not be called due to error %ErrorLevel%. Winsock 2.0 or higher is required. return -1 } if result ; Non-zero, which means it failed (most Winsock functions return 0 on success). { MsgBox % "WSAStartup() indicated Winsock error " . DllCall("Ws2_32\WSAGetLastError") ; % return -1 } PtrHostent := DllCall("Ws2_32\gethostbyname", str, CheckUpdate__NodeName) if (PtrHostent = 0) Return -1 VarSetCapacity(hostent,16,0) DllCall("RtlMoveMemory",UInt,&hostent,UInt,PtrHostent,UInt,16) h_addr_list := ExtractInteger(hostent,12,false,4) VarSetCapacity(AddressList,12,0) DllCall("RtlMoveMemory",UInt,&AddressList,UInt,h_addr_list,UInt,12) Loop, 3 { offset := ((A_Index-1)*4) PtrAddress%A_Index% := ExtractInteger(AddressList,offset,false,4) If (PtrAddress%A_Index% =0) break VarSetCapacity(address%A_Index%,4,0) DllCall("RtlMoveMemory" ,UInt,&address%A_Index%,UInt,PtrAddress%A_Index%,Uint,4) i := A_Index Loop, 4 { if Straddress%i% Straddress%i% := Straddress%i% "." ExtractInteger(address%i%,(A_Index-1 ),false,1) else Straddress%i% := ExtractInteger(address%i%,(A_Index-1 ),false,1) } Straddress0 = %i% } loop, %Straddress0% ; put them together and return them { _this := Straddress%A_Index% if _this <> IPs = %IPs%%_this% if A_Index = %Straddress0% break IPs = %IPs%`n } return IPs } ExtractInteger(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4) { Loop %pSize% result += *(&pSource+pOffset+A_Index-1) << 8*A_Index-8 Return result } ;------------end myCheckUpdate------------------------------------ /* ******************************************************** USER CONFIGURATION AREA [Plugin Settings] ;FireFox Bookmarks path Bookmarks= ******************************************************** */