15,798,278 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
http://www.filedropper.com/shellexecutecreateprocesstestapp
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 :-)
sdancer75
17-Feb-16 12:29pm
View
Using the code : HWND hfocus = ::GetFocus();EnableWindow(FALSE);WaitForSingleObject( lpExecInfo.hProcess, INFINITE );::SetFocus(hfocus);EnableWindow(TRUE); did not seem to work. Any other ideas ?
sdancer75
16-Feb-16 5:45am
View
m_pPISourceFilter is the pointer result of a previous QueryInterface in a previous step that I have not shown here. In case of problem then the previous if (FAILED(hr)) should have catch this right ? In this case should never come to this step.
sdancer75
15-Feb-16 10:52am
View
I used an old COM build in the user's machine instead of that I used in my development machine. As I said above I suspect that the snippet works fine and it returns false as it should be, and somewhere inside the caller it crashes.
Yes I will debug the code. Thanks....
sdancer75
15-Feb-16 10:49am
View
Νο m_pPISourceFilter is not valid (old COM build), but the question is why it crashes while it should return to caller. I run this only in release mode to user's machine. I suspect that it crashes somewhere inside the caller...
Show More