VB編程的幾個API函數(shù)的應(yīng)用問題

字號:

q :--怎樣在我的程序中實現(xiàn)文件下載
    re:
    一個例子:一個command,兩個text 代碼如下:
    private declare function dofiledownload lib "shdocvw.dll" (byval lpszfile as string) as long
    private sub command1_click()
    dim sdownload as string
    sdownload = strconv(text1.text, vbunicode)
    call dofiledownload(sdownload)
    end sub
    private sub form_load()
    text1.text = "http://pic02.newdu.com/uploads/202503/19/system_missing2548.html = "audiograbber 1.62 full"
    text2.text = "http://www6.50megs.com/audiograbber/demos/cr-ag161.zip"
    end sub
    q :--如何在vb中定義一個熱鍵,使得當(dāng)一個應(yīng)用程序的窗口最小化后,可以通過熱鍵來喚醒它
    re:
    先聲明api函數(shù)sendmessage,然后添加一個按鈕和如下代碼;
    private declare function sendmessage lib "user32" alias "sendmessagea" (byva l hwnd as long, byval_    wmsg as long, byval wparam as long, lparam as any) as long
    private sub command1_click()
    dim wkey as long
    wkey = 66
    x = sendmessage(me.hwnd, wm_sethotkey, wkey, 0)
    msgbox "b 鍵將激活窗體!", 64, "定義快捷鍵"
    end sub