how to Create my own shortcut key as Ctrl Alt Del - windows

I need to create my own shortcut key, as in when we press Ctrl + Alt + Delete we get the task manager, likewise i need to click some other 2 keys to execute my program.
How should i do this ?
and also i need to know what language i need to program this?
I am using Windows Vista as my OS.

I think what he means is he wants to be able to create shortcut keys in his application.
If you're using Visual Studio, you can do this through the visual designer in menu options.
Anyways, I hope this article sheds some light onto the situation:
http://support.microsoft.com/kb/839201
You tagged vb, and this article explains it in VB as well as C#.
Good luck.

I think you want to use a hotkey under AutoHotKey to run another program. Once you have an autohotkey script running, you can also add keys to perform actions within that program, set up other keys to launch other programs, etc. See entries under StackOverflow's 'autohotkey' tag and other help pages referred to from those links.

Create a shortcut that performs the Ctrl-Alt-Del action for you
(very useful in environments where OSK is not accessible). Create a shortcut to the following:
C:\Windows\explorer.exe shell:::{2559a1f2-21d7-11d4-bdaf-00c04f60b9f0}
Double-click that shortcut to access the Ctrl-Alt-Del screen. Now you can forget about the inception through multiple RDP.

Related

I need to make a standalone service for detecting and executing custom Windows hotkeys

I am attempting to make a macro keyboard that will automatically open some webpages and programs for me. In order to accomplish this, I have made a custom keyboard that is able to input keystrokes for me.
I would like to use a key combination like ctrl + a + b + c to activate my macros so that it does not interfere with the macros I already have on my keyboard. I have attempted to use Auto Hotkey for this purpose, but it does not accept multiple keys like I want.
I, therefore, believe that I will be forced to code my own hotkey manager. Here are the features That I want to be included in my hotkey manager:
Multiple key activation. example: ctrl + a + b + c
Ability to open webpages.
Ability to run programs.
preferably a single program, so that it can be used on multiple computers easily.
Is a project like this possible for an intermediate programmer?
I am currently experimenting with C# and Windows services, but I am unable to figure out how to listen for keystrokes. I am not married to C#. I can change languages as needed.
Any advice you would give is greatly appreciated.
You can try using hotstrings instead of a multi-key hotkey.
A hotstring is a sequence of keystrokes.
You can define hotstrings like this
::btw::by the way
Typing "btw" and then a Space or Enter or any word terminator, will expand "btw" to "by the way"
AutoHotKey can also be used to open webpages, run programs etc.

how do I create a program in windows that can be activated by pressing short cut key instead of clicking?

I need to create a GUI working on windows that can be activated by pressing short cuts.
1. is it possible without setup class?
2. if not possible, just achieve pressing hotkeys and activate my program--how should i code it out--would be enough
thanks (I am using Qt for vs2012 add in to do the GUI)
I put some code up that starts a thread that does this. It is windows specific, but it does the job.
Clipboard Shortcut/Hotkey binding with Qt outside of application
One alternative to all of this, is to go to a shortcut to your program, go to its Properties, and then click on the shortcut area and type your desired shortcut. As long as it doesn't overlap with existing hotkeys that are registered in windows, it should work, without a hidden presence of your app in the system tray or some other background thread.
Hope that helps.
libqxt offers a QxtGlobalShortcut class that does what you want.

Assign VBS Script to a Keyboard Shortcut

I have a very basic VBS script that I plan on using frequently on my Windows 7 machine. Is there any way I can bind it to a keyboard shortcut so I don't have to navigate to it through Explorer obnoxiously.
I realize this question does not directly pertain to programming, or even scripting for that matter, but I could not find a straight answer online or through my own experimentation. I'm sure that there is a simple solution somewhere...
Thank you for taking the time to read, and hopefully respond to my inquiry.
Evin Ugur.
Windows does have built-in support for shell shortcut keys, where a keypress is used to invoke an *.lnk file that launches your VBScript (using either cscript or wscript).
Create a shortcut file, have it invoke your VBScript file directly or run cscript or wscript with the appropriate arguments, then save it and open its Properties sheet and set a keystroke in the "Shortcut key" field (I suggest something like Ctrl+Alt+K).
Like so:
Then, whenever you press Ctrl+Alt+K, regardless of the active application, your script will be invoked.
A more heavy-duty alternative is AutoHotKey: http://www.autohotkey.com/
Just as an FYI.
I tried this and I was not able to register the hotkey when I had the Icon in a costume folder. Even if I added the hotkey, it failed to work.
Once I moved the icon to the "C:\ProgramData\Microsoft\Windows\Start Menu\Programs", the hotkey started to work.

How to change current keyboard layout in powershell?

I have two languages set in my windows settings - Czech (default) and English (for programming). I want to switch between them in powershell.
I generally work in Czech language, and it is my default language on my PC. So whenever I (re)start any app, it starts with Czech keyboard layout.
But I am programming with English layout. So I always need to tap Alt+Shift when I am starting new programming app - i.e. powershell window.
Is there some way to do this with some command in powershell? Or in C#, possibly through some win32 api call (as I could make myself small cmdlet for this)?
I found this question (and some others), but I didn't understand it(them) much...
I never worked with Win API, so I don't know what exactly is possible and how to work with it...
Does somebody has some cmdlet or little tutorial how to do this?
I found nice and very easy solution! There is WASP project on Codeplex. This project allows to manipulate windows, send keys to them and send clicks to them.
Solution for my problem is to import the WASP module when powershell is starting, then select powershell window (using WASP) and send Alt+Shift keystroke to it (using WASP).
Here is the code to include to the powershell profile.ps1 file in order to change language to the next one:
Import-Module WASP
Select-Window powershell | Send-Keys "%+" # '%' = ALT key, '+' = SHIFT key
Go to the Control Panel, open Regional and Language Options.
Click the Details...
Click Add and Remove to manage the languages you need.
add your language. Click OK to exit.
The keyboard layout is changed, you can switch them via Language Bar.
you can also check this link:
http://krypted.com/commands/powershell-commands/

vbscript SendKey

I have a process I need to run which can only be run by shortcut keys which are CTRL+ALT+RIGHT SHIFT
To make it easier for users I would like to create a desktop shortcut to click on to run this shortcut.
The way I thought this could be done is by vbs script sendkey.
Am I right in my research to say that right shift key can not be specified?
I know there is ^% for CTRL and ALT and + for generic shift but that does not work for right shift.
Is there a way for me to do this?
I recommend that you use AutoHotkey.
It has a very robust, proven "sendkey" functionality, including the ability to send right shift.
Your script would simply be:
SendInput,^!{RSHIFT}
Furthermore, it comes with a utility that will compile the script into a .exe, which is what you'd want to use on the desktop.
I use my own open source software "sendkeys v0.0.1" for this. You can compile it as a C# console application in Visual Studio 2013.
Source: Sendkey v0.0.1
Then use it in a command window like this:
Sendkey CONTROL down
Sendkey MENU down
Sendkey RSHIFT down
Sendkey CONTROL up
Sendkey MENU up
Sendkey RSHIFT up
Or in vbscript using the .Exec() method.
(N.B. command window is Microsoft slang for 'terminal' or 'console')

Resources