Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I know the feeling.

 

I don't know how to send a mouse click to the application but you can programatically click a button or select an item in a listbox ext.

 

Here is an example for a button.

Button bu=new Button;

bu.PerformClick();

 

There probably is a windows message you can send to the form that will simulate a click using the Api SendMessage but I have never done that.

 

I have a list of the windows messages if you want that.

C#
Posted
actually i just really want to have a program that can disconnect me from the internet and since nobody can tell me how on my other post I thought this would be a good temporary solutoin...Of course I would rather have some code to simply to drop the connection so if you or anybody else could advise me on it I will be very pleased:D
Posted

sorry for being so annoying buy I am very new to vb and I really tried fixing it to work but it doesnt seem to respont properly. I have to coordinates on which I want to click. One with right click and one with left. on that site there seems to be alot of extra code I dont need. Could you maybe show me a better example of what I need. I also did a bit mroe research and found that maybe its possible to use mouse_event. But again the example is ony for vb6 and it doesnt seem to work on .net.

Please help me!!!

  • *Experts*
Posted

If you want to use mouse_event this the simplest example:

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MOVE = &H1
mouse_event(MOUSEEVENTF_MOVE, x-axiscoord, yaxiscoord, 0, 0)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...