Click here to Skip to main content
15,798,278 members

Comments by sdancer75 (Top 9 by date)

sdancer75 12-Jan-18 8:42am View    
Hi, thank you for your solution. This questions is about 2 years old now, but i have already tested createprocess and shellexecute. Both of them methods loose their focus in some cases.

I found a justified solution for different cases using either shellexecute or createprocess. They seem to work fine with some restrictions.

I copied your code to verify if it works better than the code already implemented.
sdancer75 23-Feb-16 14:18pm View    
What ever i tried I failed. I uploaded a simple MFC/SDI file that uses CreateProcess for everyone who wants to get a look and give a solution.
sdancer75 22-Feb-16 5:53am View    
Yes I used an old article from codeproject that is used the SetForegroundWindow() but I still have problem. Now I am working with CreateProcess to check if this will work for me...

Anyway do you have any idea about the question for the parent/child window if they appear as a single app in the windows application switching ?
sdancer75 22-Feb-16 5:22am View    
Yes that's true, my mistake.... but I have already did that and it didn't work.

Anyway I have some thoughts about the parent window that calls the shellexectute.
If my app is the parent window and the shellexecute app is the child window, does the switching using the keys Alt+Tab will show both parent and child apps ? This is what happens right now but I think that it would show only the parent window correct ? Does this have any relation with the focus control?
sdancer75 17-Feb-16 12:34pm View    
Thanx for your time. I am using VS2008 for this project. Anyway I will debug this piece of code since I suspect that the crash is done inside the caller and not inside the piece of code I mentioned here.

PS:The article in your link it was mine :-)