Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 01-16-2010, 03:41 PM   #1 (permalink)
adecker
Recruit
 
Join Date: Oct 2009
Posts: 3
adecker is on a distinguished road
C# Mouse Click?

How do you send a Single Left mouse click? How about a a Double Left? Searched google...Found NOTHING.
adecker is offline   Reply With Quote
Old 02-22-2010, 12:25 AM   #2 (permalink)
articlesocial
Recruit
 
Join Date: Feb 2010
Posts: 1
articlesocial is on a distinguished road
Quote:
Originally Posted by adecker View Post
How do you send a Single Left mouse click? How about a a Double Left? Searched google...Found NOTHING.
I will come back. hope to find the answer
------------

Last edited by redhead; 02-22-2010 at 01:24 AM. Reason: removed SEO link
articlesocial is offline   Reply With Quote
Old 02-22-2010, 01:32 AM   #3 (permalink)
redhead
Super Moderator
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,878
redhead is on a distinguished road
Here are a few pointers:
Detecting mouse buttons events
Notice:
Code:
...
private void ButtonDown(object sender, MouseEventArgs mea)
{
    if (mea.Button == MouseButtons.Left) { //Check for left button click
...
How to detect a mouse double click
Notice:
Code:
void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    if (e.ClickCount == 2) //if double clicked
   {
        //my code
   }
}
Do you want to combine those two, or should I ??
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is online now   Reply With Quote
Old 02-22-2010, 08:56 AM   #4 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 841
DJMaze is on a distinguished road
that is about receiving events but he wants to "send" (emulate) the event.

The Windows SDK tells you how (user32.dll API): SendInput Function ()

Code:
void LeftClick ( )
{  
  INPUT    Input={0};
  // left down 
  Input.type       = INPUT_MOUSE;
  Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
  ::SendInput(1,&Input,sizeof(INPUT));

  // left up
  ::ZeroMemory(&Input,sizeof(INPUT));
  Input.type       = INPUT_MOUSE;
  Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
  ::SendInput(1,&Input,sizeof(INPUT));
}
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Map one click to three clicks dafrazzman Windows 1 01-15-2010 08:43 AM
VBA: How do I click OK on pop-up dialogue box bconner MS Technologies ( ASP, VB, C#, .NET ) 0 04-19-2009 04:55 PM
click to call using PHP suforum PHP 0 09-23-2008 07:32 AM
help with dot.tk, how do you make a new box come up when you click a link? fatasspenguin HTML, XML, Javascript, AJAX 1 10-10-2004 08:40 AM
About the Right-click Context Menu plonkeroo Windows 3 09-29-2004 04:39 PM


All times are GMT -8. The time now is 12:49 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting