Click here to Skip to main content
15,848,415 members
Home / Discussions / C#
   

C#

 
GeneralRe: regular expressions Pin
Paul Riley19-Oct-02 14:35
Paul Riley19-Oct-02 14:35 
GeneralRe: regular expressions Pin
Jeremy Pullicino19-Oct-02 14:41
Jeremy Pullicino19-Oct-02 14:41 
GeneralRe: regular expressions Pin
James T. Johnson19-Oct-02 14:55
James T. Johnson19-Oct-02 14:55 
GeneralRe: regular expressions Pin
Paul Riley20-Oct-02 2:36
Paul Riley20-Oct-02 2:36 
GeneralRe: regular expressions Pin
Eric Gunnerson (msft)22-Oct-02 12:43
Eric Gunnerson (msft)22-Oct-02 12:43 
QuestionEquivalent Win32 API to Control.InvokePaint? Pin
Li-kai Liu (Angus)19-Oct-02 12:37
Li-kai Liu (Angus)19-Oct-02 12:37 
AnswerRe: Equivalent Win32 API to Control.InvokePaint? Pin
David Stone19-Oct-02 13:12
sitebuilderDavid Stone19-Oct-02 13:12 
GeneralRe: Equivalent Win32 API to Control.InvokePaint? Pin
Li-kai Liu (Angus)19-Oct-02 14:22
Li-kai Liu (Angus)19-Oct-02 14:22 
GeneralRe: Equivalent Win32 API to Control.InvokePaint? Pin
Li-kai Liu (Angus)19-Oct-02 15:31
Li-kai Liu (Angus)19-Oct-02 15:31 
GeneralSendInput C# example Pin
Bog19-Oct-02 9:58
Bog19-Oct-02 9:58 
GeneralRe: SendInput C# example Pin
Stephane Rodriguez.19-Oct-02 10:34
Stephane Rodriguez.19-Oct-02 10:34 
GeneralRe: SendInput C# example Pin
Bog20-Oct-02 14:29
Bog20-Oct-02 14:29 
I saw that google link, and I've been working on it, but I still can't get it to work. I've reached the point where it neither throws errors, nor works.

My definitions are like this:
<br />
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]<br />
private static extern uint SendInput(<br />
	uint nInputs,     // count of input events<br />
	INPUT[] pInputs,  // array of input events<br />
	int cbSize        // size of structure<br />
);<br />
<br />
public struct INPUT {<br />
  public int type;<br />
  public short wVk;<br />
  public short wScan;<br />
  public int dwFlags;<br />
  public int time;<br />
  public UIntPtr dwExtraInfo;<br />
  private int _pad0, _pad1;<br />
}<br />
<br />
I call it like this:<br />
<br />
INPUT[] ipar=new INPUT[1];<br />
INPUT m=new INPUT();<br />
ipar[0]=m;<br />
m.type= 1; //this is INPUT_KEYBOARD<br />
m.wVk= 0x41;  //this is VK_A<br />
m.wScan= 0; <br />
m.dwFlags=0;<br />
m.time=0;<br />
uint u=0;<br />
m.dwExtraInfo=(System.UIntPtr)u;<br />
tbx.Focus(); //tbx is a TextBox I created. <br />
uint ui=SendInput(1,ipar,System.Runtime.InteropServices.Marshal.SizeOf(m));<br />
<br />


the result is that ui = 1. But the Textbox stays empty.

I also tried it by doing the union inside the INPUT and making structs for hardware and mouse input, and I got that to the same point, where ui=1 but the textbox stays empty. This always what happens to me with com interop I get to the point where there's no errors but doesn't work.




"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
GeneralRe: SendInput C# example Pin
leppie20-Oct-02 14:59
leppie20-Oct-02 14:59 
GeneralRe: SendInput C# example Pin
Bog20-Oct-02 15:10
Bog20-Oct-02 15:10 
GeneralRe: SendInput C# example Pin
leppie20-Oct-02 15:24
leppie20-Oct-02 15:24 
GeneralRe: SendInput C# example Pin
Bog20-Oct-02 15:51
Bog20-Oct-02 15:51 
Generalparsing HTML Pin
Jeremy Pullicino19-Oct-02 9:07
Jeremy Pullicino19-Oct-02 9:07 
GeneralRe: parsing HTML Pin
Stephane Rodriguez.19-Oct-02 10:28
Stephane Rodriguez.19-Oct-02 10:28 
GeneralRe: parsing HTML Pin
Jeremy Pullicino19-Oct-02 13:41
Jeremy Pullicino19-Oct-02 13:41 
Questionhow to release the COM server? Pin
CherezZaboro19-Oct-02 9:01
CherezZaboro19-Oct-02 9:01 
AnswerRe: how to release the COM server? Pin
Stephane Rodriguez.19-Oct-02 10:37
Stephane Rodriguez.19-Oct-02 10:37 
GeneralRe: how to release the COM server? Pin
CherezZaboro19-Oct-02 10:46
CherezZaboro19-Oct-02 10:46 
GeneralRe: how to release the COM server? Pin
CherezZaboro19-Oct-02 11:33
CherezZaboro19-Oct-02 11:33 
GeneralRe: how to release the COM server? Pin
Stephane Rodriguez.19-Oct-02 11:40
Stephane Rodriguez.19-Oct-02 11:40 
GeneralRe: how to release the COM server? Pin
CherezZaboro19-Oct-02 11:45
CherezZaboro19-Oct-02 11:45 

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.