Why is [PrtSc] button not working in Intellij-Idea or Microsoft SQL Server Management Studio? - sql-server

I'm using a thrid-party screen capturing application (Screenpresso). It's configured to start screen-capturing when I press PrtSc. And indeed it works except when Intellij has Windows focus. In fact, to screen capture code I have to focus on any other window press PrtSc and then select the area within Intellij.
I've looked through all the settings, and especially the Keymap settings, and I can't see anything else that has been assigned to PrtSc. Of course, I'm not really sure; when I try to find a setting via nothing happens, as pressing PrtSc has no effect.
I know this used to work for me in previous versions of Intellij (though I can't remember what versions). But PrtSc used to work in Intellij just like every other application.
So I guess the question is, why is Intellij eating the PrtSc keypress event? And can I turn it off so that the event gets correctly passed to my dedicated screen capturing application.
Intellij 2019.2.4
Windows 10, 64b

This turned out to be an issue with Screenpresso:
https://www.screenpresso.com/support/hot-keys/
Why shortcut [print screen] key does not always work?
This must be because you run your application with elevated
privileges (with admin rights) (the UAC must have displayed a popup
at startup).
For security reasons, Screenpresso can handle shortcuts
from Windows running with elevated privileges only when it is
installed in Program Files folder.
To fix this, you should install
Screenpresso in Program Files folder which is not the default
behavior:
Uninstall Screenpresso
Run again Screenpresso: Right click Screenpresso.exe and select Run as administrator
Click on the INSTALL on this computer button while holding the Control key or click on the sub-menu Install for all users:

Some users have this problem, first reported 5 years ago: Find here
Crash dumps (java_error_in_*.log in the user's home directory) can help to understand it better.

Related

Keyboard shortcut to toggle OUT of a Citrix Workspace Desktop Viewer session

Background
I'm using the Desktop Viewer functionality in Citrix Workspace (version 20.2.0.25(2002)) to access my work computer from my home computer.
Request
I would like to be able to toggle out of my (full-screen) remote session back to my local desktop more easily.
Currently I can only accomplish this via the control bar at the top of the remote session screen which is starting to feel tedious.
Alt+Tab doesn't work, because it only toggles the applications within the remote session when the session is open.
Whether toggling is accomplished via getting Alt+Tab to work as desired, a hotkey that just minimizes the session window, or some other method doesn't matter to me.
What I've Tried
There are many questions online addressing how to enable Alt+Tab within the remote session, but not disable it. Naturally I've tried to do the reverse of these instructions but no luck. They typically suggest setting TransparentKeyPassthrough=Remote in the registry of the local machine, so I figured mine should have Remote already and I would just need to clear it or replace it with something else, but mine is a null value.
I've gone through all options within Citrix Workspace and the Remote session Preferences but there's nothing about enabling/disabling/setting hotkeys.
I tried the "Disable Hotkeys through the ICACLIENT.ADM Template" of this Citrix Support page, but was unable to locate the icaclient template file they refer to.
I've contacted my company's help desk but they don't know of any solutions.
You can access the citrix menu as described here:
As an accessibility feature of the Desktop Viewer, pressing CTRL+ALT+BREAK
displays the Desktop Viewer toolbar buttons in a pop-up window.
So the shortcut for toggling out of the viewer session would be:
CTRL + ALT + BREAK, CURSOR-DOWN, ENTER
I had the same problem and solved it with an Autohotkey script. Autohotkey can intercept keypresses even when citrix has focus.
This script will allow you to get out of your citrix session with Ctrl-F1.
^F1::
WinMinimize, A
return
If you have not used Autohotkey before: Download Autohotkey, install it, save the code above in a file named citrix.ahk, double-click that file. The hotkey is now active and the script is visible as a H icon in your taskbar.
See here if you want to bind a different key.
Unable to comment on ht13's answer so i'll post my own.
CTRL+ALT+BREAK, h
worked for me.
Thankfully i remembered some keyboards have BREAK, some (like mine) call it PAUSE in case you run into that too.
I have a method for this that involves editing the registry on your local machine.
It definitely counts as 'some other method' - essentially, it sets up a keyboard shortcut that (I think) passes the Win-key keystroke to your local machine.
This opens your local start menu on top of Citrix - and from there you can Alt+Tab locally as normal.
Citrix has multiple entries in different parts of the registry, and also some settings that you can change with the Local Group Policy Editor (gpedit). Unfortunately, the only one I've found that helps is 'Hotkey13', which is only available in the registry.
I've changed multiple things, but I believe the minimal necessary steps are this:
open regedit, and navigate to Computer\HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine\Hot Keys\
ensure the value of AllowHotkey is set to 1
set the value of Hotkey13Shift; I've used Shift, if I recall correctly it accepts Ctrl and Alt and some combinations joined by +
set the value of Hotkey13Char; I've used F1, and think it accepts all Fx keys and possibly some others
restart Citrix, reconnect to your remote desktop, and test your chosen combination
Now, to access my local machine from within a Citrix session I press Shift+F1 to open my local Start menu and give focus to my local machine, and then while it is open Alt+Tab or anything else acts locally.
A screenshot of regedit highlighting Computer\HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Client Engine\Hot Keys\Hotkey13Shift
this bothered me for so long and I finally got a fix: (AHK+Virtualdesktop)
put your citrix desktop viewer in a different virtual desktop
install AutoHotKey and Windows-desktop-switcher
https://github.com/vnavkal/windows-desktop-switcher#:~:text=An%20AutoHotkey%20script%20for%20Windows%20that%20lets%20a,desktops%20by%20hotkey%2C%20etc.%20%28see%20Hotkeys%20section%20below%29.
define whatever hotkey you want to use to toggle between different virtual desktop.
it seems the AHK is able to intercept the hotkey BEFORE it is send to the Desktop Viewer.
my setup:
I use a windows desktop and 2 extra display
I put citrix on virtual desktop2, and fullscreen to all 3 screens
use the hotkey to toggle back to laptop host window virtual desktop 1 without any problem.
FN+F11 toggles out to my windows taskbar. Just need to click on the citrix icon on the task bar to go back again.
Press Ctrl+Alt+Fn+B and then W for switching to window or F to get Citrix in full screen mode. A bit faster then using arrows ...
Using SHIFT + F2 you can resize the Citrix window and access the local machine taskbar so that you can easily switch between the apps.
Refer to this link: CTX232298.
I place citrix workspace on separate windows desktop, and use CTRL + ALT + BREAK and then CTRL + WIN + LEFT/RIGHT to switch from it to another desktop.

Wpf application doesn't start at startup

I have developed a wpf app and want it to run whenever the computer starts up.However I have been unable to do so......I have tried editing registry like this answer...
Launch Window on Windows startup
Interesting thing is the app does autostart when there is internet connection.It doesn't when there is no internet. I do need internet connection at some point of time to sync the data to internet application. However this should not have affected the startup of the application.
Any ideas???
I guess you can set up a timer, and after several minutes, check out your internet, if the internet is ok, then run your application continuely. If not, reset the timer, and check again.
Go to the run line (Windows + R). Type "shell:common startup" press "enter". Place a shortcut in that folder and restart your machine (depending on what the *.exe is doing you may need to set its properties to run as administrator).

Requesting administrator privileges in C program?

I'm trying to make a C program that modifies my host file, but I can't just straight up open the file with the program, because Windows blocks it. Is there any way that I can make the program request administrative privileges within the code, or any script I can use to start the program in admin mode?
Right clicking is a solution that allows you to run any program with Administrator privileges. That includes ticking the box in "Properties".
On Windows 7 and later, you can also rename your program so that its name contains setup (like hosts_setup.exe), and it'll automatically be run in Administrator mode (brings up the UAC prompt) if double-clicked in Explorer. Note this only works from double-clicking in Explorer.
You can also take a look at How can I run a child process that requires elevation and wait? . It calls WinAPI and is a fairly native approach. The best solution is to add it in menifest so your program requests Admin at startup.
Shoot, okay, seconds after posting this question, I found a solution. It turns out that you can right click the executable, click properties, and on the compatibility tab, select "Run this program as administrator". Just in case anyone else needed this information.

Diagnosing why a custom shell on Windows 10 IoT gives black screen

I am configuring Windows 10 Enterprise (IoT) to run a custom shell, but running into the "Black screen with nothing other than a cursor" phenomena.
My application - a .Net4 Winforms app - is installed and runs fine from the desktop.
I can launch it as a custom shell via a batch file as per the comments here: How to run an application as shell replacement on Windows 10 Enterprise
But setting my app as a custom shell, I just get the black screen.
I note the comments in the above link about applications being signed, but I have tried two mini test applications (also .net winforms), one signed, one not, and both run fine as custom shells. (My application has several dependencies, not all of which are signed, so to sign it would mean going through the ILMerge mill or similar which I would rather avoid if I can.)
I don't expect people to be able to tell me why my app doesn't run (although that would be nice!) but I am looking for ways of diagnosing this. Looking in event logs, etc, is yielding no information whatsoever. My app keeps its own event log, which is not showing any evidence of the app starting.
Thanks in advance
Problem solved:
If a shell application requires elevated permissions, UAC must be turned off. Turning off notifications via the control panel is NOT sufficient, as UAC is still running in the background - it just doesn't notify you! To completely turn off UAC, edit registry entry:
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System and set the DWORD value EnableLUA to 0
Evidence of UAC behaviour can be found in the windows event log at:
Applications And Services Logs -> Microsoft -> Windows ->UAC

Batch process does not print with correct font

A WinForms program I have developed prints fine and as expected when run as an interactive user. Using the same account but as a scheduled task, the process will run correctly however it prints part of the output in the incorrect font.
The program is a label printer that prints updated pricing labels. It has an option (-s) that the Task Scheduler calls which does not present the GUI but does an update and prints. Executing this as an interactive user through run works correctly (i.e. the correct font is used).
Any clues as to what's happening here? The font that isn't printing correctly is a non-standard system font.
This runs on a server and I thought it might be due to printer redirection but I did a console logon and it worked fine as an interactive process on the console just as it does as interactive through remote desktop.
Interesting problem. Presumably, Windows doesn't load fonts into the non-interactive logon sessions in order to conserve resources.
See this answer for one approach, using the ps tool to create an interactive session when running the task.
I had a very similar issue to yours (running an application through a scheduled task would use the default font but when running locally it would find the custom font I installed) and I found a solution; On Server 2008, there is an issue where custom fonts are not registered immediately after installing for non-interactive users, whereas regular users (i.e. when running on a user actually logged in to the machine) do have the font registered immediately.
The solution that worked for me was to simply restart the machine the font was installed on and the font started working under the non-interactive accounts, as when the computer is turned on it registers correctly. It appears the font installation has a bug where it doesn't register the font correctly for non-interactive users until a reboot.

Resources