Click here to Skip to main content
15,925,172 members
Home / Discussions / C#
   

C#

 
AnswerRe: Restart application on error Pin
Mr.Jocker27-Mar-06 7:45
Mr.Jocker27-Mar-06 7:45 
AnswerRe: Restart application on error Pin
Ed.Poore27-Mar-06 8:57
Ed.Poore27-Mar-06 8:57 
GeneralRe: Restart application on error Pin
Expert Coming29-Mar-06 12:35
Expert Coming29-Mar-06 12:35 
QuestionDrag and Drop Label in a Panel Pin
cbeasle127-Mar-06 5:40
cbeasle127-Mar-06 5:40 
AnswerRe: Drag and Drop Label in a Panel Pin
Ravi Bhavnani27-Mar-06 6:55
professionalRavi Bhavnani27-Mar-06 6:55 
QuestionPlz help me convert .doc to any image format Pin
Petrus_Alex27-Mar-06 5:29
Petrus_Alex27-Mar-06 5:29 
QuestionMimic Mouse Click Pin
royk12327-Mar-06 5:29
royk12327-Mar-06 5:29 
AnswerRe: Mimic Mouse Click Pin
Glaxalg27-Mar-06 8:28
Glaxalg27-Mar-06 8:28 
I didn't try this, but it should look like:

<br />
[DllImport("user32.dll")]<br />
public static extern int SendMessage(IntPtr hWnd, UInt32 Msg, int wParam, int lParam)<br />
...<br />
public const UInt32 WM_LBUTTONDOWN = 0x201;<br />
public const UInt32 WM_LBUTTONDOWN = 0x202;<br />
...<br />
private void FakeClick( Control TargetControl, Point MouseLocation )<br />
{<br />
   SendMessage(TargetControl.Handle,WM_LBUTTONDOWN,0,(MouseLocation.Y * 0x10000) + MouseLocation.X);<br />
   SendMessage(TargetControl.Handle,WM_LBUTTONUP,0,(MouseLocation.Y * 0x10000) + MouseLocation.X);<br />
}<br />


In case that you don't have target Control try:
<br />
...<br />
public const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;<br />
public const UInt32 MOUSEEVENTF_LEFTUP   = 0x0004;<br />
...<br />
[DllImport("user32.dll")]<br />
private static extern void mouse_event( UInt32 dwFlags,UInt32 dX,UInt32 dY,UInt32 dwData,IntPtr dwExtraInfo);<br />
...<br />
public static void FakeClick(Point MouseLocation )<br />
{<br />
  Cursor.Position = MouseLocation;<br />
  mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, new System.IntPtr());<br />
  mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, new System.IntPtr());<br />
}<br />

GeneralRe: Mimic Mouse Click Pin
royk12327-Mar-06 17:05
royk12327-Mar-06 17:05 
QuestionToolbox Bug Pin
Dominik Reichl27-Mar-06 5:20
Dominik Reichl27-Mar-06 5:20 
AnswerRe: Toolbox Bug Pin
Jared Parsons27-Mar-06 19:27
Jared Parsons27-Mar-06 19:27 
QuestionFinding unsuccessful updates Pin
Mark0627-Mar-06 4:34
Mark0627-Mar-06 4:34 
AnswerRe: Finding unsuccessful updates Pin
Ricardo Casquete27-Mar-06 5:31
Ricardo Casquete27-Mar-06 5:31 
QuestionHow to cast an int to a String [novice] Pin
Inkimar27-Mar-06 4:29
Inkimar27-Mar-06 4:29 
AnswerRe: How to cast an int to a String [novice] Pin
Jimbo2227-Mar-06 4:38
Jimbo2227-Mar-06 4:38 
AnswerRe: How to cast an int to a String [novice] Pin
Stanciu Vlad27-Mar-06 4:59
Stanciu Vlad27-Mar-06 4:59 
QuestionC# for PDA Pin
hung_ngole27-Mar-06 4:02
hung_ngole27-Mar-06 4:02 
AnswerRe: C# for PDA Pin
Judah Gabriel Himango27-Mar-06 4:15
sponsorJudah Gabriel Himango27-Mar-06 4:15 
QuestionProblems with File Download Pin
SreekanthJ27-Mar-06 3:51
SreekanthJ27-Mar-06 3:51 
GeneralRe: Problems with File Download Pin
Guffa27-Mar-06 7:09
Guffa27-Mar-06 7:09 
QuestionPlease help about TableAdapter Pin
emran83427-Mar-06 3:32
emran83427-Mar-06 3:32 
QuestionLocalization Issue Pin
adityap27-Mar-06 3:13
adityap27-Mar-06 3:13 
AnswerRe: Localization Issue Pin
Ricardo Casquete27-Mar-06 4:24
Ricardo Casquete27-Mar-06 4:24 
QuestionTextbox enter Pin
Dave McCool27-Mar-06 2:57
Dave McCool27-Mar-06 2:57 
AnswerRe: Textbox enter Pin
albCode27-Mar-06 3:11
albCode27-Mar-06 3:11 

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.