Git Product home page Git Product logo

Comments (21)

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

Win+Tab shows preview of windows (so this is what you want ?)
Dexpot shows preview of virtual desktops
https://www.youtube.com/watch?v=GTKWb5oaJwg

---
once I find how to get preview of windows, and showing it, then it will be easy

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

Thanks for your swift reply. Actually, I need neither of the two previews.

To be specific, the relevant Dexpot tool is called "DexTab Task switcher". It does the trick of listing all opened windows across all virtual desktops, in the layout specified in the initial post. Visually, such a list looks like the following:
image


The main reason that I'm asking for something that already exists in Dexpot is that Dexpot has not been updated for years. I'm in the middle of testing and making sure that I can completely replace Dexpot with some other tools, and here is a list of where I am with the help of VD.ahk and Rainmeter:

  • Go to certain Virtual Desktop (with VD.goToDesktopNum(1))
  • Move a window to a destination desktop (with VD.MoveWindowToDesktopNum("A",1))
  • Display the current name for the Virtual Desktop (with help of the VirtualDesktop plugin in Rainmeter, and this skin file)
  • List all open windows by virtual desktop (similar to DexTab Task Switcher)
  • Search for a window by name (TitleText or process name) across all desktops, and jump to the window by switching to the corresponding virtual desktop. (iswitchw.ahk only looks for windows in the current Virtual Desktop.)

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

thankfully, MaxSherry already implemented this
https://github.com/MaxSherry/VD.ahk/blob/master/other%20examples/list%20VD%20of%20all%20windows%20in%20menu.ahk

I changed it a bit,

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance, force
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines, -1
#KeyHistory 0
ListLines Off

SetWinDelay, -1
SetControlDelay, -1

#Include ..\_VD.ahk
VD.init()

activeWindowTitle:=""
ArrayStreamArray:=[]
MenuItemTitleLength:=100

f1::
global activeWindowTitle,ArrayStreamArray
arrayOfWindowsInfo:=[] ;to store {desktopNum:number, str:INFO}
currentDesktop:=VD.getCurrentDesktopNum()
WinGetTitle, activeWindowTitle, A

DetectHiddenWindows, on
WinGet windows, List
Loop %windows%
{
    id := windows%A_Index%
    ahk_idId := "ahk_id " id
    desktopOfWindow:=VD.getDesktopNumOfWindow(ahk_idId)
    if (desktopOfWindow > -1)
    {
        whichDesktop:="Desktop " desktopOfWindow

        WinGetTitle, OutputTitle, % ahk_idId
        WinGet, OutputProcessPath, ProcessPath, % ahk_idId

        arrayOfWindowsInfo.Push({desktopNum:desktopOfWindow, title:OutputTitle, processPath:OutputProcessPath, hwnd:id})
    }
}

arrayOfWindowsInfo:=sortArrByKey(arrayOfWindowsInfo,"desktopNum")

; i_:=arrayOfWindowsInfo.Length()
; lastDesktopNum:=arrayOfWindowsInfo[i_].desktopNum
; while (i_ > 0) {
;
    ; if (!(arrayOfWindowsInfo[i_].desktopNum == lastDesktopNum)) {
        ; lastDesktopNum:=arrayOfWindowsInfo[i_].desktopNum
        ; arrayOfWindowsInfo.InsertAt(i_ + 1, {desktopNum:-2})
    ; }
    ; i_--
; }

ArrForMenuItemPos:=[]
Try
    Menu, windows, DeleteAll

lastDesktopNum:=arrayOfWindowsInfo[1].desktopNum
for k, v in arrayOfWindowsInfo {

    if (!(v.desktopNum == lastDesktopNum)) {
        lastDesktopNum:=v.desktopNum
        Menu, windows, Add
        ArrForMenuItemPos.Push("")
        Menu, windows, Add
        ArrForMenuItemPos.Push("")
        continue
    }

    title:=SubStr(v.title, 1, MenuItemTitleLength)
    Menu, windows, Add, % title, ActivateTitle
    ArrForMenuItemPos.Push(v)
    Menu, windows, Add
    ArrForMenuItemPos.Push("")
    Try
        Menu, windows, Icon, % title, % v.ProcessPath,, 0
    Catch
        Menu, windows, Icon, % title, %A_WinDir%\System32\SHELL32.dll, 3, 0
}
DetectHiddenWindows, off

Menu, windows, Color, Silver
defaultItemTitle:=SubStr(activeWindowTitle, 1, MenuItemTitleLength)
Menu, windows, Default, % defaultItemTitle
CoordMode, Menu, Screen
WinGetPos,,, Width, Height,
Xm := (0.4*A_ScreenWidth)
Ym := (0.6*A_ScreenHeight)
; MouseGetPos, OutputVarX, OutputVarY
Menu, windows, Show, % Xm, % Ym

return

ActivateTitle:
    global ArrForMenuItemPos
    ; Tooltip % ArrForMenuItemPos[A_ThisMenuItemPos].title
    VD.goToDesktopOfWindow("ahk_id " ArrForMenuItemPos[A_ThisMenuItemPos].hwnd)
return

sortArrByKey(arr, key, sortType:="N") {
    str:=""
    for k,v in arr {
        str.=v[key] "+" k "|"
    }
    length:=arr.Length()
    Sort, str, % "D| " sortType
    finalAr:=[]
    finalAr.SetCapacity(length)
    barPos:=1
    loop %length% {
        plusPos:=InStr(str, "+",, barPos)
        barPos:=InStr(str, "|",, plusPos)

        num:=SubStr(str, plusPos + 1, barPos - plusPos - 1)
        finalAr.Push(arr[num])
    }
    return finalAr
}

f3::Exitapp

I'm now trying to make it do what you want (it doesn't show TEXT Desktop 1, Desktop 2) (but it's separated)
(also, the icons are too big compared to your image)


there could be another way, other than using this method of : Menu, ..., Add

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

image

I don't know what control that is, can you use Window Spy to look at what control that is ?
Under: Control Under Mouse Position : what's the ClassNN ?

image

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

I don't know what control that is, can you use Window Spy to look at what control that is ? Under: Control Under Mouse Position : what's the ClassNN ?

I am not sure if I understood your question, though, Window Spy from AHK does not provide any update when I summon the Dexpot tool. This is still the case when I check, in Window Spy, the "Follow Mouse" option.

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

thankfully, MaxSherry already implemented this https://github.com/MaxSherry/VD.ahk/blob/master/other%20examples/list%20VD%20of%20all%20windows%20in%20menu.ahk

Fantastic! Glad that we don't need to reinvent the wheels. Though, I ran into the following problems:

  1. The menu generated through your edited version of the script can be incomplete. For example, the top of the list includes some windows in the current virtual desktop. Yet, the list does not include all windows in the current virtual desktop. All windows in other virtual desktops are ignored.
    image
    Here is a list of all windows
    image

    Question: I have been using manually created virtual desktops as they seem to stay over reboots. Do I have to create Virtual Desktop using VD.ahk instead?

  2. <F1> may work for the first time, but not subsequent calls. A common error is "Error: Nonexistent menu item.".

Details for the error.
---------------------------
ListWindows.ahk
---------------------------
Error:  Nonexistent menu item.

Specifically: New 2 - FastStone Editor

  Line#
  080: Menu,windows,Icon,title,v.ProcessPath,,0
  081: Catch
  082: Menu,windows,Icon,title,%A_WinDir%\System32\SHELL32.dll,3,0
  083: }
  084: DetectHiddenWindows,off
  086: Menu,windows,Color,Silver
  087: defaultItemTitle := SubStr(activeWindowTitle, 1, MenuItemTitleLength)
--->	088: Menu,windows,Default,defaultItemTitle
  089: CoordMode,Menu,Screen
  090: WinGetPos,,,Width,Height
  091: Xm := (0.4*A_ScreenWidth)
  092: Ym := (0.6*A_ScreenHeight)
  094: Menu,windows,Show,Xm,Ym
  096: Return
  101: VD.goToDesktopOfWindow("ahk_id " ArrForMenuItemPos[A_ThisMenuItemPos].hwnd)  

The current thread will exit.
---------------------------
OK   
---------------------------
And, a few more of errors in the same flavor.
---------------------------
ListWindows.ahk
---------------------------
Error:  Parameter #3 must not be blank in this case.

  Line#
  075: Menu,windows,Add,title,ActivateTitle
  076: ArrForMenuItemPos.Push(v)  
  077: Menu,windows,Add
  078: ArrForMenuItemPos.Push("")  
  079: Try
  080: Menu,windows,Icon,title,v.ProcessPath,,0
  081: Catch
--->	082: Menu,windows,Icon,title,%A_WinDir%\System32\SHELL32.dll,3,0
  083: }
  084: DetectHiddenWindows,off
  086: Menu,windows,Color,Silver
  087: defaultItemTitle := SubStr(activeWindowTitle, 1, MenuItemTitleLength)
  088: Menu,windows,Default,defaultItemTitle
  089: CoordMode,Menu,Screen
  090: WinGetPos,,,Width,Height

The current thread will exit.
---------------------------
OK   
---------------------------
---------------------------
ListWindows.ahk
---------------------------
Error:  Nonexistent menu item.

Specifically: [Feature request] List all Windows and order the list by virtual desktops · Issue #13 · FuPeiJiang/V

	Line#
	080: Menu,windows,Icon,title,v.ProcessPath,,0
	081: Catch
	082: Menu,windows,Icon,title,%A_WinDir%\System32\SHELL32.dll,3,0
	083: }
	084: DetectHiddenWindows,off
	086: Menu,windows,Color,Silver
	087: defaultItemTitle := SubStr(activeWindowTitle, 1, MenuItemTitleLength)
--->	088: Menu,windows,Default,defaultItemTitle
	089: CoordMode,Menu,Screen
	090: WinGetPos,,,Width,Height
	091: Xm := (0.4*A_ScreenWidth)
	092: Ym := (0.6*A_ScreenHeight)
	094: Menu,windows,Show,Xm,Ym
	096: Return
	101: VD.goToDesktopOfWindow("ahk_id " ArrForMenuItemPos[A_ThisMenuItemPos].hwnd)  

The current thread will exit.
---------------------------
OK   
---------------------------

---------------------------
ListWindows.ahk
---------------------------
Error:  Nonexistent menu item.

Specifically: AW-_AHK_Ghost-AW💎W:DotFile_Private/AHK_Scripts

	Line#
	080: Menu,windows,Icon,title,v.ProcessPath,,0
	081: Catch
	082: Menu,windows,Icon,title,%A_WinDir%\System32\SHELL32.dll,3,0
	083: }
	084: DetectHiddenWindows,off
	086: Menu,windows,Color,Silver
	087: defaultItemTitle := SubStr(activeWindowTitle, 1, MenuItemTitleLength)
--->	088: Menu,windows,Default,defaultItemTitle
	089: CoordMode,Menu,Screen
	090: WinGetPos,,,Width,Height
	091: Xm := (0.4*A_ScreenWidth)
	092: Ym := (0.6*A_ScreenHeight)
	094: Menu,windows,Show,Xm,Ym
	096: Return
	101: VD.goToDesktopOfWindow("ahk_id " ArrForMenuItemPos[A_ThisMenuItemPos].hwnd)  

The current thread will exit.
---------------------------
OK   
---------------------------

---------------------------
ListWindows.ahk
---------------------------
Error:  Nonexistent menu item.

Specifically: llinfeng^ - Total Commander 10.00 - Linfeng Li

	Line#
	080: Menu,windows,Icon,title,v.ProcessPath,,0
	081: Catch
	082: Menu,windows,Icon,title,%A_WinDir%\System32\SHELL32.dll,3,0
	083: }
	084: DetectHiddenWindows,off
	086: Menu,windows,Color,Silver
	087: defaultItemTitle := SubStr(activeWindowTitle, 1, MenuItemTitleLength)
--->	088: Menu,windows,Default,defaultItemTitle
	089: CoordMode,Menu,Screen
	090: WinGetPos,,,Width,Height
	091: Xm := (0.4*A_ScreenWidth)
	092: Ym := (0.6*A_ScreenHeight)
	094: Menu,windows,Show,Xm,Ym
	096: Return
	101: VD.goToDesktopOfWindow("ahk_id " ArrForMenuItemPos[A_ThisMenuItemPos].hwnd)  

The current thread will exit.
---------------------------
OK   
---------------------------

  1. Additionally, icons in the menu may have inconsistent sizes. Here is a screenshot I took from a Surface tablet, which runs at 200% scaling.
    image

RE: #3 - if icons are hard to deal with under different display scaling settings, it helps to make it optional in the menu. Title texts are sufficient for identification purposes.


Oh, before we jump into addressing those problems - how's the performance in ideal conditions? Per my tests, with less than 10 windows in total and 3 virtual desktops, on the first time of calling the script, it took some 3-5 seconds generate an incomplete menu (or, it may fail on the first attempt, prompting the error above). In comparison, with Dexpot, the "DexTab Task switcher" shows up almost instantaneously.

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

re: what control is that ?

nvm, I have found the "control" (it's not really a built-in control)
https://stackoverflow.com/questions/4897584/what-is-this-control-group-box-or-not


performance in ideal conditions

run this, how many seconds does this take ?

#Include ..\VD.ahk
foundProcesses := ""
; Make sure to get all windows from all virtual desktops
DetectHiddenWindows On
WinGet, id, List
Loop %id%
{
hwnd := id%A_Index%
;VD.getDesktopNumOfWindow will filter out invalid windows
desktopNum_ := VD.getDesktopNumOfWindow("ahk_id" hwnd)
If (desktopNum_ > -1) ;-1 for invalid window, 0 for "Show on all desktops", 1 for Desktop 1
{
WinGet, exe, ProcessName, % "ahk_id" hwnd
foundProcesses .= desktopNum_ " " exe "`n"
}
}
MsgBox % foundProcesses

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

RE: performance - I was prompted with a list after 2 seconds on a Surface table.

Though, please advise if I may expect the list of processes/windows to be consistent over multiple executions of foundProcesses_min.ahk. Two consecutive runs ended up with the following variants

Menu content 1
---------------------------
foundProcess_min.ahk
---------------------------
{A6D5F318-9574-43E5-A5BD-A05AE4D84B11} TOTALCMD.EXE
{A6D5F318-9574-43E5-A5BD-A05AE4D84B11} ApplicationFrameHost.exe
{C422893C-2BC4-45D3-B702-3BE6B2E1A4C8} 
{2BFFC283-014B-4030-A8C7-0E712BFD87D4} 
{2BFFC283-014B-4030-A8C7-0E712BFD87D4} 
{C422893C-2BC4-45D3-B702-3BE6B2E1A4C8} 
{C422893C-2BC4-45D3-B702-3BE6B2E1A4C8} 
{A2B2242F-2D20-4236-A74E-BEEF02F9D1A8} 
{FDDB53E1-994E-4D5E-922C-6BB980A365E2} 

---------------------------
OK   
---------------------------
Menu content 2
---------------------------
foundProcess_min.ahk
---------------------------
{A6D5F318-9574-43E5-A5BD-A05AE4D84B11} TOTALCMD.EXE

---------------------------
OK   
---------------------------

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

2 seconds is terrible, I'll see what I can do, now I'm trying to replicate the GUI

{A6D5F318-9574-43E5-A5BD-A05AE4D84B11} TOTALCMD.EXE
it should be a number,
2 TOTALCMD.EXE
update your VD.ahk

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

2 seconds is terrible, I'll see what I can do, now I'm trying to replicate the GUI

My apologies - I updated VD.ahk and the performance is much improved. I don't see a noticeable gap between launching foundProcesses.ahk and seeing the list of windows. And, the list of windows is complete!

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance, force
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines, -1
#KeyHistory 0
ListLines Off

SetWinDelay, -1
SetControlDelay, -1

#Include ..\_VD.ahk
VD.init()

MenuItemTitleLength:=100

OnMessage( 0x0006, "HandleMessage" ) ;to detect gui lose focus

f1::
arrayOfWindowsInfo:=[] ;to store {desktopNum:number, str:INFO}

DetectHiddenWindows, on
WinGet windows, List
Loop %windows%
{
    id := windows%A_Index%
    ahk_idId := "ahk_id " id
    desktopOfWindow:=VD.getDesktopNumOfWindow(ahk_idId)
    if (desktopOfWindow > -1)
    {
        whichDesktop:="Desktop " desktopOfWindow

        WinGetTitle, OutputTitle, % ahk_idId
        WinGet, OutputProcessPath, ProcessPath, % ahk_idId

        arrayOfWindowsInfo.Push({desktopNum:desktopOfWindow, title:OutputTitle, processPath:OutputProcessPath, hwnd:id})
    }
}

arrayOfWindowsInfo:=sortArrByKey(arrayOfWindowsInfo,"desktopNum")

ArrForMenuItemPos:=[]

Gui, Destroy
Gui, New, -0xC00000

guiWidth:=600

lastDesktopNum:=-1
for k, v in arrayOfWindowsInfo {

    if (!(v.desktopNum == lastDesktopNum)) {
        lastDesktopNum:=v.desktopNum
        Gui, Add, Text, % "x10 hwndOMG", % "Desktop " v.desktopNum
        ControlGetPos, Xpos, Ypos, Width, Height,, % "ahk_id " OMG
        Gui, Add, Text, % "x+3 y+-5 0x00000005 h1 w" guiWidth - (Xpos + Width)
        continue
    }

    title:=SubStr(v.title, 1, MenuItemTitleLength)
    Gui, Add, Text, % "x20", % title
}
DetectHiddenWindows, off

CoordMode, Menu, Screen
WinGetPos,,, Width, Height,
Xm := (0.4*A_ScreenWidth)
Ym := (0.6*A_ScreenHeight)
; MouseGetPos, OutputVarX, OutputVarY
Gui, Show, % "X" Xm " Y" Ym

return

HandleMessage( p_w, p_l, p_m, p_hw )
{
    global
    ; ToolTip % p_w ", " p_l
    if (p_w==0) {
        Gui, Destroy
    }
}

sortArrByKey(arr, key, sortType:="N") {
    str:=""
    for k,v in arr {
        str.=v[key] "+" k "|"
    }
    length:=arr.Length()
    Sort, str, % "D| " sortType
    finalAr:=[]
    finalAr.SetCapacity(length)
    barPos:=1
    loop %length% {
        plusPos:=InStr(str, "+",, barPos)
        barPos:=InStr(str, "|",, plusPos)

        num:=SubStr(str, plusPos + 1, barPos - plusPos - 1)
        finalAr.Push(arr[num])
    }
    return finalAr
}

f3::Exitapp

text is not clickable, no icons, no color, text is hard to read, but the horizontal lines are done !

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

Great work! The list looks great!
image

One comment: instead of showing "Desktop #", it would be great to use the name of the virtual desktop, if possible. This helps to provide more context when navigating the list of windows.

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

my code was not working all day, I made a very dumb mistake : I thought my pc was running windows 11 while it was running windows 10, to get the desktopName, it makes a world of difference

the code is actually very simple from here : https://github.com/MScholtes/VirtualDesktop/blob/812c321e286b82a10f8050755c94d21c4b69812f/VirtualDesktop.cs#L404
there are 2 ways of doing it, I'll go with their way(registry way)(I hope it works on more windows versions), but I want to implement the HSTRING/IVirtualDesktop2 way, I implemented it, now I don't know where to save it, because I'm not adding it to the project
(save it as commented code ? new branch ? my notes ?)
(save as commented code would probably help people reading the code, just like how reading this code helped me)
https://github.com/MScholtes/VirtualDesktop/blob/812c321e286b82a10f8050755c94d21c4b69812f/VirtualDesktop.cs#L156-L173

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

actually, I did not think of my pc at all, I just went straight to windows 11 code,
I realized my mistake by going to https://github.com/pmb6tz/windows-desktop-switcher, in an attempt to copy their homework
then I thought : VirtualDesktopAccessor.dll probably isn't updated for windows 11
I go through their code, I don't find "name"
I bet windows 10 doesn't even have desktopName, I have desktopName because I'm using windows 11, wait, am I ?
oh, I'm using windows 10, how odd (I forgot I had a windows 10) (my pc feels newer than this, it can't be windows 10) (effect of marketing on my brain) (windows 11=new,faster, windows 10=old, feels new : probably windows 11)
I do like the number increase, but it reminds me of : https://github.com/gildas-lormeau/SingleFile-Lite#readme

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

It sounds like a lot of fun to confuse yourself with the Windows distribution :) I found myself testing your script, also, on a Win 10 tablet.

RE: Win 11 - I assume it runs fast on newer hardware? For my 3-year-old laptop (T480), upgrading to Win 11 ended up getting the CPU to run under a harsher thermal cap, with peak power draw dropping from 15W to 10 W or so. Last night, I did spend quite some time to get Win 10 installed back to it. RE: good features coming with Win 11 - it was a ton of fun to run Android apps (or, say, Games?) natively. Also, it was helpful to have native X-server for WSL installations.


Though, with regard to populating the list of windows with desktop name in place of desktop number, under Win 10, how to make use of the insights in this VirtualDesktop.cs file to edit your script in this post?

Reflecting on why I wrote this issue in the first place, I think I wasn't that dead-hearted to go with Win 11. It is just that I've been used to Dexpot for so long, that I was concerned that future Windows updates may break Dexpot. After all, Dexpot was last updated on September 4th 2014.

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

wait, you say Win 11 uses less power, so why install Win 10 back to it ?

I have a question: does Dexpot work on Windows 11 ?
Win 11 has API changes, if Dexpot relies on those, then it predictably should not work anymore


I'll go with their way(registry way)(I hope it works on more windows versions)

nvm, change of plans, I don't like the registry way because registry can be edited, then it wouldn't reflect the desktopName

I won't be pasting the script here because you need to update VD.ahk for this to work : Task Switcher3.ahk

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

wait, you say Win 11 uses less power, so why install Win 10 back to it ?

Oh, I forget to mention that my old laptop (T480) is generally hotter with Win 11. Then, the harsher thermal cap makes the CPU to run at a lower frequency, making the whole thing slow. I assume it is the old firmware that brought this inefficiency.

I have a question: does Dexpot work on Windows 11 ? Win 11 has API changes, if Dexpot relies on those, then it predictably should not work anymore

Dexpot still runs on Win 11.

I won't be pasting the script here because you need to update VD.ahk for this to work : Task Switcher3.ahk

And, thanks again for updating both _VD.ahk and the new script. The "Dexpot 1" in the list of windows is now populated with the corresponding desktop names.

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

@FuPeiJiang Thanks a lot for your Task Switcher3.ahk example. I'll close this issue, as the list of windows is visually very pleasing. (Though, I assume the DesktopNames are not substituted into the list for Win 11?)


Here are my notes integrating Task Switcher3.ahk to my script:

  1. Before the first return statement, reuse at least the following lines. One of it is responsible in collecting the first window in the first Virtual Desktop to the list. Without these hooks, the first window in the first virual desktop will be missing from the list.
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance, force
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines, -1
#KeyHistory 0
ListLines Off
SetWinDelay, -1
SetControlDelay, -1
  1. Save the two functions at the end of the script into the body of the script. Or, include them into a separate script. One is HandleMessage, and the other is sortArrByKey.
  2. Create a label that contains all contents mapped to F1 in the original script, and call this label with Gosub, label somewhere appropriate in the script.

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

the first window in the first virual desktop will be missing from the list.

that's a coding mistake
d5e15ec#diff-3bfb5141af5c5e7c80712f26ec36dbd5cfb3578e1ddbbb0e556765175381893dL57


DesktopNames are not substituted into the list for Win 11

fixed that too

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

I'll close this issue, as the list of windows is visually very pleasing.

how are you going to make the Text clickable ? It's just text right now, it's effectively useless

from vd.ahk.

llinfeng avatar llinfeng commented on July 27, 2024

For now, I got what I need in the short run. I don't know how much additional work that's needed to get the list clickable. Maybe we can start in a new issue in the future?

On my main workstation, I still use Dexpot that works fine with WIn 10. It is on a Surface tablet which overheats with Dexpot, that I intend to run VD.ahk to emulate Dexpot. On such tablet, since the list is short, I can look up for the whereabouts of a certain window, and jump there with VD.goToDesktopNum(1).

Thanks again for your help!

from vd.ahk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.