흠.. 예전에 임프님이 퍼오신 것을 따라해보세요. ^^
http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_tip&no=1
버튼 왔다갔다 누르기를 하고 싶으면...
1번에서 타이머를 작동시켜서 타이머 루프를 돌때마다 1번 버튼과 2번 버튼을 누르도록 해주면 될 것 같습니다.
김민준 님이 쓰신 글 :
: 아직 빌더 초보라서 이해가 안가서 뒤늦게 ,...
:
: {
: mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //마우스 LeftButton Down이벤트를 발생시킴
: mouse_event(MOUSEEVENTF_LEFTUP, 0,0, 0, 0);
: }
: 지금 테스트 하는 소스예요
:
: 버튼 1이 잇고 2잇으면 버튼1누르면 1번과 2번을 왓다리 갓다리 하고싶은데
:
: 빌더의 from 496,160 이 위치에 잇다면 숫자에 496,65535,160,65535 라고 넣어야 하나요?..
:
: 좌표입력해서 클릭하게하는거 알고계시다면 알려주세요..
:
: Nibble 님이 쓰신 글 :
: : mouse_event 를 치시고 F1을 눌러보시면
: :
: : dx
: :
: : Specifies the mouse's absolute position along the x-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is given as the mouse's actual x-coordinate; relative data is given as the number of mickeys moved.
: :
: : dy
: :
: : Specifies the mouse's absolute position along the y-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is given as the mouse's actual y-coordinate; relative data is given as the number of mickeys moved.
: :
: : 라고 설명이 나오죠.
: :
: : 그리고
: :
: : If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
: :
: : If the MOUSEEVENTF_ABSOLUTE value is not specified, dx and dy specify relative motions from when the last mouse event was generated (the last reported position). Positive values mean the mouse moved right (or down); negative values mean the mouse moved left (or up).
: :
: : 라고 덧붙여져 있어요.
: :
: : 즉, 화면을 절대 좌표계로 움직이고 싶을땐, dwFlags 에 MOUSEEVENTF_ABSOLUTE 옵션을 거셔야 하는데
: : 이때, 화면을 가로 0 ~ 65535, 세로 0 ~ 65535 로 입력해주셔야 한다는거죠.
: : 모니터가 1280 * 960 이면, 0 ~ 1279, 0 ~ 959 좌표일텐데,
: : 1279, 959 로 보내기 위해선 65535, 65535 를 주셔야 한다는거죠
: :
: : 이걸 계산식으로 하면
: :
: : dx = 보내고 싶은 가로 좌표 * 65535 / (모니터의 가로 해상도 - 1)
: : dy = 보내고 싶은 세로 좌표 * 65535 / (모니터의 세로 해상도 - 1)
: :
: : 이란 소리가 되겠죠?
: :
: : 40, 80 으로 보내고 싶을땐
: :
: : dx = 40 * 65535 / (Screen->Width - 1);
: : dy = 80 * 65535 / (Screen->Height - 1);
: :
: : 처럼 하시면 됩니다.
: :
: : ㅎㅎ 님이 쓰신 글 :
: : : 네
: : :
: : : 김민준 님이 쓰신 글 :
: : : : "둘리"님과 "장성호" 님께서 답변해주신 글들 보고 마우스 이벤트를 테스트 하려는데요
: : : :
: : : : 여기서 또 하나의 궁금증이 생깁니다
: : : :
: : : : VOID mouse_event( DWORD dwFlags,
: : : : DWORD dx,
: : : : DWORD dy,
: : : : DWORD dwData,
: : : : ULONG_PTR dwExtraInfo
: : : : );
: : : :
: : : : 이 과정은 "둘리"님 께서 링크로 올려주신 부분인데요
: : : :
: : : : 질문1. x,y 값은 컴퓨터의 크기 (ex : 1280x960) 에 비례하는건가요 아니면 c++빌더의 from 에 비례하는건가요
: : : :
: : : : 질문2. mouse_event(MOUSEEVENTF_LEFTDOWN, 0,0, 0, 0); 여기서 첫번째 숫자부터 x,y,dwData,dwExtralmfo 이 순서가 맞나요?
: : : :
: : : : 질문3. 테스트 할때 버튼1을 누르면 1->2->1->2->1->2 반복적으로 클릭하게 하고싶은데
: : : : dwData와 dwExtralnfo 의 용도는 무엇인가요... 그리고 마우스 이벤트 이외의 소스를 넣어야 하나요?