Article ID: 150767
Article Last Modified on 7/16/2004
#include <stdio.h>
void main(void)
{
int i;
scanf("%d", &i);
printf("\nSTDIn is %d!\n", i);
}
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal _
dwAccess As Long, ByVal fInherit As Integer, ByVal hObject _
As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal _
hObject As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
hHandle As Long, ByVal dwMilliseconds As Long) As Long
Const SYNCHRONIZE = &H100000
Const NORMAL_PRIORITY_CLASS = &H20&
Const INFINITE = -1&
ProcessID& = Shell("test.bat", vbNormalFocus)
ProcessHandle& = OpenProcess(SYNCHRONIZE, True, ProcessID&)
WaitForSingleObject ProcessHandle&, -1&
CloseHandle ProcessHandle&
Keywords: kbhowto kb32bitonly KB150767