Click here to Skip to main content
15,921,793 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Windows 2000 Problems Pin
Dave Kreskowiak31-May-04 11:32
mveDave Kreskowiak31-May-04 11:32 
GeneralNeed your help Pin
ymohd_22231-May-04 3:14
ymohd_22231-May-04 3:14 
GeneralRe: Need your help Pin
Dave Kreskowiak31-May-04 6:49
mveDave Kreskowiak31-May-04 6:49 
GeneralNetwork Pin
jithen_dt31-May-04 2:10
jithen_dt31-May-04 2:10 
GeneralRe: Network Pin
Dave Kreskowiak31-May-04 6:48
mveDave Kreskowiak31-May-04 6:48 
GeneralWorking Days in a Year Pin
alhadav31-May-04 0:30
alhadav31-May-04 0:30 
GeneralRe: Working Days in a Year Pin
Colin Angus Mackay31-May-04 1:18
Colin Angus Mackay31-May-04 1:18 
GenerallpCurrentDirectory Pin
soul.ripper30-May-04 16:12
soul.ripper30-May-04 16:12 
I can't get lpCurrentDirectory to work correct
why ?

This option is provided primarily for shells that need
to start an application and specify its initial drive and
working directory.

<br />
'Declare CreateProcess<br />
Type STARTUPINFO<br />
    cb As Long<br />
    lpReserved As String<br />
    lpDesktop As String<br />
    lpTitle As String<br />
    dwX As Long<br />
    dwY As Long<br />
    dwXSize As Long<br />
    dwYSize As Long<br />
    dwXCountChars As Long<br />
    dwYCountChars As Long<br />
    dwFillAttribute As Long<br />
    dwFlags As Long<br />
    wShowWindow As Integer<br />
    cbReserved2 As Integer<br />
    lpReserved2 As Long<br />
    hStdInput As Long<br />
    hStdOutput As Long<br />
    hStdError As Long<br />
    lpCurrentDirectory As Long<br />
End Type<br />
Type PROCESS_INFORMATION<br />
    hProcess As Long<br />
    hThread As Long<br />
    dwProcessID As Long<br />
    dwThreadID As Long<br />
End Type<br />
<br />
Global Const BELOW_NORMAL_PRIORITY_CLASS = &H4000&<br />
Global Const HIGH_PRIORITY_CLASS = &H80&<br />
Global Const IDLE_PRIORITY_CLASS = &H40&<br />
Global Const NORMAL_PRIORITY_CLASS = &H20&<br />
Global Const REALTIME_PRIORITY_CLASS = &H100&<br />
Global Const INFINITE = -1&<br />
Declare Function CloseHandle Lib "kernel32" (hObject As Long) As Boolean<br />
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long<br />
Declare Function CreateProcessA Lib "kernel32" _<br />
(ByVal lpApplicationName As Long, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long<br />


<br />
Public Function ExecuteAndWait(cmdline$)<br />
On Error GoTo Error<br />
    Dim NameOfProc As PROCESS_INFORMATION<br />
    Dim NameStart As STARTUPINFO<br />
    Dim x As Long<br />
    NameStart.cb = Len(NameStart)<br />
    x = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, HIGH_PRIORITY_CLASS, 0&, 0&, NameStart, NameOfProc)<br />
    x = WaitForSingleObject(NameOfProc.hProcess, INFINITE)<br />
    x = CloseHandle(NameOfProc.hProcess)<br />
Exit Function<br />
Error:     ' Error handling<br />
MsgBox "Run-Time Error number " & Err.Number & vbCrLf & Err.Description, vbOKOnly + vbCritical, "CreateProcess<br />
"<br />
End Function<br />


Thanks for any help

Greets jeroen Big Grin | :-D
GeneralRe: lpCurrentDirectory Pin
Dave Kreskowiak31-May-04 1:10
mveDave Kreskowiak31-May-04 1:10 
GeneralRe: lpCurrentDirectory Pin
soul.ripper31-May-04 2:27
soul.ripper31-May-04 2:27 
GeneralRe: lpCurrentDirectory Pin
Dave Kreskowiak31-May-04 6:39
mveDave Kreskowiak31-May-04 6:39 
GeneralRe: lpCurrentDirectory Pin
soul.ripper31-May-04 9:45
soul.ripper31-May-04 9:45 
GeneralRe: lpCurrentDirectory Pin
Dave Kreskowiak31-May-04 11:11
mveDave Kreskowiak31-May-04 11:11 
GeneralRe: lpCurrentDirectory Pin
soul.ripper31-May-04 11:43
soul.ripper31-May-04 11:43 
GeneralAPI Problem - Get The Icon For Another Window Pin
ColonelSanders30-May-04 15:56
ColonelSanders30-May-04 15:56 
GeneralRe: API Problem - Get The Icon For Another Window Pin
DSclub30-May-04 21:05
DSclub30-May-04 21:05 
GeneralRe: API Problem - Get The Icon For Another Window Pin
Dave Kreskowiak31-May-04 1:05
mveDave Kreskowiak31-May-04 1:05 
GeneralRe: API Problem - Get The Icon For Another Window Pin
ColonelSanders31-May-04 8:38
ColonelSanders31-May-04 8:38 
GeneralRe: API Problem - Get The Icon For Another Window Pin
Dave Kreskowiak31-May-04 11:18
mveDave Kreskowiak31-May-04 11:18 
GeneralrtlMoveMemory Dll Call Problem In .NET Pin
Pugman81230-May-04 11:55
Pugman81230-May-04 11:55 
GeneralRe: rtlMoveMemory Dll Call Problem In .NET Pin
Dave Kreskowiak31-May-04 1:03
mveDave Kreskowiak31-May-04 1:03 
QuestionHow can I disable CANCEL box in System.Window.form? Pin
ATC30-May-04 5:43
ATC30-May-04 5:43 
AnswerRe: How can I disable CANCEL box in System.Window.form? Pin
Syed Abdul Khader30-May-04 18:59
Syed Abdul Khader30-May-04 18:59 
GeneralRe: How can I disable CANCEL box in System.Window.form? Pin
ATC31-May-04 8:13
ATC31-May-04 8:13 
Generalanswer can or cannot Pin
GaryKoh29-May-04 16:12
GaryKoh29-May-04 16:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.