Omdat ik het maar zelf moest doen heb ik dat gedaan.
Ik heb een .bas file aangemaakt zoals beschreven stond in de tut, en ook een .bat file (c:\test.bat)
Dit is de code van het form dat ik gebruik, de teller doet het, het dos venster ook, maar dan laad ie da batch file niet
Ik heb een .bas file aangemaakt zoals beschreven stond in de tut, en ook een .bat file (c:\test.bat)
Dit is de code van het form dat ik gebruik, de teller doet het, het dos venster ook, maar dan laad ie da batch file niet
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| Private Sub Command1_Click()
Label1.Caption = "Running: "
Start = Timer ' Set start time.
Do While Label1.Caption = "Running: "
DoEvents ' Yield to other processes.
Label2.Caption = FormatDateTime(Now, vbLongTime)
Loop
End Sub
Private Sub Form_Load()
If AllocConsole() Then
hConsole = GetStdHandle(STD_OUTPUT_HANDLE)
If hConsole = 0 Then MsgBox "Couldn't allocate STDOUT"
Else
MsgBox "Couldn't allocate console"
End If
If Label2.Caption = "16:57:00" Then
Dim Result As Long, sOut As String, cWritten As Long
sOut = "Hi There" & vbCrLf
Result = WriteConsole(hConsole, ByVal sOut, Len(sOut), cWritten, _
ByVal 0&)
Shell "C:\TEST.BAT"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
CloseHandle hConsole
FreeConsole
End Sub |