VB °æ (¾«»ªÇø)
·¢ÐÅÈË: bloom (©À©Á©Â©Ã©Ä©Æ©Ç¨), ÐÅÇø: VB
±ê Ìâ: EnumPrinters(´òÓ¡º¯Êý)(תÔØ)
·¢ÐÅÕ¾: ¹þ¹¤´ó×϶¡Ïã (2000Äê09ÔÂ07ÈÕ18:36:36 ÐÇÆÚËÄ), תÐÅ
¡¾ ÒÔÏÂÎÄ×ÖתÔØ×Ô cnTemp ÌÖÂÛÇø ¡¿
¡¾ ÔÎÄÓÉ catchy Ëù·¢±í ¡¿
·¢ÐÅÈË: yucheng (ÎÞ»°¿É˵), ÐÅÇø: VisualBasic
·¢ÐÅÕ¾: BBS ˮľÇ廪վ (Sat Apr 8 01:34:36 2000) WWW-POST
EnumPrinters
VBÉùÃ÷
Declare Function EnumPrinters Lib "winspool.drv" Alias "EnumPrintersA" (ByVal
flags As Long, ByVal name As String, ByVal Level As Long, pPrinterEnum As
Byte, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long
˵Ã÷
ö¾ÙϵͳÖа²×°µÄ´òÓ¡»ú
·µ»ØÖµ
Long£¬·ÇÁã±íʾ³É¹¦£¬Áã±íʾʧ°Ü¡£»áÉèÖÃGetLastError
²ÎÊý±í
²ÎÊý ÀàÐͼ°ËµÃ÷
flags Long£¬Ò»¸ö»ò¶à¸öÏÂÊö±êÖ¾
PRINTER_ENUM_LOCAL ö¾Ù±¾µØ´òÓ¡»ú£¨°üÀ¨Windows 95ÖеÄÍøÂç´òÓ¡»ú£©¡£Ãû×ֻᱻºö
ÂÔ
PRINTER_ENUM_NAME ö¾ÙÓÉname²ÎÊýÖ¸¶¨µÄ´òÓ¡»ú¡£ÆäÖеÄÃû×Ö¿ÉÒÔÊÇÒ»¸ö¹©Ó¦ÉÌ¡¢Óò»ò
·þÎñÆ÷¡£ÈçnameΪNULL£¬Ôòö¾Ù³ö¿ÉÓõĴòÓ¡»ú
PRINTER_ENUM_SHARE ö¾Ù¹²Ïí´òÓ¡»ú£¨±ØÐëͬÆäËû³£Êý×éºÏʹÓã©
PRINTER_ENUM_CONNECTIONS ö¾ÙÍøÂçÁ¬½ÓÁбíÖеĴòÓ¡»ú£¨¼´Ê¹Ä¿Ç°Ã»ÓÐÁ¬½Ó¡ª¡ª½öÊÊ
ÓÃÓÚNT£©
PRINTER_ENUM_NETWORK ö¾Ùͨ¹ýÍøÂçÁ¬½ÓµÄ´òÓ¡»ú¡£¼¶±ð£¨Level£©±ØÐëΪ1¡£½öÊÊÓÃÓÚ
NT
PRINTER_ENUM_REMOTE ö¾Ùͨ¹ýÍøÂçÁ¬½ÓµÄ´òÓ¡»úºÍ´òÓ¡·þÎñÆ÷¡£¼¶±ð±ØÐëΪ1¡£½öÊÊÓÃ
ÓÚNT
name String£¬vbNullString±íʾö¾Ùͬ±¾»úÁ¬½ÓµÄ´òÓ¡»ú¡£·ñÔòÓɱêÖ¾ºÍ¼¶±ð¾ö¶¨
Level Long£¬1£¬2£¬4»ò5£¨4½öÊÊÓÃÓÚNT£»5½öÊÊÓÃÓÚWin95ºÍNT 4.0£©£¬Ö¸¶¨Óûö¾ÙµÄ½á
¹¹µÄÀàÐÍ¡£Èç¹ûÊÇ1£¬Ôòname²ÎÊýÓɱêÖ¾ÉèÖþö¶¨¡£Èç¹ûÊÇ2»ò5£¬ÄÇôname¾Í´ú±íÓû¶ÔÆä
´òÓ¡»ú½øÐÐö¾ÙµÄ·þÎñÆ÷µÄÃû×Ö£»»òÕßΪvbNullString¡£Èç¹ûÊÇ4£¬ÄÇôֻÓÐ
PRINTER_ENUM_LOCALºÍPRINTER_ENUM_CONNECTIONS²ÅÓÐЧ¡£Ãû×Ö±ØÐëÊÇvbNullString
pPrinterEnum Byte£¬°üº¬PRINTER_ENUM_x½á¹¹µÄ»º³åÇø£¬ÆäÖеÄx´ú±í¼¶±ð£¨Level£©
cbBuf Long£¬pPrinterEnum»º³åÇøÖеÄ×Ö·ûÊýÁ¿
pcbNeeded Long£¬Ö¸ÏòÒ»¸öLongÐͱäÁ¿µÄÖ¸Õ룬¸Ã±äÁ¿ÓÃÓÚ±£´æÇëÇóµÄ»º³åÇø³¤¶È£¬»òÕß
ʵ¼Ê¶ÁÈëµÄ×Ö½ÚÊýÁ¿
pcReturned Long£¬ÔØÈ뻺³åÇøµÄ½á¹¹ÊýÁ¿£¨ÓÃÓÚÄÇЩÄÜ·µ»Ø¶à¸ö½á¹¹µÄº¯Êý£©
×¢½â
µÚ4ºÍµÚ5¼¶½«ËüÃǵĽṹ½¨Á¢ÔÚϵͳע²á±íµÄ»ù´¡ÉÏ£¬¶øÇұȵÚ2¼¶¿ìµÃ¶à¡£ºóÕßÒªÇóÿ
̨´òÓ¡»ú¶¼´¦ÓÚ´ò¿ª×´Ì¬
Çë²Î¿¼Î¢ÈíWin32ÊֲᣬÁ˽âÕâ¸öº¯Êý½øÒ»²½µÄÇé¿ö
--
--
¡î À´Ô´:£®¹þ¹¤´ó×϶¡Ïã bbs.hit.edu.cn£®[FROM: casi.bbs@smth.org]
--
¡ù תÔØ:£®¹þ¹¤´ó×϶¡Ïã bbs.hit.edu.cn£®[FROM: 202.118.247.254]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
Ò³ÃæÖ´ÐÐʱ¼ä£º2.042ºÁÃë