게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
c# 질문좀 드리겠씁니다.
게시물ID : programmer_22886짧은주소 복사하기
작성자 : 김춘삼나와
추천 : 0
조회수 : 1791회
댓글수 : 4개
등록시간 : 2019/04/20 15:53:40
안녕하세요

이제 막 취미삼아 프로그래밍공부를 하고 있는데요
c#으로 공부중에 재미를 느끼기위해 간단한 게임 매크로를 만들어볼려고 하는데 
너무 막히는 부분이 있어 질문좀 드리겠습니다.



  public partial class Form1 : Form
    {
        [System.Runtime.InteropServices.DllImport("User32", EntryPoint = "FindWindow")]
        private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, IntPtr lParam);

        [System.Runtime.InteropServices.DllImport("User32.dll")]
        public static extern IntPtr FindWindowEx(IntPtr Parent, IntPtr Child, string lpszClass, string lpszWindows);

        public const int WM_LBUTTONDOWN = 0x201;
        public const int WM_LBUTTONUP = 0x202;


        String AppPlayerName = "LDPlayer";
  

        public Form1()
        {
            InitializeComponent();
        }

public void InClick(int x, int y)
        {
 
                Debug.WriteLine("클릭");

                IntPtr hwnd_child = FindWindowEx(findwindow, IntPtr.Zero, null, "TheRender");
                IntPtr lparam = new IntPtr(x | (y << 16));

                SendMessage(hwnd_child, WM_LBUTTONDOWN, 1, lparam);
                SendMessage(hwnd_child, WM_LBUTTONUP, 0, lparam);
            
        }
     private void Button1_Click(object sender, EventArgs e)
        {
            InClick(780 , 630);
        }
    }



여기서 아무리 버튼을 눌러도 클릭이 안되는데 혹시 왜그런가 해서요....



전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호