- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2013-8-22 23:58 ½s¿è
1.¤§«eªº°ÝÃD¡A¸g¦A´ú¸ÕµLªk¦Û°ÊÃö±¼°T®§µ¡
¬O¦]¬°¶]¤U±ªºµ{¦¡,¤£ª¾¦³µL¿ìªk§ïµ½?
¦n¹³¥un¦³¦b¶]ti ...
t8899 µoªí©ó 2013-8-22 04:35
1. ³o§Ú¤]¤£ª¾¹D,¤£¹L¾Ú§Ú©Òª¾ Excel VBA ²¦³º¤£¬O³æ¯Âªº VB ¨t²Î,
¦b¬Y¨Ç±¡§Î¤UÁÙ¬O·|µo¥Í¬Y¨Ç§ÚÌı±o¤£¤Ó¯à²z¸Ñªºª¬ªp.
³Ì²³æªº¨Ò¤l¬OY¬Y®É¶¡¦³¶}¤F¨âÓ Excel ÀÉ®×,¨ä¤¤¤@Ó¦³ Excel VBA µ{¦¡ªºÀÉ®×,
¦³¥i¯à·|¤zÂZ¨ì¥t¤@Ó¨S¦³ VBA µ{¦¡Àɮתº½s¿è§@·~.(¤×¨ä¬O Worksheet_Change »P Worksheet_SelectionChange µ{§Ç³Ì©öµo¥Í¦¹ª¬ªp)
¨Ì§Aªº±Ôz¬Ý°_¨Ó,
¥¦¥i¯à¤£¯à¦P®É°õ¦æ¤Ó¦hªº Application.OnTime µ{¦¡.(ºÃ¦ü·|¦³¬Û¤¬¤zÂZªº±¡§Î¥X²{)
·íµM³oÓ´N¬O«Ü¤º³¡ªºªF¦è¤F,
·í Excel VBA ¨C©I¥s¤@¦¸ Application.OnTime µ{¦¡,
¬O§_´N·|°t¸m¤@Óµ{§ÇªÅ¶¡¨Ó¦s©ñ¸Óµ{¦¡¹B§@¤¤ªºÅܼÆ,
ª½¨ì¸Óµ{¦¡µ²§ô¤~ÄÀ©ñ±¼¸ÓªÅ¶¡?
¥ç©Î¬O¥un¬O°õ¦æ¸Óµ{¦¡,
´N³£¬O¨Ï¥Î¦P¤@Óµ{§ÇªÅ¶¡¸ÌªºÅܼƩO?
Y¬O«áªÌ¨º¥X²{§A»¡ªº±¡§ÎÀ³¸Ó´N¤£·N¥~¤F.
¦ÓY¯un¬O³oÓ°ÝÃD¤]¬O¦³¤èªk¸Ñ¨Mªº°Õ,
¥un "¨CÓ" ©I¥sªºµ{¦¡³£¤£¦P´N¤£·|¤¬¬Û¤zÂZ¤F,
¥ç§Yn½T«O¦P¤@®É¶¡¦b¶]ªº OnTime µ{¦¡³£¬O¦b¤£¦Pµ{¦¡°Ï¶ô¤¤§Y¥i.
¥i¤£¥i¦æ§Ú¤£ª¾¹D§A¥i¥H¸Õ¸Õ¬Ý.
2. »P¤W¤èªº©w¸q¤º®e¤@¤@¤ñ¹ï§Y¥iª¾¹D¿ù»~¥X¦bþ¸Ì¤F:
§Aªº©I¥sµ{¦¡¬° :
MsgBoxTest 0, "", "", sStr, 0, 2500
¦Ó¨ä©w¸q«h¬° :
Private Declare Function MsgBoxTest Lib "user32" Alias "MessageBoxTimeoutA" ( _
ByVal hwnd As Long, _ <=== ¤W±ªº 0 , OK
ByVal lpText As String, _ <=== ¤W±ªº "", OK
ByVal lpCaption As String, _ <=== ¤W±ªº "", OK
ByVal wType As VbMsgBoxStyle, _ <=== ¤W±ªº sStr, ¿ù»~¥X¦b¦¹
ByVal wlange As Long, _ <=== ¤W±ªº 0, OK
ByVal dwTimeout As Long _ <=== ¤W±ªº 2500, OK
) As Long
¦Ü©ó VbMsgBoxStyle?
¦b http://www.codeproject.com/Articles/7914/MessageBoxTimeout-API
¤W¬Ý¨ì : uiFlags = MB_YESNO|MB_SETFOREGROUND|MB_SYSTEMMODAL|MB_ICONINFORMATION
¥B
http://www.pinvoke.net/default.aspx/user32/MessageBoxTimeout.html?diff=y
¤W¬Ý¨ì¸Ó°Ñ¼Æ¥i©w¸q¬° ByVal MessageBoxOptions As Long
©Ò¥H¦Ü¤Ö¨ºÀ³¸Ó¬OӼƦr¦Ó«D¤å¦r¤~¬O,
¦Ó¦b http://baike.baidu.com/view/5079352.htm
³o¸Ì¦³¸Ô²Ó»¡©ú¦UÓ¼ÆȪº©w¸q.
¦Ü©ó sStr «hÀ³©ñ¦b lpText As String ¤W.
ºî¤W§A¥i¥H¸Õ¸Õ :
MsgBoxTest 0, sStr, "´£¥Ü°T®§", 0, 0, 2500
3. FindWindow n¥ýª¾¹D¸Óµøµ¡ªº handle ©Î¬O ¨¬¸ê¿ëÃѸӵøµ¡ªº¸ê®Æ¤~¯à§ä¨ì¸Óµøµ¡,
³oÓ§Ún¦A¬d¬d¬Ý¬O§_¦³¥i¯à¸Ñ¨M. |
|