Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
Question[Message Deleted] Pin
hkjghkj113-Mar-09 7:20
hkjghkj113-Mar-09 7:20 
AnswerRe: Transparent *.gif in PictureBox and Rotating the .gif within Pin
Xmen Real 13-Mar-09 7:31
professional Xmen Real 13-Mar-09 7:31 
General[Message Deleted] Pin
hkjghkj113-Mar-09 7:37
hkjghkj113-Mar-09 7:37 
GeneralRe: Transparent *.gif in PictureBox and Rotating the .gif within Pin
Xmen Real 13-Mar-09 7:42
professional Xmen Real 13-Mar-09 7:42 
Questioncharacter segmentation Pin
Swati Khanna13-Mar-09 7:20
Swati Khanna13-Mar-09 7:20 
QuestionRe: character segmentation Pin
led mike13-Mar-09 7:54
led mike13-Mar-09 7:54 
GeneralRe: character segmentation Pin
Xmen Real 13-Mar-09 8:07
professional Xmen Real 13-Mar-09 8:07 
AnswerRe: character segmentation Pin
CPallini13-Mar-09 8:11
mveCPallini13-Mar-09 8:11 
AnswerRe: character segmentation [modified] Pin
0x3c013-Mar-09 8:29
0x3c013-Mar-09 8:29 
GeneralRe: character segmentation Pin
Xmen Real 13-Mar-09 8:32
professional Xmen Real 13-Mar-09 8:32 
GeneralRe: character segmentation Pin
0x3c013-Mar-09 8:46
0x3c013-Mar-09 8:46 
Questiongetting http status code Pin
laziale13-Mar-09 6:49
laziale13-Mar-09 6:49 
AnswerRe: getting http status code Pin
led mike13-Mar-09 7:53
led mike13-Mar-09 7:53 
GeneralRe: getting http status code Pin
laziale13-Mar-09 8:07
laziale13-Mar-09 8:07 
Questiongeneric comboBox method Pin
ch0pper113-Mar-09 6:45
ch0pper113-Mar-09 6:45 
AnswerRe: generic comboBox method Pin
J$13-Mar-09 10:02
J$13-Mar-09 10:02 
GeneralRe: generic comboBox method Pin
ch0pper117-Mar-09 4:31
ch0pper117-Mar-09 4:31 
QuestionAutomatic Font serialization Pin
baranils13-Mar-09 6:18
baranils13-Mar-09 6:18 
AnswerRe: Automatic Font serialization Pin
led mike13-Mar-09 7:49
led mike13-Mar-09 7:49 
GeneralRe: Automatic Font serialization Pin
baranils13-Mar-09 8:34
baranils13-Mar-09 8:34 
GeneralRe: Automatic Font serialization Pin
led mike13-Mar-09 9:10
led mike13-Mar-09 9:10 
GeneralRe: Automatic Font serialization Pin
baranils13-Mar-09 11:13
baranils13-Mar-09 11:13 
GeneralRe: Automatic Font serialization Pin
led mike13-Mar-09 12:00
led mike13-Mar-09 12:00 
GeneralRe: Automatic Font serialization Pin
baranils13-Mar-09 14:13
baranils13-Mar-09 14:13 
QuestionSending Ctrl+letter to application using PostMesssage or SendMessage Pin
Fredrik Hagg13-Mar-09 5:10
Fredrik Hagg13-Mar-09 5:10 
Hi!

I've been trying to send Ctrl+s to notepad, but havent succesfully manage to do this. I've googled it, but havent found anyone who have sent a ctrl+letter command to a process.

Currently, the sending part of my code look like this:

IntPtr hWnd = FindWindow("Notepad", null); 
IntPtr hWndChild = FindWindowEx(hWnd, IntPtr.Zero, "Edit", null); 
int VK_CONTROL = (int)0x11;
uint wm_keydown = (uint)0x100; 
uint wm_char = (uint)0x102; 
uint wm_keyup = (uint)0x101; 
 
PostMessage(hWndChild, wm_keydown, VK_CONTROL, 0);       //Send Ctrl down 
PostMessage(hWndChild, wm_keydown, VkKeyScan('s'), 0);   //Send 's' down 
PostMessage(hWndChild, wm_keyup, VkKeyScan('s'), 0);     //Send 's' up 
PostMessage(hWndChild, wm_keyup, VK_CONTROL, 0);         //Send Ctrl up 


I've also tried different values for the lParam parameter (taken from Spy++) and to use hWnd instead of hWndChild, but it does not work. Does anyone know any way to send Ctrl+s to notepad using PostMessage (or SendMessage)? I would really appreciate if anyone could post some sample code. Thank you!

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.