Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: limit the mouse movement Pin
leppie15-May-04 22:15
leppie15-May-04 22:15 
GeneralRe: limit the mouse movement Pin
Hesham Amin15-May-04 22:55
Hesham Amin15-May-04 22:55 
GeneralRe: limit the mouse movement Pin
Member 89285616-May-04 4:31
Member 89285616-May-04 4:31 
QuestionHow to generate keyboard events from a sys service Pin
catalin_im15-May-04 11:38
catalin_im15-May-04 11:38 
AnswerRe: How to generate keyboard events from a sys service Pin
TigerNinja_15-May-04 11:48
TigerNinja_15-May-04 11:48 
GeneralRe: How to generate keyboard events from a sys service Pin
catalin_im16-May-04 5:56
catalin_im16-May-04 5:56 
GeneralRe: How to generate keyboard events from a sys service Pin
Heath Stewart16-May-04 12:13
protectorHeath Stewart16-May-04 12:13 
AnswerRe: How to generate keyboard events from a sys service Pin
Heath Stewart16-May-04 12:18
protectorHeath Stewart16-May-04 12:18 
First, your service must be allowed to interact with the desktop service. It does this either by logging on as LocalSystem with the "Interact with Desktop" (or something like that) option, or as a specific user (although then it would only work for that user).

Then you need to get the desktop handle for the session (like P/Invoking GetDesktopWindow - which may return NULL is there are no active users) and you can P/Invoke SendInput. See http://pinvoke.net/print.aspx/user32.sendinput[^] for an example. You can use the Keys enumeration in .NET, since the enumeration member values are the same as the native VK enumeration constants.

 

Microsoft MVP, Visual C#
My Articles
GeneralSys or CPU Temperature Pin
eggie515-May-04 10:56
eggie515-May-04 10:56 
GeneralRe: Sys or CPU Temperature Pin
TigerNinja_15-May-04 11:45
TigerNinja_15-May-04 11:45 
GeneralRe: Sys or CPU Temperature Pin
eggie515-May-04 11:56
eggie515-May-04 11:56 
GeneralRe: Sys or CPU Temperature Pin
Orkun GEDiK15-May-04 11:46
Orkun GEDiK15-May-04 11:46 
GeneralRe: Sys or CPU Temperature Pin
TigerNinja_15-May-04 11:49
TigerNinja_15-May-04 11:49 
GeneralRe: Sys or CPU Temperature Pin
eggie515-May-04 11:51
eggie515-May-04 11:51 
GeneralRe: Sys or CPU Temperature Pin
Orkun GEDiK15-May-04 14:25
Orkun GEDiK15-May-04 14:25 
GeneralCrystal reports Pin
blankg15-May-04 10:25
blankg15-May-04 10:25 
GeneralRe: Crystal reports Pin
Heath Stewart16-May-04 12:06
protectorHeath Stewart16-May-04 12:06 
GeneralRe: Crystal reports Pin
blankg17-May-04 5:06
blankg17-May-04 5:06 
Generalseaching a web page Pin
mikey C15-May-04 9:31
mikey C15-May-04 9:31 
GeneralRe: seaching a web page Pin
eggie516-May-04 5:21
eggie516-May-04 5:21 
GeneralRe: seaching a web page Pin
mikey C16-May-04 12:39
mikey C16-May-04 12:39 
GeneralRe: seaching a web page Pin
eggie516-May-04 19:36
eggie516-May-04 19:36 
GeneralRe: seaching a web page Pin
mikey C17-May-04 1:32
mikey C17-May-04 1:32 
GeneralRe: seaching a web page Pin
eggie516-May-04 6:32
eggie516-May-04 6:32 
QuestionHow to do list view control? I really need it/ Pin
Member 110099615-May-04 5:52
Member 110099615-May-04 5: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.