Click here to Skip to main content
15,920,632 members
Home / Discussions / C#
   

C#

 
GeneralRe: Plzzzzzzzz Help me Pin
maliaslam25-Oct-08 20:54
maliaslam25-Oct-08 20:54 
GeneralRe: Plzzzzzzzz Help me Pin
Dave Kreskowiak26-Oct-08 3:48
mveDave Kreskowiak26-Oct-08 3:48 
JokeRe: Plzzzzzzzz Help me Pin
Mark Salsbery27-Oct-08 5:40
Mark Salsbery27-Oct-08 5:40 
GeneralRe: Plzzzzzzzz Help me Pin
Dave Kreskowiak27-Oct-08 11:04
mveDave Kreskowiak27-Oct-08 11:04 
AnswerCP Ignore Pin
leckey25-Oct-08 15:07
leckey25-Oct-08 15:07 
AnswerRe: Plzzzzzzzz Help me Pin
Pete O'Hanlon26-Oct-08 10:02
mvePete O'Hanlon26-Oct-08 10:02 
GeneralRe: Plzzzzzzzz Help me Pin
Vasudevan Deepak Kumar27-Oct-08 7:41
Vasudevan Deepak Kumar27-Oct-08 7:41 
QuestionHow to send control over mouse scroll in c# ? Pin
parinya225-Oct-08 5:55
parinya225-Oct-08 5:55 
Hi everyone, I'm developing an application that can control the mouse to do things. Now my app can force the mouse to move to any point and do left click or right click. Before I explain my problem about mouse scroll, I'd like to show my code to you.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;

namespace SeniorProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Process[] p = Process.GetProcessesByName("winword");
if (p.Length > 0)
{
// Set focus on Microsoft Word program when user click button 1
SetForegroundWindow(p[0].MainWindowHandle);
Thread.Sleep(10);
}
Cursor.Position = new Point(100,200); // Bring pointer to (100,200)
const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;
const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;
const UInt32 MOUSEEVENTF_WHEEL = 0x0800;

UInt32 x = Convert.ToUInt32(Cursor.Position.X);
UInt32 y = Convert.ToUInt32(Cursor.Position.Y);

mouse_event(MOUSEEVENTF_WHEEL, x, y, 0x0010, new IntPtr());//Force the mouse to scroll
}

[DllImport("user32.dll")]
public static extern void mouse_event
(
UInt32 dwFlags, // motion and click options
UInt32 dx, // horizontal position or change
UInt32 dy, // vertical position or change
UInt32 dwData, // wheel movement
IntPtr dwExtraInfo // application-defined information
);
}
}

You see "0x0010" in the function mouse_event, right? The problem is that I cannot force the mouse to scroll down no matter what number I use, it will always scroll up. If I use greater number such as 0x0200 it will scroll up faster than less number such as 0x0010 but I really want it to scroll down T_T. So if anyone know how to make the mouse scroll down, please tell me and I'll really appreciate your help. Thanks a lot.
AnswerRe: How to send control over mouse scroll in c# ? Pin
DaveyM6925-Oct-08 6:55
professionalDaveyM6925-Oct-08 6:55 
GeneralRe: How to send control over mouse scroll in c# ? Pin
parinya225-Oct-08 7:18
parinya225-Oct-08 7:18 
GeneralRe: How to send control over mouse scroll in c# ? Pin
DaveyM6925-Oct-08 9:03
professionalDaveyM6925-Oct-08 9:03 
QuestionWindows Form Controls [modified] Pin
Ankit Rajpoot25-Oct-08 2:30
Ankit Rajpoot25-Oct-08 2:30 
AnswerRe: Windows Form Controls Pin
Eddy Vluggen25-Oct-08 8:49
professionalEddy Vluggen25-Oct-08 8:49 
GeneralRe: Windows Form Controls Pin
Ankit Rajpoot25-Oct-08 18:49
Ankit Rajpoot25-Oct-08 18:49 
AnswerRe: Windows Form Controls Pin
Eddy Vluggen27-Oct-08 0:01
professionalEddy Vluggen27-Oct-08 0:01 
QuestionRe: Windows Form Controls Pin
Ankit Rajpoot28-Oct-08 2:17
Ankit Rajpoot28-Oct-08 2:17 
AnswerRe: Windows Form Controls Pin
Eddy Vluggen28-Oct-08 2:32
professionalEddy Vluggen28-Oct-08 2:32 
Questionwanna create script for a table using c# Pin
yazali25-Oct-08 2:20
yazali25-Oct-08 2:20 
AnswerRe: wanna create script for a table using c# Pin
Wendelius25-Oct-08 2:22
mentorWendelius25-Oct-08 2:22 
QuestionHow get the right xml element name using DataSet as a data source for DataGridView? Pin
andrehh25-Oct-08 0:45
andrehh25-Oct-08 0:45 
AnswerRe: How get the right xml element name using DataSet as a data source for DataGridView? Pin
Wendelius25-Oct-08 2:08
mentorWendelius25-Oct-08 2:08 
QuestionException classes Pin
joindotnet24-Oct-08 21:53
joindotnet24-Oct-08 21:53 
AnswerRe: Exception classes Pin
DaveyM6924-Oct-08 22:09
professionalDaveyM6924-Oct-08 22:09 
Questionhow to convert access (mdb) to sdf (for PPC) Pin
E_Gold24-Oct-08 21:42
E_Gold24-Oct-08 21:42 
Questionimage in byte [] Pin
nelsonpaixao24-Oct-08 14:02
nelsonpaixao24-Oct-08 14:02 

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.