- Additional fixes for Windows 10 user profile spaces

This commit is contained in:
Ben Reaves
2020-08-24 14:30:50 -05:00
parent b1c361080a
commit 0a5c526941
2 changed files with 8 additions and 7 deletions

View File

@@ -11,13 +11,12 @@ WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr")
notify_change(wParam, lParam, msg, hwnd)
{
global lastkb
; kbtype = % ComObjCreate("WScript.Shell").Exec("cscript /nologo usb.vbs").StdOut.ReadAll()
DetectHiddenWindows On
Run %ComSpec%,, Hide, pid
WinWait ahk_pid %pid%
DllCall("AttachConsole", "UInt", pid)
WshShell := ComObjCreate("Wscript.Shell")
exec := WshShell.Exec("cscript /nologo usb.vbs")
exec := WshShell.Exec("cscript /nologo ""%userprofile%\.kinto\usb.vbs""")
kbtype := exec.StdOut.ReadAll()
DllCall("FreeConsole")
Process Close, %pid%

View File

@@ -1,5 +1,5 @@
Option Explicit
Dim oWMISrv, collDvcs, iUSBDvc , iDvc, sDvcID, sPID, sVID
Dim oWMISrv, collDvcs, iUSBDvc , iDvc, sDvcID, sPID, sVID, deviceID
' add item to array
Function AddItem(arr, val)
@@ -49,21 +49,23 @@ Dim nonApple: nonApple = 0
Dim i
If vcount = 1 Then
deviceID = deviceVID(0)
If StrComp(deviceVID(0), "05AC") = 0 Then
Wscript.Echo "Apple"
Wscript.Echo "Apple " & deviceID
Else
Wscript.Echo "Windows"
Wscript.Echo "Windows " & deviceID
End If
Else
For i = 0 To counter-1
deviceID = deviceVID(i)
If StrComp(deviceVID(i), "05AC") = -1 Then
nonApple = 1
End If
Next
If nonApple = 1 Then
Wscript.Echo "Windows"
Wscript.Echo "Windows " & deviceID
Else
Wscript.Echo "Apple"
Wscript.Echo "Apple " & deviceID
End If
End If