background program to capture a key press
-
i have a windows application that currently takes screen shots and copies the image to a directory. the program takes a screen shot of either the active window, or the whole screen based on the keystroke. well obviously the 'active window' screen shot will always take a screen shot of itself, so i want to convert this so it runs in the background somehow. i hope i'm making sense. basically i want to be able to press a couple buttons and no matter what program i'm in, have the computer take a screen shot. do i need to make a windows service? any insight would be greatly appreciated.
-
i have a windows application that currently takes screen shots and copies the image to a directory. the program takes a screen shot of either the active window, or the whole screen based on the keystroke. well obviously the 'active window' screen shot will always take a screen shot of itself, so i want to convert this so it runs in the background somehow. i hope i'm making sense. basically i want to be able to press a couple buttons and no matter what program i'm in, have the computer take a screen shot. do i need to make a windows service? any insight would be greatly appreciated.
You'll need to install a windows keyboard hook since there would be no active window to process the keyboard notification messages. There's been several good articles about this here on CodeProject, including Using Hooks from C#[^]. See http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/hooks.asp[^] for more information.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----