Click here to Skip to main content
16,005,141 members
Home / Discussions / C#
   

C#

 
QuestionHelp on bringing data out of .dat file [modified] URGENT Pin
Kyle Maldonado20-Nov-07 4:06
Kyle Maldonado20-Nov-07 4:06 
AnswerRe: Help on bringing data out of .dat file [modified] URGENT Pin
Skippums20-Nov-07 5:56
Skippums20-Nov-07 5:56 
QuestionSend key strokes to terminal server window Pin
mav.northwind20-Nov-07 4:02
mav.northwind20-Nov-07 4:02 
AnswerRe: Send key strokes to terminal server window Pin
Skippums20-Nov-07 4:47
Skippums20-Nov-07 4:47 
GeneralRe: Send key strokes to terminal server window Pin
mav.northwind21-Nov-07 10:03
mav.northwind21-Nov-07 10:03 
GeneralRe: Send key strokes to terminal server window Pin
mav.northwind23-Nov-07 10:45
mav.northwind23-Nov-07 10:45 
GeneralRe: Send key strokes to terminal server window Pin
Skippums26-Nov-07 6:52
Skippums26-Nov-07 6:52 
GeneralRe: Send key strokes to terminal server window Pin
mav.northwind26-Nov-07 21:55
mav.northwind26-Nov-07 21:55 
Hi!

That's part of the code that works with notepad, write, ... as long as I use the HWND of the edit control (for the test program I just got a textbox where I put the HWND I get via Spy++):
[DllImport("user32.dll")]
private static extern bool PostMessage(IntPtr hWnd, int msg, int wPar, uint lPar);

private const int WM_KEYDOWN	= 0x100;
private const int WM_KEYUP	= 0x101;

private const int VK_V = 0x56;

private void button1_Click(object sender, EventArgs e)
{
  IntPtr hWnd = new IntPtr(int.Parse(textBox1.Text, System.Globalization.NumberStyles.AllowHexSpecifier));

  bool res;
  res = PostMessage(hWnd, WM_KEYDOWN, VK_V, 0x002f0001);
  res = PostMessage(hWnd, WM_KEYUP, VK_V, 0xc02f0001);
}


Btw. it doesn't write "v" when I use the HWND of the main application window either, so this could be a hint that WM_KEYDOWN/WM_KEYUP might be inappropriate in this case.

The only thing I haven't tried so far is using SendInput, but I expect it to fail just as keybd_event did. Nevertheless, I'll give it a try.

If you have any further ideas I'd be really grateful.

Thanks,
mav

--
Black holes are the places where God divided by 0...

GeneralRe: Send key strokes to terminal server window Pin
mav.northwind27-Nov-07 21:01
mav.northwind27-Nov-07 21:01 
GeneralRe: Send key strokes to terminal server window Pin
Skippums28-Nov-07 4:53
Skippums28-Nov-07 4:53 
Questionservice doesn't register Pin
stephan_00720-Nov-07 3:49
stephan_00720-Nov-07 3:49 
AnswerRe: service doesn't register Pin
led mike20-Nov-07 5:02
led mike20-Nov-07 5:02 
GeneralRe: service doesn't register Pin
stephan_00720-Nov-07 22:13
stephan_00720-Nov-07 22:13 
QuestionMetafile problem... Pin
devzav20-Nov-07 3:36
devzav20-Nov-07 3:36 
AnswerRe: Metafile problem... Pin
Skippums20-Nov-07 3:56
Skippums20-Nov-07 3:56 
AnswerRe: Metafile problem... Pin
devzav20-Nov-07 4:24
devzav20-Nov-07 4:24 
QuestionScan for Terminal Servers? Pin
Stimul8d20-Nov-07 3:15
Stimul8d20-Nov-07 3:15 
AnswerRe: Scan for Terminal Servers? Pin
Stimul8d20-Nov-07 4:43
Stimul8d20-Nov-07 4:43 
QuestionEvent to capture IP Packets Pin
Activwerx inc.20-Nov-07 3:01
Activwerx inc.20-Nov-07 3:01 
AnswerRe: Event to capture IP Packets Pin
Activwerx inc.20-Nov-07 11:43
Activwerx inc.20-Nov-07 11:43 
QuestionIni File, Read From Txt File Pin
half-life20-Nov-07 2:09
half-life20-Nov-07 2:09 
AnswerRe: Ini File, Read From Txt File Pin
Jason Lepack (LeppyR64)20-Nov-07 3:14
Jason Lepack (LeppyR64)20-Nov-07 3:14 
QuestionPlease Help me in Crystal Report Pin
Mujahid Awan Sindhi20-Nov-07 2:07
Mujahid Awan Sindhi20-Nov-07 2:07 
AnswerRe: Please Help me in Crystal Report Pin
Rocky#20-Nov-07 4:03
Rocky#20-Nov-07 4:03 
AnswerRe: Please Help me in Crystal Report Pin
Ennis Ray Lynch, Jr.20-Nov-07 5:27
Ennis Ray Lynch, Jr.20-Nov-07 5:27 

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.