I'm trying to create a shortcut (.lnk) file that will launch scrcpy without showing the console window, but I need to be able to pin it to the taskbar and have the window and shortcut merge. Scrcpy is bundled with a vbs script that launches scrcpy through wscript, hiding the console, but when I made a shortcut opening that through wscript that made a duplicate window (icon?). I also found a somewhat promising question here about Pinning advertised shortcuts on the taskbar, which led me to an MS Docs page about AppUserModelIds, the only problem being I don't really understand how they work, or how to make a shortcut with them.
Related
If I search for a "close window" feature in the command palette, I get this:
which is the main command one activates by clicking the os tick to close the whole window of vscode.
Activating this from the command palette is useful to close the main window if in full screen.
Is there a way to associate this command to a shortcut?
When I search for "close window" in the shortcut view I find:
where "shift+cmd+w" closes all internal windows of vscode and "cmd+w" closes them one by one (finally "cmd+q" just shuts down vscode entirely)
Apparently now it is possible to close one instance only of vscode, with the standard shift+cmd+w, to recap
on windows and linux
Simply just use alt+f4 to close your vscode window
on macos
Use shift+cmd+w
..or any other key combination you might associate with workbench.action.closeWindow
Is there a way to set the focus to an already opened window using cmd/batch?
It should act just like clicking the task bar icon.
Or like double-clicking the window in Task-Manager.
I know there are many similar questions, but i couldn't find an answer to this "simple" task, I just can't imagine this is to be so difficult to do...
example:
I have Outlook opened somewhere in the background.
When executing the command, the open window should come to the front.
If no window is open, it should open a new one.
What i tried:
start outlook
-> this will always open a new window
start outlook /[non-existing command]
-> this is the only way i found to get the focus on an open window, followed by an error since it doesn't know the command, but Outlook does not open unless it's already running. An option might be, to tell Outlook not to do anything?
To access and control a window, dialog or popup with Autohotkey the title of that specific window is needed. For some windows the title can be read directly if its visible, but some windows hide it. The window class and the exe (ahk_class and ahk_exe) aren't visible at all. How to gather this information reliable?
Use the Window Spy tool, which is installed together with AHK, it can be started various ways:
Right click the tray icon of a running AHK script and select Window Spy
Start the AU3_Spy.exe in the AHK installation folder
Use the Windows search to search for Window Spy
You will get a window called Active Window Info with various infos about your current active (topmost) window. The first box is the one you need.
Example
The box gives title, class and .exe to detect the target window of which every line can be used to identify the window. Now you should activate the window you want to address and copy the information.
Hint: You can (un-)freeze the display with Win + A
Here is the scenario:
In the Wix install script for our application , start menu shortcuts and desktop shortcuts are now handled differently than before.
These changes causes any user pinned shortcut to the application on the taskbar to be orphaned when a user runs an update from a previous installation. In other words, the shortcut remains but is no longer pointing to anything.
The shortcut is shown as a blank page indicating that the link has been removed. A quick peek at the C:\Users[UserName]\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar folder confirms this. Clicking on the shortcut will remove it and then show a windows dialog asking whether to remove the shortcut or not (answer has no meaning since it has already been removed).
My question is:
Is there any way to tell the taskbar to remove orphaned shortcuts ?
Preferrably this would be triggered by a custom action in the Wix script after installing the new version.
The roaming profile can move from machine to machine so it's pretty much impossible. About all you could do is leave behind a component that runs on logon and detects that your app is no longer installed and deletes the shortcuts.
I'd consider this user data and let the user worry about it.
I would like to completely remove the Windows 7 taskbar, including tray and start-button, so that the user can not reactivate it by pressing the Windows-key on the keyboard. however, all other explorer functionality (i.e. starting an explorer Window using Windows+E) should remain.
Is it possible to permanently hide the complete taskbar? Maybe there are some registry values on could change in order to make that behaviour selectable using a powershell script?
Thanks a lot
Here be my solution (it hides rather than replaces or removes the native taskbar - this allows it to work with programs that have a dependency on the native taskbar, such as display fusions taskbar).
disable-taskbar-always-top
Still to solve: [HALF SOLVED]
Eliminate the stupid line that auto-hide leaves with some maximized applications, such as Google Chrome
HALF SOLUTION -
If you move the taskbar to the left or right edge prior to doing the above steps, you don't get the stupid auto-hide line at the top or bottom of Google Chrome. Since the native taskbar is not mouse sensitive anymore, it won't impact your use of hot corners, or multi monitors (for instance I have the native taskbar on the left of my middle monitor, and it does not popup when moving between monitors using the steps in this post).
Okay, I think I have finally - finally - got a workaround that:
Keeps the native Windows 7/8 taskbar hidden for your session (you do have a couple of steps you need to do on start-up each time, or if you manually un-hide the taskbar).
Prevents the native Windows 7/8 taskbar from opening with popups or programs seeking attention (flashing taskbar thing).
Prevents the native taskbar from being mouse sensitive (i.e. despite auto-hide, it will not appear when you mouse over the hidden taskbar anymore).
Allows you to use the screen area that is occupied by the native taskbar (this is the problem of not combining Taskbar-Hide with the autohide setting; you can't use that screen real-estate).
Allows you to run alternative taskbars that are dependent on keeping the native taskbar functional (for instance Dislay Fusions Multi-Monitor Taskbar + [Settings >> Advanced Settings ?> 'Show On All Montiors'])
One Time Steps:
1) Download and run this registry edit to prevent balloon notification popups from the native taskbar/system tray:
Notifications - Enable or Disable Message Balloons - Windows 7 Help Forums
(You can open this in notepad to see what changes it will make prior to installing it, if you want).
2) Download and run Taskbar-Hide from here:
Hide Taskbar: Hide Taskbar in Windows 8 | 7 with a hotkey
3) Set the taskbar to auto-hide
Optional:
3) B) Add a shortcut to Taskbar-Hide.exe in your startup folder, to have it launch automatically with windows on startup (you still need to use the Ctrl+Esc hotkeys to activate the functions of taskbar-hide - though you could also script this if you were really keen).
Startup Folder:
C:\Users{User Name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Steps to hide taskbar after each start-up or manually un-hiding using Taskbar-Hide
4) Make sure Taskbar-Hide is running.
5) Make sure the taskbar is in its auto-hide state (i.e. you'll have to look at any programs that are currently seeking attention).
6) Once the taskbar is 'auto-hidden', press the hotkeys for Taskbar-Hide (Ctrl+Esc)
[This should mean that the native taskbar area is no longer sensitive to mouse activity]
One way is to replace the explorer shell with your own shell. This is the a common method done in Windows 7 Embedded.
In older versions of Windows (such as XP) it was possible to specifiy a shell for each user via regedit. I am not sure this is easily possible in Windows 7.
See https://superuser.com/questions/352865/how-do-i-change-the-windows-shell-for-only-one-user
Make an empty exe file and use it as the file to use in your "Custom User Interface" group policy. Additional information here.
I have found another solution that works nearly perfect for me, by just hiding the Taskbar and the Start button by simply sending both the WM_HIDE message:
Handle = FindWindow("Shell_TrayWnd", "");
...
ShowWindow(Handle, SW_SHOW);
The only problem I have with that solution is that the taskbar is not hidden permanently, i.e. as soon as one element is activated that does not have the focus, which on the taskbar leads to the item flashing in yellow, the taskbar gets visible again.
I'm not sure if there is a way to prevent Windows from re-enabling the visible flag of the taskbar in some way, or a method to hook to the SW_SHOW in C# though.