Click here to Skip to main content
15,898,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Remove Similar Lines Pin
riced11-May-09 3:06
riced11-May-09 3:06 
GeneralMessage Closed Pin
11-May-09 3:43
vijay248211-May-09 3:43 
GeneralRe: Remove Similar Lines Pin
riced11-May-09 5:32
riced11-May-09 5:32 
Questioncreate process Pin
hrishiS7-May-09 1:15
hrishiS7-May-09 1:15 
AnswerRe: create process Pin
Eddy Vluggen7-May-09 1:29
professionalEddy Vluggen7-May-09 1:29 
GeneralRe: create process Pin
hrishiS7-May-09 1:39
hrishiS7-May-09 1:39 
AnswerRe: create process Pin
Eddy Vluggen7-May-09 8:34
professionalEddy Vluggen7-May-09 8:34 
AnswerRe: create process Pin
Dave Kreskowiak7-May-09 5:09
mveDave Kreskowiak7-May-09 5: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 22:25
hrishiS7-May-09 22:25 
GeneralRe: create process Pin
Dave Kreskowiak8-May-09 1:19
mveDave Kreskowiak8-May-09 1:19 
QuestionInet Contol in visual Basic Pin
Devkranth Kishore Vanja7-May-09 0:56
Devkranth Kishore Vanja7-May-09 0:56 
AnswerRe: Inet Contol in visual Basic Pin
Dave Kreskowiak7-May-09 4:59
mveDave Kreskowiak7-May-09 4:59 
AnswerRe: Inet Contol in visual Basic Pin
riced7-May-09 6:24
riced7-May-09 6:24 
QuestionSearch files Pin
M.kohulan6-May-09 22:57
M.kohulan6-May-09 22:57 
AnswerRe: Search files Pin
Tom Deketelaere6-May-09 23:18
professionalTom Deketelaere6-May-09 23:18 
QuestionSet Folder Name as File Name Pin
vijay24826-May-09 22:44
vijay24826-May-09 22:44 
AnswerRe: Set Folder Name as File Name Pin
dan!sh 6-May-09 23:03
professional dan!sh 6-May-09 23:03 
AnswerRe: Set Folder Name as File Name Pin
riced7-May-09 1:02
riced7-May-09 1:02 
GeneralRe: Set Folder Name as File Name Pin
vijay24827-May-09 1:17
vijay24827-May-09 1:17 
GeneralRe: Set Folder Name as File Name Pin
dan!sh 7-May-09 1:42
professional dan!sh 7-May-09 1:42 
GeneralRe: Set Folder Name as File Name Pin
riced7-May-09 1:46
riced7-May-09 1:46 
GeneralRe: Set Folder Name as File Name Pin
AdamPDacco19-Jun-09 10:05
AdamPDacco19-Jun-09 10:05 
QuestionFolderBrowserDialog Pin
vijay24826-May-09 22:03
vijay24826-May-09 22:03 
AnswerRe: FolderBrowserDialog Pin
dan!sh 6-May-09 22:50
professional dan!sh 6-May-09 22:50 
QuestionHow to Open Access in Full screen Pin
FuzMic6-May-09 21:58
FuzMic6-May-09 21: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.