Autor Beitrag
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Fr 19.06.09 17:13 
user profile iconFragSalat hat folgendes geschrieben Zum zitierten Posting springen:
ich hab nen beispiel in visual basic aber das funzt nicht wenn ichs in c# anwende
Sollte es aber theoretisch ;) . Hier wurden ja schon ein paar Ansätze genannt, ansonsten bräuchten wir das VB-Original und deine Übersetzung.

_________________
>λ=
FragSalat
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 04.07.09 23:31 
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
        public void SendMouseClick(Process proc, Point location)
        {
            // this private method sends mouse clicks to a given point location
            // get the process' window handle
            IntPtr hWnd = GetWindowHandle(proc);
            // store the handle and process in a HandleRef
            HandleRef hRef = new HandleRef(proc, hWnd);
            // send the MouseButtonDown message using SendMessage
            win32API.SendMessage(hRef, System.Convert.ToUInt32(win32API.WM_Cmd.WM_LBUTTONDOWN), IntPtr.Zero, (IntPtr)(((location.Y * 0X10000) + location.X)));
            // sleep a bit
            System.Threading.Thread.Sleep(50);
            // send the MouseButtonUp message using SendMessage
            win32API.SendMessage(hRef, System.Convert.ToUInt32(win32API.WM_Cmd.WM_LBUTTONUP), IntPtr.Zero, (IntPtr)(((location.Y * 0X10000) + location.X)));



damit will ich nen mausklick senden habs aber auch schon damit probiert

ausblenden C#-Quelltext
1:
2:
SendMessage(HWND, WM_LBUTTONDOWN, MK_LBUTTON, (((location.Y * 0X10000) + location.X)));
SendMessage(HWND, WM_LBUTTONUP, MK_LBUTTON, (((location.Y * 0X10000) + location.X)));


was aber auch nicht geht