Git Product home page Git Product logo

fupeijiang / vd.ahk Goto Github PK

View Code? Open in Web Editor NEW
324.0 11.0 45.0 228 KB

Windows Virtual Desktop, AutoHotkey, Windows 11 support, Windows Server 2022, switch desktop, move window(wintitle) to current desktop; createDesktop, PinWindow, getCount, getDesktopNumOfWindow -> mute all windows in Virtual Desktop

License: MIT License

AutoHotkey 100.00%
virtual-desktop autohotkey hotkeys windows winapi

vd.ahk's Issues

getDesktopNumOfWindow when multiple windows have same title

getDesktopNumOfWindow only gets the VD of one of the windows if multiple windows have the same title. Would be nice if there was a function to getDesktopNumOfWindow by id instead of just title. I'm currently using _desktopNum_from_Hwnd, but it doesn't feel right using one of your internal methods.

If it's an easier change, returning the current desktop (if there's a window with the title on the current desktop) would solve my problem too.

Thanks for a great package.

can not change desktop

thank you first for your great tool!

I only have one issue and i do not know if i am doing wrong or if it should work that way.
I open the example file. I then select a window, which is not shared on all desktops. The script produces a short blink in the screen an i stay on the orignal desktop. I only can change between the desktops if the active Windwo is shared between all desktops. Is this intended to be like that?

I would be happy if I could switch direktly to any desktop regardless which windwo is active.

greets Daniel

Current desktop count is always zero

VD function: getCurrentDesktopNum() always return 0, same for getCount()

Tried this other function to double check if the issue is within those functions or something else: VD.goToDesktopNum(2) but it does nothing.

This started happening today, after a Windows update - may something have changed or am I missing something?
PS: this has been working great in the past months

Thank you!

Is it possible to have a function registered to run whenever the virtual desktop changes?

I've been using some form of my own custom Virtual Desktop manager using AHK for awhile, and it all broke with Windows 11.

I found your class, and was able to implement it and everything is working perfectly. Thank you!

One thing that would be nice, that seemed to work in windows 10, using an OnMessage Listener:

; Windows 10 desktop changes listener
DllCall(RegisterPostMessageHookProc, Int, hwnd, Int, 0x1400 + 30)
OnMessage(0x1400 + 30, "VDChanged")
VDChanged(wParam, lParam, msg, hwnd) {
    ; Will run when desktop changes, even if not changed using this program
}

I don't remember where I got that bit of code from, but it worked in Windows 10.

My use case is that I have an icon that I made myself that shows which desktop I am currently on located in the taskbar. I can manually make sure it is accurate when I use the program to change desktops, but on occasion Windows will pull me to another desktop when I click on a notification, or I'll sometimes use the built-in Ctrl+Win+Left/Right to change desktop instead. This then de-syncs my icon until I use the program to switch again.

I have a work around of using a SetTimer that will always get current number and update the icon accordingly, but I'd prefer to again be able to just have a function that runs whenever the desktop is changed.

I was thinking of maybe being able to register a function in your VD class that will then be used as this callback function.
i.e.

VD.addCallback(FunctionName)

FunctionName() {
    ; Runs whenever desktop is changed from anywhere
}

Figured I'd ask, if this isn't possible not a problem as I am happy enough with my workaround.

Thank you.

open Application directly on one virtual desktop in background

i am using your library and i love it!!!!
I also build something, which sets up windows on the right desktops when i start up the pc. But it is not really relaiable and taks some time an i wanted to ask if there is a better possibility to for example start the notepad directly on desktop 3. At the moment i open the app and push it than to the desktop:

Run,notepad.exe , , Min, OutputVarPID WinWait ahk_pid %OutputVarPID% VD.MoveWindowToDesktopNum("A",3)

Would be happy about some help

Get array of all windows of specific desktop

I need to be able to get an array with the identifiers for all windows on a specific desktop in order to properly cascade them. Could also be useful to get all the windows of a desktop with filtering for title or application for finer control but that's beyond this request.

More Detail:
Win 11 is missing the ability to "CascadeWindows". In Win10 and prior you could just right click on the task bar and do it. Sometimes I have 8+ desktops with 5-10 windows each. Sometimes they cover each other up. There's still a DLL function that allows you to cascade windows though.

I found this thread here:
https://www.autohotkey.com/board/topic/80580-how-to-programmatically-tile-cascade-windows/
where a useful "WinArrange" method is created to easily manage windows in different ways. It takes an optional array of windows for the CascadeWindows function:
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-cascadewindows

WORD CascadeWindows(
  [in, optional] HWND       hwndParent,
  [in]           UINT       wHow,
  [in, optional] const RECT *lpRect,
  [in]           UINT       cKids,
  [in, optional] const HWND *lpKids
);

cKids is an array of windows. If it isn't used, it tiles the windows in every single desktop all at once with some weird layering results. So being able to get a specific list of windows for virtual desktops would be super helpful.

Thank you!

Move All Windows of ahk_exe

F10::VD.MoveWindowToDesktopNum("ahk_exe Firefox.exe",3)

How to make this move all windows? right now only 1 of the windows moves to the specified desktop.

Windows Server 2022 version

Any chance to support windows server 2022 version? I'm using Windows Server 2022 with remote desktop and I'm sure there are many people use it with their VPS or dedicated server.

all windows in desktopNum

since I can only loop through every window and use VD.getDesktopNumOfWindow(wintitle)
I'll return array of array
windowsByDesktopNum:=[]

loop VD.getCount() {
	windowsByDesktopNum.push([])
}

windowsByDesktopNum[desktopNum].push(hWnd)


I could build hashmap : IVirtualDesktop -> desktopNum
then that'd be very good optimization

VD PinWindow function doesn't work with ahk_id

As per a Stack Overflow answer:
I tried using process ID but I think VD.PinWindow doesn't work with it e.g. VD.PinWindow("ahk_id 0xD3854") or VD.PinWindow("ahk_id %this_id%").

Full code used:

#Persistent
; If the script is not elevated, relaunch as administrator and kill current instance
full_command_line := DllCall("GetCommandLine", "str")

if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
    try ; leads to having the script re-launching itself as administrator
    {
        if A_IsCompiled
            Run *RunAs "%A_ScriptFullPath%" /restart
        else
            Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
    }
    ExitApp
}

#Include lib\VD.ahk-class_VD\_VD.ahk

WinGet, HWiNFO64List, List, ahk_exe HWiNFO64.EXE
VD.init()

Loop, %HWiNFO64List%
{
	this_id := HWiNFO64List%A_Index%
	VD.PinWindow("%this_id%")
	; MsgBox %this_id%
}

Animation

A minor request, but nice to have:

If I use the Windows shortcuts CTRL-WIN-RIGHT or LEFT Windows switches between virtual desktops, it shows that animated swiping to the respective side. Is it possible to switch that on also in VD.ahk?

Just a thought.

A problem with the new Windows update 11

Error: (0x80004002) No such interface supported

---- 
026: this.MoveWindowToDesktop := this._vtable(this.IVirtualDesktopManager.Ptr, 5)
027: this.IServiceProvider := ComObject("{C2F03A33-21F5-47FA-B4BB-156362A2F239}", "{6D5140C1-7436-11CE-8034-00AA006009FA}")

▶ 028: this.IVirtualDesktopManagerInternal := ComObjQuery(this.IServiceProvider.Ptr, "{C5E0CDCA-7B6E-41B2-9FC4-D93975CC467B}", IID_IVirtualDesktopManagerInternal_)
029: this.MoveViewToDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 4)
030: this.CanViewMoveDesktops := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 5)

WinExist in another virtual desktop

Use case: It would be great to have a hotkey which checks whether a specific app (window) is open in any Virtual Desktop, and if it is, activates it in its already-existing desktop. If it does not yet exist, I would open it in the current desktop, but YMMV. Thanks! (Win 11)

Window loses Focus when switching Virtual Desktops

Actual

When switching between two desktops, it always loses focus of the last used app of the new desktop. NO window is focused after switching.

Example: VD 1 have Notepad focused, on VD 2 the calculator. Currently i'm on VD1. When switching to VD2, NO window is focused. If i move back, NO window is focused (you see this on the task bar).

Expected

The last focused app should reminded and re-focused when switching to that desktop.

What works

When using build-in key combination CTRL+WIN+Left/Right, it works as expected.

Analysis

It happens regardles if i move away with build-in command and jump back via VD.ahk, or first jump away via VD.ahk and switches back with build-in command.

Background information

  • AHK 2.0.2
  • VD.ahk latest v2_port (5f130ff), but also happens on commit 788978e.
  • Windows 11
  • Single Display
  • Used Key Combination for jumping away and back: WIN+NumpadEnd/-Down/-PgDn
#NumpadEnd::VD.goToDesktopNum(1) ;1
#NumpadDown::VD.goToDesktopNum(2) ;2
#NumpadPgDn::VD.goToDesktopNum(3) ;3

I do not think this has todo with the WIN-Key, because when i move windows to other desktop via:

#NumpadLeft::VD.MoveWindowToDesktopNum("A",1) ;4
#NumpadClear::VD.MoveWindowToDesktopNum("A",2) ;5
#NumpadRight::VD.MoveWindowToDesktopNum("A",3) ;6

The next Windows of the current VD is focused, like expected.

Ideas

Ciantic/VirtualDesktopAccessor#4:

  • Send ALT+ESC or call AllowSetForegroundWindow(ASFW_ANY) before calling GoToDesktopNumber() could work. Don't get confused with "build-in command have bug in windows 10 implementation" - it build-in command in windows 11 works correctly.

I tried this:

;switch desktop
NumpadEnd::{ ;1
    VD.goToDesktopNum(1)
    ;Send !{Esc} 
    Sleep 1
    Send "!{Esc}" ; ALT+Esc activates last window
}
NumpadDown::{ ;2
    VD.goToDesktopNum(2)
    ;Send !{Esc} 
    Sleep 1
    Send "!{Esc}" ; ALT+Esc activates last window
}
NumpadPgDn::{ ;3
    VD.goToDesktopNum(3)
    ;Send !{Esc} 
    Sleep 1
    Send "!{Esc}" ; ALT+Esc activates last window
}

It seems to work, but in some (unpredictable) cases, it will restore the wrong window, and using higher sleep values does not solve that.

[Feature] getCurrentDesktopName

I think a more usable function could print the desktop name (since you can rename them) instead of just the number

SplashTextOn,,, % VD.getCurrentDesktopNum()
Sleep 700
SplashTextOff

Should print Programming instead of 4

Just a thought. Love the script

prevent Windows from switching virtual desktop

thanks for your code again!
When i am working with virtual desktop i really hate it, when i swith to an other program, which is opened on a allready existing desktop. Windows automatically changes the desktop to the called program and gives no notifaication about that. I prefer that an allready opened programm gets changed to the orignal one. With your code i found a hacky solution for that:

i add the last two lines in the function goToDesktopNum to write the with ahk choosen programm to an ini file.

goToDesktopNum(desktopNum) { ; Lej77 Grabacr07/VirtualDesktop#23 (comment)

    Gui VD_active_gui:New, % "-Border -SysMenu +Owner -Caption +HwndVD_active_gui_hwnd"
    DllCall("ShowWindow","Ptr",VD_active_gui_hwnd,"Int",1) ;you can only Show gui that's in another VD if a gui of same owned/process is already active

    this._WinActivateForceForceForce(VD_active_gui_hwnd) ;specifically for Teams.exe

    firstWindowId:=this._getFirstWindowInVD(desktopNum)

    Gui VD_animation_gui:New, % "-Border -SysMenu +Owner -Caption +HwndVD_animation_gui_hwnd"
    IVirtualDesktop := this._GetDesktops_Obj().GetAt(desktopNum)
    GetId:=this._vtable(IVirtualDesktop, 4)
    VarSetCapacity(GUID_Desktop, 16)
    DllCall(GetId, "Ptr", IVirtualDesktop, "Ptr", &GUID_Desktop)
    DllCall(this.MoveWindowToDesktop, "Ptr", this.IVirtualDesktopManager, "Ptr", VD_animation_gui_hwnd, "Ptr", &GUID_Desktop)
    DllCall("ShowWindow","Ptr",VD_animation_gui_hwnd,"Int",1) ;after gui on current desktop owned by current process became active window, Show gui on different desktop owned by current process
    ; loop 20 {
    ;     if (this.getCurrentDesktopNum()==desktopNum) { ; wildest hack ever..
    ;         if (firstWindowId) {
    ;             DllCall("SetForegroundWindow","Ptr",firstWindowId)
    ;         } else {
    ;             this._activateDesktopBackground()
    ;         }
    ;         Gui VD_animation_gui:Destroy
    ;         Gui VD_active_gui:Destroy
    ;         break
    ;     }
    ;     Sleep 25
    ; }
    if (firstWindowId) {
        DllCall("SetForegroundWindow","Ptr",firstWindowId)
    } else {
        this._activateDesktopBackground()
    }
    Gui VD_animation_gui:Destroy
    Gui VD_active_gui:Destroy
	choosenDesktop :=  desktopNum
	IniWrite, %choosenDesktop%, var.ini, variables, var1
}

then i have the following adapted script to check if the choosen and the actual desktop correspond. If not take the active Window an go back to the choosen desktop. Only drawback is, that you now are only able to change desktops with your ahk-code, what is for me ok. On other drawback is, that the following code has to run in an own instance. At least i did not find to run it together with the rest of the code in one script.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
ListLines Off
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
;verhindert den automatischen Wechsel auf anderen desktop wenn Programm nur dort liegt

#Persistent
#Include VD.ahk
VD.RegisterDesktopNotifications()
VD.CurrentVirtualDesktopChanged:=Func("CurrentVirtualDesktopChanged")
CurrentVirtualDesktopChanged(desktopNum_Old, desktopNum_New) {
sleep 200
IniRead, choosenDesktop, ../var.ini, variables, var1
ToolTip % desktopNum_Old "-> " desktopNum_New " soll " choosenDesktop
SetTimer, RemoveToolTip, -1000
if (desktopNum_New!=choosenDesktop){ ;is desktop selected dekstop
sleep 200
VD.MoveWindowToDesktopNum("A",choosenDesktop), VD.goToDesktopNum(choosenDesktop)
}
}
return

RemoveToolTip:
ToolTip
return

f3::Exitapp

i thought maybe this is of interest for you. Sorry for the programming skills, its hacky, but it is a solution.

Error

I'm using _VD.ahk. My goal is to create a code when I activate a window with mouse left click, I can just go to the virtual desktop I desire, and mouse middle click on desktop, then it will bring the previously activated window to this new virtual desktop. But I'm not sure what went wrong, nothing happens when I middle-click on a different virtual desktop.

   #If MouseIsOver("ahk_class WorkerW")

   MButton::
      VD.MoveWindowToCurrentDesktop("A")
   Return()
   #If

   MouseIsOver(WinTitle) {
      MouseGetPos,,, Win
      return WinExist(WinTitle . " ahk_id " . Win)
   }
   Return

I tried the following code to see if other function works, but I got an error message.

F2::
VD.goToDesktopNum(2)
Return

Autohotkey_iyRqNK7wph

When I run the folloinwg code, it returns empty message box.

#Include %A_LineFile%\..\..\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

"pinned window"

is there "pinned window" method, that pinned a active app window

getDesktopNumOfWindow sometimes returns -1 rather than the correct num

If I minimize a window in other virtual desktops, the VD.getDesktopNumOfWindow sometimes returns -1 rather than the correct num.
Some apps don't have such a problem, such as notepad.exe, while others, like telegram.exe, code.exe, and tim.exe, have such a problem.
According to my analysis, the problem may be due to the method: _tryGetValidWindow.
I use Windows 11 Pro, the English version, and AutoHotkey 2.02. I wonder if others encounter such a problem.

After pinning with AH2 version, I get an error when switching desktops by number.

Before pinning any windows, switching desktops by number works fine. After pinning, I get an error.
image
I fixed it by changing line 597 from

if (guid_to_desktopNum[strGUID] == desktopNum) {

to

if (guid_to_desktopNum.Get(strGUID, -999) == desktopNum) {

but I don't know if that's a good fix or not.

I'm using Windows 11 and AHK 2.0.2

How to cycle back to first desktop when at the last?

Hello,

I have been using this tool and thus far I really like it, thanks for making it!

One thing that is proving to be a pain.

When moving active window to previous\next desktops. Its possible to cycle back to first, if at the last desktop.

The program is smart enough to recognise that when I am at the last desktop it will move the window to the first desktop.

Is it possible to do this when switching virtual desktops? so that if I am at the last desktop, invoking next desktop will go to the first desktop.

Looking at the examples provided I was not able to find this functionality.
Thanks!

3月26号修改的代码切换虚拟桌面失败

使用您最新3月26号修改的代码,在切换虚拟桌面的时候,有时没切成功。
我是在win10操作系统下,使用您提供的“VD examples”这个例子,按数字键盘“2”调用“VD.goToDesktopNum”切换虚拟桌面时,比如当前是在桌面1,要切到桌面2,桌面2里没有任何应用窗口即是一个空白桌面,此时切的时候切不过去,又回到了桌面1. 如果桌面2里已经有其它应用窗口,此时是可以成功切到桌面2的。
看了下代码大概是因为 调用 gui的Destroy销毁之后,系统又自动回到的原来的虚拟桌面。水平有限,不知咋修复,麻烦给看看

renaming desktops

Hello!

Could not find any solution on the web. Is there maybe a possibitlity to rename desktops??

greets

Daniel

v2版本使用RegisterDesktopNotifications这个方法异常

我使用“v2_port"这个分支下的代码,想在桌面切换后得到相应的通知信息,调用了RegisterDesktopNotifications这个方法,但是一加这个方法就异常退出了。另外我想加这样的方法

VD.CurrentVirtualDesktopChanged:=CurrentVirtualDesktopChanged 
CurrentVirtualDesktopChanged(desktopNum_Old, desktopNum_New) { 
    ;Menu, Tray, Tip, % _GetDesktopName(n)
    _changeAppearance(desktopNum_New)
} 

也加不上,这样在切换桌面后,我不能做我想做的事了。
但是在v1版本里是没有问题的;我用的是win10的操作系统

Don't work on windows 11(21h2)!

Hi! I use this ahk that made by you(Nice AHK)! But yesterday,when I update to windows 11,it break!
Almost script don't work anymore!
DO you have time to fix it?

Explorer shell crashes when calling getDesktopNumOfWindow() for all windows on Windows 10

When I run this code, the explorer shell crashes and restarts:

#Include _VD.ahk
VD.init()
foundProcesses := ""

; Make sure to get all windows from all virtual desktops
DetectHiddenWindows On
WinGet, id, List
Loop %id%
{
    hwnd := id%A_Index%
    ; Only consider visible windows
    If (DllCall("User32.dll\IsWindowVisible", "Ptr", hwnd))
    {
        d := VD.getDesktopNumOfWindow("ahk_id" hwnd)
        If (d > -1)
        {
            WinGet, exe, ProcessName, % "ahk_id" hwnd
            foundProcesses .= exe "`n"
        }
    }
}

MsgBox % foundProcesses

The windows that cause the problem seem to be invisible to the user, which means that the built in commands return blank strings for the process path or class name (even it the script runs as admin).
Sadly, I could not find out more details about the problem.

The problem also occurs if I run the script on a fresh Windows install

Switching to Relative Desktop fails initially

I'm running the v2_port version with a modified VD.ah2 so that it works under windows 11 build 22621.
The VD.ah2 is attached
When I run the MoveToDesktop.ahk (attached) the ^#left and ^#right do not switch to the relative desktop. The code runs but the desktop doesn't change.
If I run #!right everything comes right: I can then use ^#left and ^#right as expected, until the next time that I load the AHK script (next logon).
If I uncomment the MsgBox line (line 41 in MoveToDesktop.ahk) then everything works (after acknowledging the MsgBox). Similarly if I put a MsgBox in the ^#left and ^#right section they will also work but that puts up a MsgBox every time the key combo is used !

Files.zip

Office 365 setup pops up unexpectedly

Hello, thanks a lot for your repository! I use Windows 11 Pro 22H2, and I am experiencing super strange behavior when I move a window for a second time using WinCtrlShift and the arrow keys: The window carries just fine between the virtual desktops, but after the second movement, the Office 365 setup pops up! Of course, I can quickly close the popup, and even with this glitch moving windows between desktops is super easy instead of clicking on the taskbar with dragging and dropping.

Office 365 is already installed, and I am using it through my university subscription. I wonder if I am the only one experiencing this strange behavior. Am I missing something here? I am not a Windows power user, and I miss the shortcuts of the Linux desktop.

Thanks again.

Script sending "Q" to discord | Desktop switch failure.

Hello, thanks for this script, I've needed this for a long time. I would like to report some bugs...

When using Discord for Windows, the Numpad1, Numpad2 & Numpad3 buttons produce 2 problems when the Discord window is active:
❌ The desktop does not switch.
❌ The letter Q is sent to the Discord chat.
A "Send q" is on line 559 which may explain the Q being sent to discord.

UPDATE: This also happens with EmClient (email software), I suspect this will happen in more applications now.

Bug
Bug2

I also use Numpad 4-9 (so the whole numpad) & the bugs apply to all keys.

Can you please have a look at possibly fix this?

Thanks!

Others following:
@anonymous1184

sending keypress to specified virtual desktop only.

loved your script its so usefull. is it posible to send or click only in one virtual desktop and do other stuff on another one while script is working? the window im trying is not supporting ControlSend, it has to be always focused or in front, for that reason asking this question.

[Feature request] Launch a program at the current desktop

Motivation: The OneNote for Windows 10 windows are not managed by the Task View thing properly - if I have two Virtual Desktops (VD1 and VD2), with have one OneNote window opened in VD1, all new OneNote windows should open in VD1. That is, if I were at VD2 and try to start a new window of OneNote, VD1 is activated and the new OneNote window is started there. I cannot tell whether the new OneNote window starts first, or the switch of VD.

This behavior won't change whether I open OneNote through the Start menu, or using AHK's run command.

A tentative solution is to have a VD.run("exe_path", "VD_num") function that directly starts something at the numbered virtual desktop. If the second argument is left empty, the VD.run command makes sure the program is launched in the current desktop.

As a side note, it also helps to have a function called VD.goToPreviousDesktop(). (Please let me know if this should be documented in a separate issue.) In a similar vein, based on what we have, it may also help to allow for arguments that move a window to the left/right.

  1. VD.MoveWindowToDesktopNum("A","+1"), and
  2. VD.MoveWindowToDesktopNum("A","-1")

Virtual desktop Tasksbar icons

I'm not sure if this is the right place or if anyone is interested but but I've made a small addition to FuPeiJiang's excellent code to switch the AutoHotkey icon to show the number of the virtual desktop on the taskbar.

Prerequisite is to show the AutoHotkey icon on the taskbar - this can be done in Settings > Personalisation > Taskbar.

You then need an icon that shows the number of each virtual desktop. I use six virtual desktops and have six icons stored in a folder referenced by the code). The icons are named 1.ico, 2.ico etc. Copies are attached
icons.zip.

I am sure there must be an easier way of running the code so would welcome any suggestions but I have added a function to obtain the desktop number:

+++++++++++++++++++
ChangeIcon() ;define function
{
Desktop := VD.getCurrentDesktopNum()
TraySetIcon("D:\Data\AutoHotkey2\icons" Desktop ".ico")
}
ChangeIcon ; call function
+++++++++++++++++++

And have then added the ChangeIcon function to each of the keyboard shortcuts. For example the Ctrl + Win +Numpad shortcut

++++++++++++++++++++
;#useful stuff

^#numpad1::
{
VD.goToDesktopNum(1)
ChangeIcon ; function added
}
^#numpad2::
{
VD.goToDesktopNum(2)
ChangeIcon ; function added
}

++++++++++++++++++
etc. etc.

I'm sure it must be possible to trigger the ChangeIcon function with every desktop change without the necessity for adding the code to each of the keyboard shortcuts but my AutoHotkey skills are rather limited.

[Feature request] List all Windows and order the list by virtual desktops

A simple AHK script here can get us a raw list of all windows opened over all virtual desktops. It helps to make the list more structured.

Here is what I am used to with Dexpot: regardless of which Virtual Desktop I am in, I can see all windows across all virtual desktops in a list. Moreover, selecting a window entry in the list will bring me to the corresponding Virtual Desktop where the window resides.

# Virtual Desktop 1
Window-Icon-1 + Title Text 1
Window-Icon-1 + Title Text 2
# Virtual Desktop 2
Window-Icon-2 + Title Text ...

One variant of the list of programs is to limit the list to the current virtual desktop. This will be more usable than how Win+Tab behaves: with multiple monitors, Win+Tab only shows the active windows on the monitors they belong to. This makes things hard to track when one uses multiple monitors.

VD.ahk crashes, doesn't run.

VD.ahk on launch crashes/closes immediately. However, "VD examples.ahk" runs/works fine. Am I doing anything wrong?

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.