Shim Ai QiWang Blog
Headlines News :
Home » , , , » Open Progress Wait Coding VB 6.0

Steven Martin ( Shim Ai QiWang ) :: Open Progress Wait Coding VB 6.0

Written By Unknown on Minggu, 29 Desember 2013 | 15.08

Kode ini untuk menunggu saat program lain telah dibuka. Dan untuk melanjukan prossess program sampai program lain tersebut ditutup. Semoga bermanffaaat dan berikut kodenya :

'=========================================================
' Improving the Shell Function
' --------------------------------
' Author  : Stephanus B.S (Shim Ai QiWang)
' Website : www.shimaiqiwang.blogspot.com
' Source  : http://shimaiqiwang.blogspot.com/2013/12/open-progress-wait-coding-vb-60.html
' Lisence : http://creativecommons.org/licenses/by/4.0/
' Copyleft (c)2013 Shim Ai QiWang. All Rights Reseverd.
'=========================================================

Public Declare Function OpenProcess Lib "kernel32" _
  (ByVal dwDesiredAccess As Long, _
  ByVal bInheritHandle As Long, _
  ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib _
  "kernel32" (ByVal hHandle As Long, _
  ByVal dwMilliseconds As Long) As Long
Const SYNCHRONIZE = &H100000
Const INFINITE = &HFFFF

Private Sub ShellProgramAndWait(ProgramName As String)

Dim hHandle As Long, pid As Long

txtStatus.Text = "Processing"
txtStatus.Refresh
pid = Shell(ProgramName, vbNormalFocus)
If pid <> 0 Then
    hHandle = OpenProcess(SYNCHRONIZE, 0&, pid)
    WaitForSingleObject hHandle, INFINITE
    txtStatus.Text = "Finished"
Else
    txtStatus.Text = "Error shelling " & ProgramName
End If

End Sub



Demikian selesainya Artikel diatas. Kiranya dapat menambah wawasan ilmu pengetahuan, Semoga dapat bermanfaat. Jadilah Orang yang baik dan berguna untuk menjunjung tinggi nama bangsa. Perbanyak kebaikan, maka indah pada waktunya.
Teman-Teman, Sobat Penggemar Komputer Jangan Lupa memberi Sumber di Blog atau Project Aplikasi kamu ya?
Source : http://shimaiqiwang.blogspot.com/2013/12/open-progress-wait-coding-vb-60.html
Source : 
http://shimaiqiwang.blogspot.com/2013/12/open-progress-wait-coding-vb-60.html

Atas Perhatian dan kunjungannya, Shim Ai QiWang™ mengucapkan terima kasih...

Dengan Hormat,
Shim Ai QiWang ™
Share this post :

Posting Komentar

 
Copyright © 2011. Steven Martin ( Shim Ai QiWang ) - All Rights Reserved
Support : 4Shared | Media Fire | Indo Webster
Created by Steven Martin
Powered by Blogger