2017-12-19 1 views
0

백그라운드에서 Bluestack 용 자동 클릭 C# 응용 프로그램을 작성해야합니다. Autoit API를 사용하여 시도했는데 클릭하거나 보낼 수 있지만 끌기 & 드롭을 지원하지 않습니다. "user32.dll"PostMessage C#을 사용하여 솔루션을 찾았지만 더 이상 창 10에서 작동하지 않는 것 같습니다.C# 자동으로 클릭하여 다른 응용 프로그램 윈도우로 키 보내기 10

누구나 다른 해결책이 있습니다. 도와주세요. 고마워요!

[DllImport("user32.dll", SetLastError = true)] 
static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); 

PostMessage(handle, (uint)WMessages.WM_LBUTTONDOWN, 0, MAKELPARAM(400, 400)); 

답변

0

클릭 전송에 올바른 창 핸들을 사용하고 있는지 확인하십시오. 내가 윈도우의 핸들에 메시지를 전송하는 시도합니다하고 win10에 마법처럼 일했다
enter image description here

이름 블루스 택스 안드로이드 PluginAndroid {X} {안드로이드 실행의 X => 예}에 있습니다.

Win32.SendMessage(0x00060714, Win32.WM_LBUTTONDOWN, 0x00000001, 0x1E5025B); 

여기에 내가 와우, 당신은 느릅 나무 창 핸들 도구를 사용하면 형제를 사용하는 감사 here

public class Win32 
    { 
     // The WM_COMMAND message is sent when the user selects a command item from 
     // a menu, when a control sends a notification message to its parent window, 
     // or when an accelerator keystroke is translated. 
     public const int WM_KEYDOWN = 0x100; 
     public const int WM_KEYUP = 0x101; 
     public const int WM_COMMAND = 0x111; 
     public const int WM_LBUTTONDOWN = 0x201; 
     public const int WM_LBUTTONUP = 0x202; 
     public const int WM_LBUTTONDBLCLK = 0x203; 
     public const int WM_RBUTTONDOWN = 0x204; 
     public const int WM_RBUTTONUP = 0x205; 
     public const int WM_RBUTTONDBLCLK = 0x206; 

     // The FindWindow function retrieves a handle to the top-level window whose 
    // class name and window name match the specified strings. 
    // This function does not search child windows. 
    // This function does not perform a case-sensitive search. 
    [DllImport("User32.dll")] 
    public static extern int FindWindow(string strClassName, string strWindowName); 

    // The FindWindowEx function retrieves a handle to a window whose class name 
    // and window name match the specified strings. 
    // The function searches child windows, beginning with the one following the 
    // specified child window. 
    // This function does not perform a case-sensitive search. 
    [DllImport("User32.dll")] 
    public static extern int FindWindowEx(
     int hwndParent, 
     int hwndChildAfter, 
     string strClassName, 
     string strWindowName); 


    // The SendMessage function sends the specified message to a window or windows. 
    // It calls the window procedure for the specified window and does not return 
    // until the window procedure has processed the message. 
    [DllImport("User32.dll")] 
    public static extern Int32 SendMessage(
     int hWnd,    // handle to destination window 
     int Msg,    // message 
     int wParam,    // first message parameter 
     [MarshalAs(UnmanagedType.LPStr)] string lParam); // second message parameter 

    [DllImport("User32.dll")] 
    public static extern Int32 SendMessage(
     int hWnd,    // handle to destination window 
     int Msg,    // message 
     int wParam,    // first message parameter 
     int lParam);   // second message parameter 
} 
+0

에서 고른 WINAPI 클래스는 무엇입니까? –

+0

Aman Seth,이 도구를 발견해 주셔서 감사 드리며 매력처럼 작동합니다. 좋은 하루 되세요 :) –

+0

안녕하세요 Aman Seth, 당신은 솔루션을 BS에 드래그 & 드롭 시뮬레이트, 난 WM_LBUTTONDOWN 시도하고 WM_MOUSEMOVE했지만 작동하지, 감사합니다 : D 조 –

관련 문제