VBÖÐShellºÍShellExecuteº¯ÊýµÄʹÓ÷½·¨ºÍÇø±ð
дÁËÒ»¸övbµÄ³ÌÐò£¬ÓÃÀ´°ÑÔÀ´Ð´µÄ¼¸¸övbºÍvcµÄ³ÌÐòÕûºÏÆðÀ´¡£¾ÍÊÇʹÓÃShellº¯Êý¡£½á¹û·¢ÏÖ£¬vcµÄ³ÌÐò¿ÉÒԺܺõÄÏÔʾ£¬µ«vbдµÄÈ´Ò»ÔËÐоÍ×îС»¯ÁË¡£×Ðϸ²é¿´ÁËÒ»ÏÂÒÔÏÂÎÄÕ£¬²Å·¢ÏÖÔÀ´shellº¯ÊýµÄĬÈÏÏÔʾģʽÊÇwindowstyleÊǵÈÓÚvbMinimizedFocus¡£È»ºó¾ÍÊÇÖ±½Ó¼ÓÉÏÒ»¸övbNormalFocus¡£Ò»ÇÐok!
vbµÄshellº¯ÊýÓ÷¨£º
¹¦ÄÜ£ºÖ´ÐÐÒ»¸ö¿ÉÖ´ÐÐÎļþ£¬·µ»ØÒ»¸ö Variant (Double)£¬Èç¹û³É¹¦µÄ»°£¬´ú±íÕâ¸ö³ÌÐòµÄÈÎÎñ ID£¬Èô²»³É¹¦£¬Ôò»á·µ»Ø 0¡£
Óï·¨£ºShell(pathname[,windowstyle])
Shell º¯ÊýµÄÓï·¨º¬ÓÐÏÂÃæÕâЩÃüÃû²ÎÊý£º
pathname ±ØÒª²ÎÊý¡£Variant (String)£¬ÒªÖ´ÐеijÌÐòÃû£¬ÒÔ¼°ÈκαØÐèµÄ²ÎÊý»òÃüÁîÐбäÁ¿£¬¿ÉÄÜ»¹°üÀ¨Ä¿Â¼»òÎļþ¼Ð£¬ÒÔ¼°Çý¶¯Æ÷¡£
Windowstyle ¿ÉÑ¡²ÎÊý¡£Variant (Integer)£¬±íʾÔÚ³ÌÐòÔËÐÐʱ´°¿ÚµÄÑùʽ¡£Èç¹û windowstyle Ê¡ÂÔ£¬Ôò³ÌÐòÊÇÒÔ¾ßÓн¹µãµÄ×îС»¯´°¿ÚÀ´Ö´Ðеġ£
shellExecuteº¯Êý£º
ÆäÓ÷¨½ÏΪ¸´ÔÓ£¬µ«Êǹ¦Äܸü¼ÓÇ¿´ó¡£
HINSTANCE ShellExecute(
HWND hwnd, '¸¸´°¿Ú¾ä±ú
LPCTSTR lpOperation, '²Ù×÷»ò´ò¿ª·½Ê½ "edit","explore","open","find","print","NULL"
LPCTSTR lpFile, 'ÎļþÃû,Ç°Ãæ¿É¼Ó·¾¶
LPCTSTR lpParameters, '²ÎÊý
LPCTSTR lpDirectory, 'ĬÈÏÎļþ¼Ð
INT nShowCmd 'ÏÔʾ·½Ê½
);
ShellExecuteµÄ¹¦ÄÜÊÇÔËÐÐÒ»¸öÍⲿ³ÌÐò
£¨»òÕßÊÇ´ò¿ªÒ»¸öÒÑ×¢²áµÄÎļþ¡¢´ò¿ªÒ»¸öĿ¼¡¢´òÓ¡Ò»¸öÎļþµÈµÈ£©£¬
²¢¶ÔÍⲿ³ÌÐòÓÐÒ»¶¨µÄ¿ØÖÆ¡£shellº¯ÊýÔÚÕâ¸ö·½ÃæÏÈÏà¶Ô½ÏÈõ£¬
ÔÚ´ó¶àÊýÇé¿öÏÂShellExecuteÊǸü¶àµÄ±»Ê¹Óõģ¬
¡¡lR = ShellExecute(Me.hWnd, "Open", sFile, "", "", vbNormalFocus)
¡¡If (lR < 0) Or (lR > 32) Then
¡¡¡¡ ' ³É¹¦
¡¡Else
¡¡¡¡MsgBox "ÎÞ
Ïà¹ØÎĵµ£º
1. ASC(X)£¬Chr(X)£º×ª»»×Ö·û×Ö·ûÂë
[¸ñʽ]£º
P=Asc(X) ·µ»Ø×Ö·û´®XµÄµÚÒ»¸ö×Ö·ûµÄ×Ö·ûÂë
P=Chr(X) ·µ»Ø×Ö·ûÂëµÈÓÚXµÄ×Ö·û
[·¶Àý]£º
(1)P=Chr(65)
‘ Êä³ö×Ö·ûA,ÒòΪAµÄASCIIÂëµÈÓÚ65   ......
Option Explicit
Private Type UNICODE_STRING
Length As Integer
MaximumLength As Integer
Buffer As Long
End Type
Private Type OBJECT_ATTRIBUTES
Length As Long
RootDirectory As Long
  ......
Èç½ñOCX¿Ø¼þÔÚ±à³ÌÖÐÒÑÕ¼ÁìÁ˺ÜÖØÒªµÄµØλ,ÎÒÃÇ¿ÉÒÔÀûÓÃOCX¿Ø¼þÍê³ÉһЩÏ൱¸´Ôӵıà³Ì²Ù×÷¡£Í¬Ê±OCX¿Ø¼þ»¹ÓÐÀûÓÚÖ÷³ÌÐòµÄ¼òµ¥»¯¡¢¹¦ÄܵÄÖØÓá¢Òþ²Ø³ÌÐòʵÏÖϸ½Ú¡¢±ãÓÚÉý¼¶¡¢´«²¥·½±ãµÈÓŵ㡣ÏÖÔÚÎÒÃÇ¿ÉÒÔÀûÓÃVB 5.0·½±ãµØÖÆ×÷³ö×Ô¼ºµÄOCX¿Ø¼þ¹©ÎÒÃÇÔÚ±à³ÌÖÐʹÓã¬Í¬Ê±»¹¿ÉÒÔ°ÑËüË͸øÄãÖÜΧϲ»¶±à³ÌµÄÅóÓÑ!ÏÂÃæÁгöÖÆ ......
½ñÌìÔÚ×öVBÏîÄ¿µÄʱºò£¬Ê¹ÓÃÁËListBox¿Ø¼þÀ´»ñȡһЩÁбíÏÓÃÁ˲ŷ¢ÏÖûÓÐListViewºÃÓã¬ListViewÓÐItems£¨SelectItem£©¿ÉÒÔ¶¨Î»µ½µ±Ç°µÄÑ¡ÖÐÏ¶øListBoxûÓУ»ListViewÓÐTag¿ÉÒÔÉ趨ѡÖÐÏîµÄ±êʾ£¬ListBoxûÓС£ÉÏÍøÒ²ÕÒ²»µ½ÔÒò£¬ÖªµÀÈ¥ÔĶÁMSDNºÍ×Ô¼º²âÊÔ¡£
Ö®ºóÖÕÓÚÕÒµ½ÁËÎÊÌâµÄ¹Ø¼ü¡£
ʼþ1£ºÌí¼ÓListBoxÏ ......
'´´½¨Êý¾Ý¿â
Private Sub Create(ByVal mdbPath As String)
If File.Exists(mdbPath) Then
Throw New Exception("Ä¿±êÊý¾Ý¿âÒѾ´æÔÚ£¬ÎÞ·¨´´½¨")
......