程序代码: |
'*************************************************************************
'**模 块 名:modMain
'**说 明:杨兴宇 版权所有2010 - 2011(C)
'**创 建 人:杨兴宇
'**日 期:2010-1-14 16:27:50
'**修 改 人:
'**日 期:
'**描 述:不要迷恋哥,哥只是个传说
'**版 本:V1.0.0
'*************************************************************************
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredaccess&, ByVal bInherithandle&, ByVal dwProcessid&) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpexitcode As Long) As Long
Private Const STILL_ACTIVE = &H103
Private Const PROCESS_QUERY_INFORMATION = &H400
Sub Main()
Open App.Path & "/Capture.RC" For Output As #1
Print #1, vbNullString;
Close #1
Open App.Path & "/Capture.RC" For Append As #1
Print #1, 100 & Space(2) & "CUSTOM" & Space(2) & App.Path & "/USImage.mdb"
Close #1
ShellSomePE App.Path & "/RC.EXE /r Capture.RC"
Kill App.Path & "/Capture.RC"
MsgBox "完成"
End Sub
Public Sub ShellSomePE(ByVal lpCommandLine As String)
Dim hShell As Long
Dim hProc As Long
Dim lExit As Long
hShell = Shell(lpCommandLine, vbHide)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, False, hShell)
Do
GetExitCodeProcess hProc, lExit
DoEvents
Loop While lExit = STILL_ACTIVE
End Sub
文章出自:http://blog.csdn.net/yangxingyu/article/details/6089405
★VB部分相关文章推荐:★