VB使用ShellExecute呼叫其他程式

2021-04-14 21:15:28 字數 1087 閱讀 5028

2007-12-24 14:06:30

vb使用shellexecute呼叫其他程式

shellexecute api是功能強大的函式呼叫介面,它不僅可以呼叫不帶引數的可執行檔案,還可以執行帶引數的檔案,如cmd ping 127.0.0.1,還有可以開啟指定的網頁和收發郵件的功能.

宣告:private declare function shellexecute lib "shell32.dll" alias "shellexecutea" _ (byval hwnd as long, byval lpoperation as string, _  byval lpfile as string, byval lpparameters as string, _  byval lpdirectory as string, byval nshowcmd as long) as long

原型:hinstance shellexecute(

hwnd hwnd,          //父視窗控制代碼

lpctstr lpoperation,     //操作,"open","print","explore"

lpctstr lpfile,       //檔名,前面可加路徑

lpctstr lpparameters,    //引數

lpctstr lpdirectory,     //預設資料夾

int nshowcmd         //顯示方式

);開啟乙個應用程式

shellexecute(this-

或shellexecute(this-

開啟乙個同系統程式相關連的文件

shellexecute(this-

啟用相關程式,傳送email

shellexecute(this-

mailto:[email protected]

","","", sw_show );

開啟資料夾

shellexecute(handle, "open", path_to_folder, null, null, sw_shownormal)

用系統印表機列印文件

shellexecute(this-

VB中使用WMI 一

1 引用microsoft wmi scripting dim objserver as wbemscripting.swbemservices dim objset as wbemscripting.swbemobjectset dim obj as wbemscripting.swbemobje...

VB 中的BatchUpdate 使用

由於舊系統的維護,仍偶爾使用vb6,發現要真正有效使用 recordset 的 batchupdate 方法,還必須配合別乙個引數cachesize 預設值為1 才可以,否則和正常的 update 沒有什麼區別,無法發揮 batch 的批量更新作用,及加快儲存速度。設定批量更新時使用的緩衝記錄數量,...

vb教材筆記 VB學習筆記 VB語言

print a 2 case else print a does not equal to 1 or 2.end select 五 迴圈語句 迴圈結構是計算機語言裡一種重要的結構,它的應用廣泛,最簡單的例子是累加器的作用,還可以用於窮舉法,更直觀的例子是把某件事重複指定的次數,這樣就不用把要重複的語...