;- select a file to see info in GUI-Child > txt-files or also ( picture,MP3,MP4 > needs exiftool )
;- EDIT some system Info's
;-
Code: Select all
;- ActiveX-Explorer , select defined folders with DDL
;- select a file to see info in GUI-3 > txt or ( picture,MP3,MP4 > needs exiftool )
;- some systeminfo's
;-
;- MODIFIED = 20240324
;- CREATED = 20240323
;-
#Requires AutoHotkey v1.1.33.11
#warn
#noenv
Fileencoding,UTF-8
name1:="ACTIVEX_Explorer"
setworkingdir,%a_scriptdir%
Gui,2:default
Gui,2: +HwndAId +0x2000000
Gui,2: -DPIScale
Gui,2:Color,Black,Black
wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
;- maybe change fontsize
if (wa=3840)
Gui,2:Font,s12 cYellow,Lucida Console
else if (wa=1920)
Gui,2:Font,s10 cYellow,Lucida Console
else
Gui,2:Font,s8 cYellow,Lucida Console
;-
currentpath:=a_desktop
clipboard:=""
global currentpath,ak
;--------------------
e1x=
(Ltrim join|
a_desktop ;%a_desktop%
C:\ ;C:\
E:\ ;E:\
a_desktopcommon ;%a_desktopcommon%
a_mydocuments ;%a_mydocuments%
a_programfiles ;%a_programfiles%
a_programs ;%a_programs%
a_windir ;%a_windir%
a_appdata ;%a_appdata%
a_appdatacommon ;%a_appdatacommon%
a_programs ;%a_programs%
a_programscommon ;%a_programscommon%
a_startmenucommon ;%a_startmenucommon%
a_startmenu ;%a_startmenu%
a_startupcommon ;%a_startupcommon%
a_startup ;%a_startup%
)
e2x:=ShellFolder()
sort,e1x
sort,e2x
e3x=%e1x%|%e2x%
;---------------------------------------------------------------------
x:=(wa*17)/xx,y:=(ha*1)/xx,w:=(wa*65)/xx,
Gui,2: Add,Edit,x%x% y%y% w%w% r1 vPath,
x:=(wa*82.5)/xx,y:=(ha*1)/xx,w:=(wa*2.7)/xx,h:=(ha*2.5)/xx
Gui,2: Add, Button,x%x% y%y% w%w% h%h% gGO1,<GO
x:=(wa*85.5)/xx,y:=(ha*1)/xx,w:=(wa*3.5)/xx,h:=(ha*2.5)/xx
Gui,2: Add, Button,x%x% y%y% w%w% h%h% gBack,<BACK
;-
x:=(wa*17)/xx,y:=(ha*4)/xx,w:=(wa*65)/xx,
Gui,2: Add,Edit,x%x% y%y% w%w% r1 vED0,
;-
;---------------------------------------------------------------------
x:=(wa*1)/xx,y:=(ha*2)/xx,w:=(wa*15)/xx
Gui,2: Add, DropDownList,x%x% y%y% w%w% vddl1 gGo2,%e3x% ;- dropdownlist
x:=(wa*17)/xx,y:=(ha*7)/xx,w:=(wa*72)/xx,h:=(ha*82)/xx
Gui,2: Add, ActiveX, vWB x%x% y%y% w%w% h%h%, Shell.Explorer,%a_desktop%
ComObjConnect(WB, WB_events) ; Connect WB's events to the WB_events class object.
;-
;-
;-
x:=(wa*1)/xx,y:=(ha*51)/xx,w:=(wa*9)/xx,h:=(ha*2.7)/xx
Gui,2: Add, Button,x%x% y%y% w%w% h%h% gSystemInfo1,System-Info-1
;
x:=(wa*1)/xx,y:=(ha*54)/xx,w:=(wa*9)/xx,h:=(ha*2.7)/xx
Gui,2: Add, Button,x%x% y%y% w%w% h%h% gSystemInfo2,System-Info-2
;-
x:=(wa*1)/xx,y:=(ha*57)/xx,w:=(wa*9)/xx,h:=(ha*2.7)/xx
Gui,2: Add, Button,x%x% y%y% w%w% h%h% gSpeedtest,Speedtest-Ookla
;-
;-
;-
x:=(wa*17)/xx,y:=(ha*90)/xx,w:=(wa*12)/xx,h:=(ha*2.5)/xx
Gui,2: Add, Button,x%x% y%y% w%w% h%h% gGO1 vReturnx, RETURN to EXPLORER
;-
x:=(wa*.1)/xx,y:=(ha*.1)/xx,w:=(wa*92)/xx,h:=(ha*94)/xx
Gui,2:Show, x%x% y%y% w%w% h%h%,%name1%
;GuiControl,2: Choose,DDL1,1
GuiControl,2: Choosestring,DDL1,a_programfiles
settimer,aas2,1000
Guicontrol,2: Disable , Returnx
gosub,go2
return
;-------------------
;=============================================================
childnew:
Gui,2:submit,nohide
Gui,3: new
Gui,3:default
Gui,3: +HwndBId +0x2000000
Gui,3: -DPIScale -Caption +Border
Gui,3:Color,Black,Black
wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
;- maybe change fontsize
if (wa=3840)
Gui,3:Font,s12 cYellow,Lucida Console
else if (wa=1920)
Gui,3:Font,s10 cYellow,Lucida Console
else
Gui,3:Font,s8 cYellow,Lucida Console
;-
Gui,3:+Parent%AId%
x:=(wa*0)/xx,y:=(ha*0)/xx,w:=(wa*72)/xx,h:=(ha*82)/xx
Gui,3: Add,Edit,x%x% y%y% w%w% h%h% vED1,Line1`nLine2
x:=(wa*17)/xx,y:=(ha*7)/xx,w:=(wa*72)/xx,h:=(ha*82)/xx
gui,3: show,x%x% y%y% w%w% h%h%,TEST3
settimer,aas2,off
Guicontrol,2: Enable , Returnx
return
;==============================================================
;------------------------------
2GuiClose:
ExitApp
esc::exitapp
;-------------------
aas2:
Gui,2: submit,nohide
selx:= wb.Document.SelectedItems
ak:=""
for item in selx
{
ak:=item.path
GuiControl,2:,ED0,%ak%
}
if ak<>
gosub,infoshow
return
;==============================================================
InfoShow:
Gui,2: submit,nohide
txtx:="ahk,txt,bat,bas,ini,html,inf" ;- text
imgx:="jpg,jpeg,bmp,tif,png,wav,mp3,mp4" ;- pictures & MP3 MP4
;--
SplitPath,ED0, name, dir, ext, name_no_ext, drive
if ext in %txtx%
{
fileread,ac,%ED0%
gosub,childnew
GuiControl,3:,ED1,%ac%
ac:="",ED0:=""
return
}
if ext in %imgx%
{
PR:="D:\M_GARRY\PROGRAMME_SA\EXIFTOOL\ExifTool.exe"
ifnotexist,%PR%
{
msgbox, 262208,INFO ,PROGRAM NOT EXISTS`n%PR%
return
}
loop,%ED0%
SP1:=A_loopFileShortPath ;- DOS 8.3 to accept chinese characters
try
runwait,%comspec% /c %pr% "%sp1%" | clip,,hide
;-------------------------------------------------------
;- extract picture from a MP3 if picture exists :
;SplitPath,SP1, name2, dir2, ext2, name_no_ext2, drive2
;f1:=a_desktop . "\" . name_no_ext2 . ".png"
;runwait,%comspec% /c %pr% -b "%sp1%" >%f1%
;try,run,%f1%
;return
;-------------------------------------------------------
gosub,childnew
GuiControl,3:,ED1,%clipboard%
ED0:="",clipboard:=""
return
}
return
;----------------------
Go1: ;- firstLine
Gui,2: Submit, NoHide
Guicontrol,2: Disable , Returnx
settimer,aas2,on
Gui,3:destroy
GuiControl,2:,ED0,
WB.Navigate(path)
Return
;--------------------
Go2: ;- DDL
Gui,2: Submit, NoHide
Gui,3:destroy
GuiControl,2:,ED0,
stringsplit,k,ddl1,`;
k2=%k2%
ifexist,%k2%
WB.Navigate(k2)
else
msgbox, 262208,INFO ,NOT exists=`n%k2%
Return
;--------------------
Systeminfo2:
Gui,2: submit,nohide
GuiControl,2:,ED0
Splashimage,,b w600 h150 x10 Y400 CWsilver m9 b fs14 zh0,Wait... SystemInfo running...
runwait,%comspec% /c systeminfo | clip,,hide
Splashimage, off
gosub,childnew
GuiControl,3:,ED1,%clipboard%
clipboard:=""
return
;-------------------
Systeminfo1:
Gui,2: submit,nohide
GuiControl,2:,ED0
;-
Path = HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegRead, ProductID, %Path%, ProductID
RegRead, ProductName, %Path%, ProductName
RegRead, ReleaseID, %Path%, ReleaseID
RegRead, version, %Path%,DisplayVersion
RegRead, buildnumber, %Path%,currentbuild
RegRead, UBR, %Path%,UBR
RegRead, ProcessorName, HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0, ProcessorNameString
osinstalldate1:=OSInstallDate()
GMSEx := GlobalMemoryStatusEx()
GMSExM01 := Round(GMSEx[2] / 1024**2, 2)
RegRead, ProcessorName, HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0, ProcessorNameString
;FormatTime, Suomi , L1035, dddd MMMM yyyy-MM-dd HH:mm:ss
Formattime,USA,%a_nowutc% L0x0409,longdate
;Formattime,TT,T12,time
FormatTime,China_PRC ,%a_nowutc% L0x0804, dddd MMMM yyyy-MM-dd HH:mm:ss ;
timestamp=%usa% %china_prc% UTC
;-
e5x=
(Ltrim join`r`n
==============================
Date-Time = %timestamp%
Full-version = %A_OSVersion%.%ubr% ;-- Major.Minor.BuildNumber.UBR < UBR=Update-Build-Revision ( see also cmd =ver )
Version/Number/UBR= %version% / %BuildNumber% / %ubr%
OSinstallDate = %osinstalldate1%
Processorname = %processorname%
Memory = %GMSExM01% - MB
64-BIT = %A_Is64bitOS%
Computername = %A_ComputerName%
Productname = %ProductName%
Relese-ID = %ReleaseID%
Product-ID = %ProductID%
OS-Type = %a_ostype%
Screen = %wa%*%ha%
Username = %a_username%
IsAdmin = %a_isadmin%
AHK-Version = %a_ahkversion%
)
e6x=
(
-----------------------
Build -> "Name"
-----------------------
10240 -> "Win 10 1507"
10586 -> "Win 10 1511"
14393 -> "Win 10 1607"
15063 -> "Win 10 1703"
16299 -> "Win 10 1709"
17134 -> "Win 10 1803"
17763 -> "Win 10 1809"
18362 -> "Win 10 1903"
18363 -> "Win 10 1909"
19041 -> "Win 10 2004"
19042 -> "Win 10 20H2"
19043 -> "Win 10 21H1"
19044 -> "Win 10 21H2"
19045 -> "Win 10 22H2"
22000 -> "Win 11 21H2"
22621 -> "Win 11 22H2"
22631 -> "Win 11 23H2"
-----------------------
)
;======== WLAN PSwords =========================
;-- WLAN Windows11 SSID pswords ( Computer must be connected once with WLAN )
;--
fd:=a_scriptdir . "\WifiXMLS"
ifnotexist,%fd%
filecreatedir,%fd%
;--
RunWait, %comspec% /c "netsh wlan export profile folder=%fd% key=clear",, hide ;- Exports all WiFi profile
;RunWait, %comspec% /k "netsh wlan export profile folder=%fd% key=clear"
;--
e7x:=""
Loop, %fd%\*.xml
{
aac:=""
y:=A_LoopFileFullPath ;- this is a xml-file in folder WiFiXMLS
fileread,aac,%y%
Loop,parse,aac,`n,`r
{
x:= A_LoopField
if x contains <name>
L1:=RegExReplace( x, "<.*?>" )
if x contains <keyMaterial>
{
L2:=RegExReplace( x, "<.*?>" )
L1=%L1%
L2=%L2%
e7x .= "SSID=" . L1 "`nPassword=" . L2 . "`nXML-File=" . y . "`n----------------`n"
}
}
}
if e7x=
e7x=WiFiXLMS is empty`nComputer must be connected once with WLAN
;====================================================
gosub,childnew
GuiControl,3:,ED1,%e5x%`n==============================`n%e6x%`n=================== WLAN PSwords ===================`n%e7x%`n====================================================
e5x:="",e6x:="",e7x:=""
return
;-----------------------------
;-- https://www.autohotkey.com/boards/viewtopic.php?f=6&t=3514 jNizM
;-- A collection of small ahk functions - AutoHotkey Community
;-- https://www.autohotkey.com/boards/viewtopic.php?p=49269#p49269
OSInstallDate()
{
for objItem in ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_OperatingSystem")
{
FormatTime, InstOS, % SubStr(objItem.InstallDate, 1, 14), % "dd. MMM yyyy - HH:mm"
FormatTime, DateFrom, % SubStr(objItem.InstallDate, 1, 14), % "yyyyMMdd"
DateTo := A_Now
DateTo -= DateFrom, days
return InstOS " | (" DateTo " days)"
}
}
GlobalMemoryStatusEx() {
static MEMORYSTATUSEX, init := VarSetCapacity(MEMORYSTATUSEX, 64, 0) && NumPut(64, MEMORYSTATUSEX, "UInt")
if (DllCall("Kernel32.dll\GlobalMemoryStatusEx", "Ptr", &MEMORYSTATUSEX))
{
return { 2 : NumGet(MEMORYSTATUSEX, 8, "UInt64")
, 3 : NumGet(MEMORYSTATUSEX, 16, "UInt64")
, 4 : NumGet(MEMORYSTATUSEX, 24, "UInt64")
, 5 : NumGet(MEMORYSTATUSEX, 32, "UInt64") }
}
}
;======================================================
;-------------------------------------
Speedtest:
Gui,2: submit,nohide
GuiControl,2:,ED0
speedtestOokla:="D:\M_GARRY\PROGRAMME_SA\SPEED_TEST\ookla-speedtest-1.1.1-win64\speedtest.exe"
ifnotexist,%speedtestookla%
{
msgbox, 262208,INFO ,PROGRAM NOT EXISTS`n%speedtestookla%
return
}
Splashimage,,b w600 h150 x10 Y400 CWsilver m9 b fs14 zh0,Wait ... Internet-Speedtest running...
try,runwait,%comspec% /c %speedtestOokla% --accept-license |clip,,hide
Splashimage, off
gosub,childnew
GuiControl,3:,ED1,%clipboard%
clipboard:=""
return
;===========================================
;-------------------
Back:
Gui,2: Submit, NoHide
GuiControl,2:,ED0,
Gui,3:destroy
StringSplit, FolderArray, Path, \
FolderArray0 := FolderArray0 - 1
BackPath =
Loop, %FolderArray0%
{
BackPath .= FolderArray%a_index% "\"
}
WB.Navigate(BackPath)
Return
;-------------------------------------------
UpdateDDLPath:
GuiControlGet, CurrentPath,, Path
Gui,2: Submit, NoHide
StringSplit, FolderArray, CurrentPath, \
Loop, %FolderArray0%
{
if FolderArray%a_index% =
{
continue
}
}
Return
;============================================
;--------------------------------------------
class WB_events
{
NavigateComplete2(wb, NewPath)
{
GuiControl,2:, Path, %NewPath% ; Update the Path edit control.
Gosub, UpdateDDLPath
}
}
;-------------------------------------------
ShellFolder( VN="" ) {
v:=""
Static Subkey:="Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
If ( VN="")
{
Loop, HKCU, %SubKey%, 0
{ VarSetCapacity( Spaces,30,32 )
RegRead, Value, HKCU, %SubKey%, %A_LoopRegName%
SplitPath,value, name2, dir2, ext2, name_no_ext2, drive2
if a_loopregname contains Do not use
continue
if a_loopregname contains `{
v .= ((v<>"") ? "`n" : "" ) (Name2) " `; " Value . "|"
else
v .= ((v<>"") ? "`n" : "" ) (A_LoopRegName) " `; " Value . "|"
}
}
Else
RegRead, V, HKCU, %SubKey%, %VN%
Return V
}
;============== END SCRIPT ActiveX Explorer ============================