Click here to Skip to main content
16,004,453 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Question.net remoting OR web services OR WCF Service Pin
divyesh14323-Jun-10 19:27
divyesh14323-Jun-10 19:27 
AnswerRe: .net remoting OR web services OR WCF Service Pin
dan!sh 3-Jun-10 21:29
professional dan!sh 3-Jun-10 21:29 
AnswerRe: .net remoting OR web services OR WCF Service Pin
Peace ON3-Jun-10 21:42
Peace ON3-Jun-10 21:42 
AnswerRe: .net remoting OR web services OR WCF Service Pin
Abhinav S3-Jun-10 21:45
Abhinav S3-Jun-10 21:45 
GeneralRe: .net remoting OR web services OR WCF Service Pin
dan!sh 3-Jun-10 21:51
professional dan!sh 3-Jun-10 21:51 
QuestionsqlDependency cache- notification model Pin
senthu33-Jun-10 11:55
senthu33-Jun-10 11:55 
QuestionSending a keystroke to all applications Pin
Kevin Geary2-Jun-10 6:55
Kevin Geary2-Jun-10 6:55 
AnswerRe: Sending a keystroke to all applications Pin
Luc Pattyn2-Jun-10 7:24
sitebuilderLuc Pattyn2-Jun-10 7:24 
Hi,

you should not send anything to "all windows" or "all applications". A lot of applications and windows are meant for human interaction only, and may suddenly display a dialog, where some of not all keys get interpreted the same as clicking the OK button. You cannot possibly want that.

you should send a keystroke or a sequence of keystrokes to a single window, after making sure you got the right window; and even that is not always fool proof, as it may change soon after you've checked.

There are a couple of ways to do it:
- System.Windows.Forms.SendKeys.SendWait() sends keys to the active app and window;
- SendMessage() could be used to send regular Windows messages such as WM_KEYDOWN and WM_KEYUP.

The former is managed but unsafe as, even when you get the ForeGroundWindow's title text and check it, the active window may change suddenly; the latter is a bit harder to use but should always be OK. I use both, and choose depending on circumstances.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

AnswerRe: Sending a keystroke to all applications Pin
PIEBALDconsult3-Jun-10 5:59
mvePIEBALDconsult3-Jun-10 5:59 
AnswerRe: Sending a keystroke to all applications [modified] Pin
Hristo-Bojilov3-Jun-10 10:11
Hristo-Bojilov3-Jun-10 10:11 
GeneralRe: Sending a keystroke to all applications Pin
Luc Pattyn3-Jun-10 11:00
sitebuilderLuc Pattyn3-Jun-10 11:00 
GeneralRe: Sending a keystroke to all applications Pin
Hristo-Bojilov3-Jun-10 11:22
Hristo-Bojilov3-Jun-10 11:22 
AnswerRe: Sending a keystroke to all applications Pin
Anshul R9-Jun-10 4:03
Anshul R9-Jun-10 4:03 
QuestionMessage Removed Pin
2-Jun-10 3:44
professionalN_tro_P2-Jun-10 3:44 
AnswerRe: Loading Objects with reflection Pin
Pete O'Hanlon2-Jun-10 4:21
mvePete O'Hanlon2-Jun-10 4:21 
GeneralMessage Removed Pin
2-Jun-10 6:27
professionalN_tro_P2-Jun-10 6:27 
AnswerRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 6:57
sitebuilderLuc Pattyn2-Jun-10 6:57 
GeneralMessage Removed Pin
2-Jun-10 7:22
professionalN_tro_P2-Jun-10 7:22 
AnswerRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 7:30
sitebuilderLuc Pattyn2-Jun-10 7:30 
GeneralMessage Removed Pin
2-Jun-10 8:03
professionalN_tro_P2-Jun-10 8:03 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 8:09
sitebuilderLuc Pattyn2-Jun-10 8:09 
GeneralMessage Removed Pin
2-Jun-10 8:33
professionalN_tro_P2-Jun-10 8:33 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 8:36
sitebuilderLuc Pattyn2-Jun-10 8:36 
GeneralMessage Removed Pin
2-Jun-10 9:16
professionalN_tro_P2-Jun-10 9:16 
GeneralRe: Loading Objects with reflection Pin
Luc Pattyn2-Jun-10 9:25
sitebuilderLuc Pattyn2-Jun-10 9:25 

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.