Mengakses file *.chm dari aplikasi Vb Anda

Waktu kemarin-kemarin banyak yang menanyakan bagaimana caranya aplikasi yang dibuat dalam Visual Basic dapat mengakses file *.chm, sebenarnya sih tidak terlalu ribet, namun ada beberapa fungsi Api yang digunakan untuk sourcecode lengkapnya silahkan lihat dibawah…

Const AppFile As String = “dodol.chm” ‘Nama File *.chm Anda!
Dim ExecPath As String ‘Path untuk *.chm Anda!
Private Declare Function ShellExecute Lib “shell32.dll” Alias “ShellExecuteA” _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Public Function LaunchApp(ByVal URL As String) As Long
Dim strFile As String
‘Fungsi API untuk mengakses file *.chm
‘Fungsi API untuk membuka file *.chm

On Error Resume Next
strFile = ShellExecute(0&, vbNullString, URL, vbNullString, _
vbNullString, vbNormalFocus)
End Function

Private Sub Command1_Click()
ExecPath = IIf(“/” = Mid(App.Path, Len(App.Path)), App.Path, App.Path) & AppFile
LaunchApp (App.Path & AppFile)
End Sub

‘————–End Of Code—————–

About aperta
Nothing or Less.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: