打印本文 打印本文 关闭窗口 关闭窗口
用VB6.0编写自我升级的程序(一)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数1912  更新时间:2009/4/23 15:03:45  文章录入:mintao  责任编辑:mintao

        StringFromBuffer = Left$(Buffer, nPos - 1)

    Else

        StringFromBuffer = Buffer

    End If

End Function

 

'''' ===============================================

'''' 读Ini文件

''''

'''' ===============================================

Public Function ReadIniFile(ByVal strIniFile As String, ByVal strSection As String, ByVal strKey As String, Optional ByVal strKeyDefault As String = vbNullString) As String

    Dim strBuffer As String

    strBuffer = Space$(gintMAX_SIZE)

 

    If GetPrivateProfileString(strSection, strKey, strKeyDefault, strBuffer, gintMAX_SIZE, strIniFile) Then

       ReadIniFile = StringFromBuffer(strBuffer)

    End If

End Function

 

'''' 检查文件是否存在

Function FileExists(filename As String) As Boolean

    On Error Resume Next

    FileExists = (Dir$(filename) <> "")

End Function

 

'''' 改变标签的文本及位置

Public Function ChangeLabelPos(frm As Form, lbl As Label, msg As String)

 

     With lbl

          .Caption = msg

          .Left = (frm.ScaleWidth - .Width) / 2

          .Top = .Height / 2

     End With

End Function

 

''''关闭窗体

Function CloseValidForm(Ret As String) As Boolean

   Dim WinWnd As Long

   

   ''''搜寻该窗口的句柄

   WinWnd = FindWindow(vbNullString, Ret)

   If WinWnd <> 0 Then

      SendMessage WinWnd, WM_Close, 0&, 0&

   End If

   CloseValidForm = True

End Function

 

 

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口