Click here to Skip to main content
15,891,981 members
Home / Discussions / C#
   

C#

 
GeneralRe: assembly's dll extension Pin
Heath Stewart5-Apr-04 11:34
protectorHeath Stewart5-Apr-04 11:34 
GeneralRe: assembly's dll extension Pin
Anonymous5-Apr-04 13:16
Anonymous5-Apr-04 13:16 
GeneralRe: assembly's dll extension Pin
Heath Stewart5-Apr-04 17:18
protectorHeath Stewart5-Apr-04 17:18 
GeneralRe: assembly's dll extension Pin
CWIZO6-Apr-04 2:47
CWIZO6-Apr-04 2:47 
GeneralRe: assembly's dll extension Pin
Heath Stewart6-Apr-04 2:52
protectorHeath Stewart6-Apr-04 2:52 
QuestionCatch Windows KeyPress Events? Pin
Verdant1235-Apr-04 9:32
Verdant1235-Apr-04 9:32 
AnswerRe: Catch Windows KeyPress Events? Pin
LongRange.Shooter5-Apr-04 9:43
LongRange.Shooter5-Apr-04 9:43 
AnswerRe: Catch Windows KeyPress Events? Pin
Heath Stewart5-Apr-04 9:50
protectorHeath Stewart5-Apr-04 9:50 
There are basically three types of hooks you can use. One is that you override WndProc and handle all messages sent to your form whether its active or not. In the case of keyboard events, your application must be active to recieve them (except when using the other two hooks to be mentioned...).

You can use an IMessageFilter along with Application.AddMessageFilter and Application.RemoveMessageFilter to add a message filter that applies to all windows (that includes controls) in your application so that you can handle keyboard events (or any other events) no matter which form is active.

Finally, there's system hooks. These should be used as little as often as they hook every message of a certain type in the OS. Inefficient or buggy code can degrade performance of the OS and all applications seriously, or even cause crashes if you don't handle errors correctly. You can find more information about using system hooks in C# by reading Using Hooks from C#[^].

In any case, you'll be using Windows messaging and catching notification messages like NM_KEYDOWN, which you can find the constants for in winuser.h in the Platform SDK. Experience with Windows messaging will be helpful.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Catch Windows KeyPress Events? Pin
Verdant1235-Apr-04 10:27
Verdant1235-Apr-04 10:27 
GeneralRe: Catch Windows KeyPress Events? Pin
Heath Stewart5-Apr-04 10:43
protectorHeath Stewart5-Apr-04 10:43 
GeneralRe: Catch Windows KeyPress Events? Pin
Verdant1235-Apr-04 12:36
Verdant1235-Apr-04 12:36 
QuestionMouseHover taking over one minute? Pin
LongRange.Shooter5-Apr-04 8:55
LongRange.Shooter5-Apr-04 8:55 
AnswerRe: MouseHover taking over one minute? Pin
leppie5-Apr-04 9:34
leppie5-Apr-04 9:34 
GeneralRe: MouseHover taking over one minute? Pin
LongRange.Shooter5-Apr-04 9:40
LongRange.Shooter5-Apr-04 9:40 
AnswerRe: MouseHover taking over one minute? Pin
Heath Stewart5-Apr-04 9:44
protectorHeath Stewart5-Apr-04 9:44 
GeneralRe: MouseHover taking over one minute? Pin
LongRange.Shooter6-Apr-04 2:35
LongRange.Shooter6-Apr-04 2:35 
GeneralSearching Multiple OUs Pin
Vodstok5-Apr-04 8:33
Vodstok5-Apr-04 8:33 
GeneralRe: Searching Multiple OUs Pin
Vodstok6-Apr-04 5:44
Vodstok6-Apr-04 5:44 
Generalpassword hash between web forms and windows forms Pin
Talal Sultan5-Apr-04 8:20
Talal Sultan5-Apr-04 8:20 
GeneralRe: password hash between web forms and windows forms Pin
Heath Stewart5-Apr-04 9:39
protectorHeath Stewart5-Apr-04 9:39 
GeneralRe: password hash between web forms and windows forms Pin
Talal Sultan5-Apr-04 9:48
Talal Sultan5-Apr-04 9:48 
GeneralRe: password hash between web forms and windows forms Pin
Talal Sultan5-Apr-04 10:05
Talal Sultan5-Apr-04 10:05 
GeneralRe: password hash between web forms and windows forms Pin
Heath Stewart5-Apr-04 10:32
protectorHeath Stewart5-Apr-04 10:32 
GeneralRe: password hash between web forms and windows forms Pin
Talal Sultan5-Apr-04 10:47
Talal Sultan5-Apr-04 10:47 
GeneralRe: password hash between web forms and windows forms Pin
Heath Stewart5-Apr-04 10:52
protectorHeath Stewart5-Apr-04 10:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.