Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing FunctionsMod.bas (1.18 KB)
Attribute VB_Name = "FunctionsMod"
Option Explicit
Private Const MAX_PATH = 260
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Const SW_NORMAL = 1
Private Declare Function ShellExecute Lib "shell32" 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
Public Function GetResourceAsString(ResourceName As String, ByVal ResourceId As Integer) As String
GetResourceAsString = StrConv(LoadResData(ResourceId, ResourceName), vbUnicode)
End Function
Public Sub LaunchURL(ByVal URL As String)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, SW_NORMAL
End Sub
Public Sub ExecFile(ByVal File As String, ByVal Path As String)
ShellExecute 0&, vbNullString, File, vbNullString, Path, SW_NORMAL
End Sub
Public Function GetTempDirectory() As String
Dim sBuf As String * MAX_PATH
GetTempPath MAX_PATH, sBuf
If InStr(sBuf, Chr(0)) Then sBuf = Left(sBuf, InStr(sBuf, Chr(0)) - 1)
GetTempDirectory = Trim(sBuf)
End Function