Click here to Skip to main content
15,850,299 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Remove Similar Lines Pin
riced11-May-09 4:06
riced11-May-09 4:06 
GeneralMessage Closed Pin
11-May-09 4:43
vijay248211-May-09 4:43 
GeneralRe: Remove Similar Lines Pin
riced11-May-09 6:32
riced11-May-09 6:32 
Questioncreate process Pin
hrishiS7-May-09 2:15
hrishiS7-May-09 2:15 
AnswerRe: create process Pin
Eddy Vluggen7-May-09 2:29
professionalEddy Vluggen7-May-09 2:29 
GeneralRe: create process Pin
hrishiS7-May-09 2:39
hrishiS7-May-09 2:39 
AnswerRe: create process Pin
Eddy Vluggen7-May-09 9:34
professionalEddy Vluggen7-May-09 9:34 
AnswerRe: create process Pin
Dave Kreskowiak7-May-09 6:09
mveDave Kreskowiak7-May-09 6:09 
You're calling WaitForExit before the process even has a chance to start. Starting a new process is a very expensive call. The Start method does not wait for the process to completely start before returning.

It's up to you to wait for the app to start, by calling p.WaitForInputIdle before you call the WaitForExit method.

himangshuS wrote:
Now if I click the button(run calc),I dont want to open a new calc,...instead I want to bring the already running calc on top.)


Then you have to check to see if it's still running (the user may have closed it), relaunch it if needed, easily done using the Process class. If it's still running, then you can get the ProcessId from its Process object, than pass that to AppActivate to bring it to the front.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: create process Pin
hrishiS7-May-09 23:25
hrishiS7-May-09 23:25 
GeneralRe: create process Pin
Dave Kreskowiak8-May-09 2:19
mveDave Kreskowiak8-May-09 2:19 
QuestionInet Contol in visual Basic Pin
Devkranth Kishore Vanja7-May-09 1:56
Devkranth Kishore Vanja7-May-09 1:56 
AnswerRe: Inet Contol in visual Basic Pin
Dave Kreskowiak7-May-09 5:59
mveDave Kreskowiak7-May-09 5:59 
AnswerRe: Inet Contol in visual Basic Pin
riced7-May-09 7:24
riced7-May-09 7:24 
QuestionSearch files Pin
M.kohulan6-May-09 23:57
M.kohulan6-May-09 23:57 
AnswerRe: Search files Pin
Tom Deketelaere7-May-09 0:18
professionalTom Deketelaere7-May-09 0:18 
QuestionSet Folder Name as File Name Pin
vijay24826-May-09 23:44
vijay24826-May-09 23:44 
AnswerRe: Set Folder Name as File Name Pin
dan!sh 7-May-09 0:03
professional dan!sh 7-May-09 0:03 
AnswerRe: Set Folder Name as File Name Pin
riced7-May-09 2:02
riced7-May-09 2:02 
GeneralRe: Set Folder Name as File Name Pin
vijay24827-May-09 2:17
vijay24827-May-09 2:17 
GeneralRe: Set Folder Name as File Name Pin
dan!sh 7-May-09 2:42
professional dan!sh 7-May-09 2:42 
GeneralRe: Set Folder Name as File Name Pin
riced7-May-09 2:46
riced7-May-09 2:46 
GeneralRe: Set Folder Name as File Name Pin
AdamPDacco19-Jun-09 11:05
AdamPDacco19-Jun-09 11:05 
QuestionFolderBrowserDialog Pin
vijay24826-May-09 23:03
vijay24826-May-09 23:03 
AnswerRe: FolderBrowserDialog Pin
dan!sh 6-May-09 23:50
professional dan!sh 6-May-09 23:50 
QuestionHow to Open Access in Full screen Pin
FuzMic6-May-09 22:58
FuzMic6-May-09 22:58 

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.