¡¡XiaoHui.Net Ц»ã³ÌÐòÔ±ÂÛ̳ ¡ú .Net ÌÖÂÛÇø

   Çë½ÌÒ»¸ö¹ØÓÚmouse_eventµÄÎÊÌâ¡£


Ò³: [1]

bibi2006-4-23 03:45
Çë½ÌÒ»¸ö¹ØÓÚmouse_eventµÄÎÊÌâ¡£

ÇëÎÊmouse_eventÄܲ»ÄÜÄ£Äâµã»÷´°ÌåÒÔÍâµÄÇøÓò£¬ÎÒÊÔÑéÁËһϣ¬ÏȽ¨ÁËÒ»¸öÓ¦ÓóÌÐò´°Ì壬ÉÏÃæÓÐÒ»¸ö°´Å¥£¬Ö»Òª±»µãÖУ¬¾Í»áµ¯³ö¶Ô»°¿ò£¬È»ºóÎÒÓÖ½¨ÁËÒ»¸ö³ÌÐò£¬Ä£ÄâµÄÊÇÔÚǰһ¸ö³ÌÐòµÄ°´Å¥µÄ×ø±êλÖõ¥»ú£¬µ±ÎÒÏÈÔËÐеÚÒ»¸ö³ÌÐòºó£¬È»ºóÔÙÔËÐеڶþ¸ö³ÌÐò£¬½á¹ûȴûÓе¯³ö¶Ô»°¿ò£¿ÇëÎÊÄÄλ´óÏÀÖªµÀÎÊÌâµÄÔ­ÒòºÍ½â¾ö°ì·¨£¿


Tramper2006-4-23 04:36
mouse_event Ö§³Ö´°ÌåÍâµã»÷µÄ. ËûµÄ×ù±êÓ¦¸ÃÊÇÄãµÄÆÁĻȫ¾Ö×ø±ê. ÀýÈçÕâÑù:
[code]
mouse_event( MOUSEEVENTF_LEFTDOWN, x, y, 0, GetMessageExtraInfo() );
mouse_event( MOUSEEVENTF_LEFTUP, x, y, 0, GetMessageExtraInfo() );
[/code]

ÏÈ·¢ËÍMOUSEEVENTF_LEFTDOWN, ÔÙ·¢ËÍ MOUSEEVENTF_LEFTUP

Tramper2006-4-23 04:40
²»¹ý, ¸ù¾Ý MSDN µÄ˵·¨, ÔÚ windows np/xp/2000 ÏÂ, ´Ëº¯ÊýÒѾ­±»È¡´ú. ½¨ÒéÄãÓà SendInput ´úÌæ:

[code]
mouse_event
The mouse_event function synthesizes mouse motion and button clicks.

Windows NT/2000/XP: This function has been superseded. Use SendInput instead.

VOID mouse_event(
  DWORD dwFlags,         // motion and click options
  DWORD dx,              // horizontal position or change
  DWORD dy,              // vertical position or change
  DWORD dwData,          // wheel movement
  ULONG_PTR dwExtraInfo  // application-defined information
);
[/code]

[b] SendInput º¯Êý: [/b]

SendInput
The SendInput function synthesizes keystrokes, mouse motions, and button clicks.

[code]
UINT SendInput(
  UINT nInputs,     // count of input events
  LPINPUT pInputs,  // array of input events
  int cbSize        // size of structure
);
[/code]

[[i] ±¾Ìû×îºóÓÉ Tramper ÓÚ 2006-4-23 12:52 ±à¼­ [/i]]

bibi2006-4-23 07:34
ÎÒ·´¸´ÊÔÑéÁËmouse_event£¬°ÑµÚÒ»¸ö³ÌÐòµÄ°´Å¥À©´óµ½¼¸ºõÆÁÄ»ÄÇÄ©´óÁË£¬µ«»¹ÊDz»ÐС£ÎÒ²»Ì«»áʹSendInput£¨£©º¯Êý£¬Äܲ»ÄܸøÎÒ¸öÔÙÏà¶ÔÆÁÄ»×ø±ê100£¬100λÖÃÉÏµÄ Ä£ÄâÊó±êµ¥»÷³ÌÐò¡£Ð»Ð»ÁË!´óÏÀ¡£


²é¿´ÍêÕû°æ±¾: Çë½ÌÒ»¸ö¹ØÓÚmouse_eventµÄÎÊÌâ¡£