VB编程的几个API函数的应用问题

时间:2010-01-26 10:10:45  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:te Sub Command1_Click()      Dim sDownload As String      sDownload = StrConv(Text1.Text, VBUnicode)      Call DoFileDownload(sDownload)      End Sub    Private Sub Form_Load()      Text1.Text = "http://www.chat.ru/~softdaily/fo-ag162.zip"      Form1.Caption = "A...
  正文:

Q :--怎样在我的程序中实现文件下载

  Re:

  一个例子:一个Command,两个Text 代码如下:

     Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lphotoshop/ target=_blank class=infotextkey>pszFile 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://www.chat.ru/~softdaily/fo-ag162.zip"

     Form1.Caption = "Audiograbber 1.62 Full"

     Text2.Text = "http://www6.50megs.com/audiograbber/demos/cr-ag161.zip"

     End Sub

  Q :--如何在VB中定义一个热键,使得当一个应用程序的窗口最小化后,可以通过热键来唤醒它

  Re:

  先声明API函数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

  

  enjoy it!

VB编程的几个API函数的应用问题》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/VB/12406.html


关键字:

关于《VB编程的几个API函数的应用问题》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td