Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Victor Nijegorodov24-Feb-16 1:29
Victor Nijegorodov24-Feb-16 1:29 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 1:35
sdancer7524-Feb-16 1:35 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Victor Nijegorodov24-Feb-16 2:07
Victor Nijegorodov24-Feb-16 2:07 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 2:20
sdancer7524-Feb-16 2:20 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 2:31
sdancer7524-Feb-16 2:31 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Victor Nijegorodov24-Feb-16 5:29
Victor Nijegorodov24-Feb-16 5:29 
AnswerRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Jochen Arndt23-Feb-16 23:05
professionalJochen Arndt23-Feb-16 23:05 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 0:55
sdancer7524-Feb-16 0:55 
Quote:
When the external update process should also update the executable of your main application, that must be terminated before the new exe file can be copyied. So there is no need to get the focus back.


I have managed this kind of problems with success so, dont bother with that.

Quote:
In another post you mentioned that you are using WaitForSingleObject to wait for the update process to be terminated. If you call that from within your main thread, your application's message loop is blocked so that paint events are not processed.

Thats correct. Windows Vista/Win7/Win8 does not have problems with paint events but XP they have. For that reason I want to disable the parent to avoid such kind of problems.

Quote:
If you don't want to update the executable itself and must wait for the external process to be finished start the process from within a worker thread where you can call WaitForSingleObject without blocking the message loop. Use a global state variable indicating that the update is executing to disallow specific tasks of your application or just show a modal dialog that is closed automatically when the update has finished.


I update the executables too, but I dont have problems with that. If you download the sample code, you will understand the focus problem i currently have.
sdancer75

GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Jochen Arndt24-Feb-16 1:42
professionalJochen Arndt24-Feb-16 1:42 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 2:15
sdancer7524-Feb-16 2:15 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Jochen Arndt24-Feb-16 2:20
professionalJochen Arndt24-Feb-16 2:20 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 2:28
sdancer7524-Feb-16 2:28 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Jochen Arndt24-Feb-16 2:38
professionalJochen Arndt24-Feb-16 2:38 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 2:43
sdancer7524-Feb-16 2:43 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Jochen Arndt24-Feb-16 2:54
professionalJochen Arndt24-Feb-16 2:54 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 6:50
sdancer7524-Feb-16 6:50 
AnswerRe: Using ShellExecute or CreateProcess caller lose its focus Pin
Victor Nijegorodov23-Feb-16 23:23
Victor Nijegorodov23-Feb-16 23:23 
GeneralRe: Using ShellExecute or CreateProcess caller lose its focus Pin
sdancer7524-Feb-16 0:49
sdancer7524-Feb-16 0:49 
QuestionQueryDosDevice() throws ERROR_ACCESS_DENIED for Windows universal apps Pin
vikramlinux22-Feb-16 6:13
vikramlinux22-Feb-16 6:13 
AnswerRe: QueryDosDevice() throws ERROR_ACCESS_DENIED for Windows universal apps Pin
Richard Andrew x6422-Feb-16 8:41
professionalRichard Andrew x6422-Feb-16 8:41 
GeneralRe: QueryDosDevice() throws ERROR_ACCESS_DENIED for Windows universal apps Pin
vikramlinux23-Feb-16 5:41
vikramlinux23-Feb-16 5:41 
GeneralRe: QueryDosDevice() throws ERROR_ACCESS_DENIED for Windows universal apps Pin
Richard Andrew x6423-Feb-16 5:51
professionalRichard Andrew x6423-Feb-16 5:51 
GeneralRe: QueryDosDevice() throws ERROR_ACCESS_DENIED for Windows universal apps Pin
vikramlinux29-Feb-16 5:10
vikramlinux29-Feb-16 5:10 
Questionhow to disable uac prompt programmatically Pin
shanmugarajaa21-Feb-16 23:33
shanmugarajaa21-Feb-16 23:33 
AnswerRe: how to disable uac prompt programmatically Pin
Richard MacCutchan21-Feb-16 23:43
mveRichard MacCutchan21-Feb-16 23:43 

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.