Click here to Skip to main content
15,907,497 members
Home / Discussions / C#
   

C#

 
QuestionHow to filter datatable and send Pin
kotteeswaran13-Dec-05 11:21
kotteeswaran13-Dec-05 11:21 
QuestionVSTO and Excel Hyperlinks Pin
Drew McGhie13-Dec-05 10:38
Drew McGhie13-Dec-05 10:38 
Questiondifferences please !!! Pin
faviochilo13-Dec-05 9:50
faviochilo13-Dec-05 9:50 
QuestionHow to raise Mouse click event Pin
bloo2k13-Dec-05 9:49
bloo2k13-Dec-05 9:49 
AnswerRe: How to raise Mouse click event Pin
Polis Pilavas13-Dec-05 10:43
Polis Pilavas13-Dec-05 10:43 
AnswerRe: How to raise Mouse click event Pin
enjoycrack13-Dec-05 10:45
enjoycrack13-Dec-05 10:45 
AnswerRe: How to raise Mouse click event Pin
Curtis Schlak.13-Dec-05 10:51
Curtis Schlak.13-Dec-05 10:51 
AnswerRe: How to raise Mouse click event Pin
MarcelErz13-Dec-05 22:55
MarcelErz13-Dec-05 22:55 
Hi!

To send windows a mouse event, you can use the "mouse_event" API of the user32.dll. Decalre as following:

<br />
[DllImport("user32.dll")]<br />
private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, int dwExtraInfo);<br />


Here are some constants needed, saved in an enumeration:

<br />
private enum MouseEventTFlags<br />
{<br />
 LEFTDOWN   = 0x00000002,<br />
 LEFTUP     = 0x00000004,<br />
 MIDDLEDOWN = 0x00000020,<br />
 MIDDLEUP   = 0x00000040,<br />
 MOVE       = 0x00000001,<br />
 ABSOLUTE   = 0x00008000,<br />
 RIGHTDOWN  = 0x00000008,<br />
 RIGHTUP    = 0x00000010<br />
}<br />


Now, you can call it like this:

<br />
mouse_event((uint)MouseEventTFlags.LEFTDOWN, 0, 0, 0, 0);<br />
mouse_event((uint)MouseEventTFlags.LEFTUP  , 0, 0, 0, 0);<br />


When you send the press-button-down-event, you need to send the press-button-up-event too!

Marcel Erz
AnswerRe: How to raise Mouse click event Pin
bloo2k13-Dec-05 22:56
bloo2k13-Dec-05 22:56 
Questionwhen text is longer than its textbox Pin
melanieab13-Dec-05 9:24
melanieab13-Dec-05 9:24 
AnswerRe: when text is longer than its textbox Pin
Curtis Schlak.13-Dec-05 10:55
Curtis Schlak.13-Dec-05 10:55 
GeneralRe: when text is longer than its textbox Pin
melanieab14-Dec-05 3:27
melanieab14-Dec-05 3:27 
GeneralRe: when text is longer than its textbox Pin
Curtis Schlak.14-Dec-05 4:35
Curtis Schlak.14-Dec-05 4:35 
QuestionHow do I free memory allocated inside unmanaged DLL? Pin
Koushik Biswas13-Dec-05 9:14
Koushik Biswas13-Dec-05 9:14 
QuestionCan not add rows into Datset using Merge() Pin
Roman Muntyanu13-Dec-05 8:52
Roman Muntyanu13-Dec-05 8:52 
AnswerRe: Can not add rows into Datset using Merge() Pin
Drew McGhie13-Dec-05 9:19
Drew McGhie13-Dec-05 9:19 
GeneralRe: Can not add rows into Datset using Merge() Pin
Roman Muntyanu13-Dec-05 9:58
Roman Muntyanu13-Dec-05 9:58 
QuestionX in the top right corner of the form Pin
zaboboa13-Dec-05 8:17
zaboboa13-Dec-05 8:17 
AnswerRe: X in the top right corner of the form Pin
Dan Neely13-Dec-05 9:21
Dan Neely13-Dec-05 9:21 
QuestionA question about Reflection Pin
torrentmoon13-Dec-05 8:11
torrentmoon13-Dec-05 8:11 
AnswerRe: A question about Reflection Pin
Curtis Schlak.13-Dec-05 10:59
Curtis Schlak.13-Dec-05 10:59 
Questionn-tier (Typed dataset) Pin
fmardani13-Dec-05 6:38
fmardani13-Dec-05 6:38 
QuestionSoftware protection Pin
mirano13-Dec-05 6:34
mirano13-Dec-05 6:34 
AnswerRe: Software protection Pin
Robert Rohde13-Dec-05 8:07
Robert Rohde13-Dec-05 8:07 
AnswerRe: Software protection Pin
mcljava15-Dec-05 5:51
mcljava15-Dec-05 5:51 

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.