PC Review


Reply
Thread Tools Rate Thread

CreateProcess Problem

 
 
Chris Jones
Guest
Posts: n/a
 
      16th Jul 2003
Hi,
I'm using C++ Builder to write an update program for our product. I need
to be able to kick off the individual update exes for the various modules.
When I use the CreateProcess API call, the process starts, but doesn't
receive focus. This is confusing to our users.
On older versions of Windows, the focus shifts to the new process on
startup. How can I force it to work in XP?

Thanks,
Chris


 
Reply With Quote
 
 
 
 
William DePalo [MVP VC++ ]
Guest
Posts: n/a
 
      16th Jul 2003
"Chris Jones" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On older versions of Windows, the focus shifts to the new process on
> startup. How can I force it to work in XP?


You can try calling SetForegroundWindow() on a handle of a window in the
process that you want to jump to the fore. With the introduction of '98 on
9x kernels and 2000 on NT, MS changed the rules that surround taking the
focus. If the process that creates the child processes is in already the
foreground, it should have no problem moving a child into the foreground. If
it does not, Windows will likely just flash the child process' "button" in
the taskbar.

Check the docs for AllowSetForegroundWindow(), LockSetForegroundWindow()
which were added in support of the "new" foreground policy.

Regards,
Will


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: CreateProcess problem in 2003. T-rev Microsoft Windows 2000 Developer 0 10th Aug 2005 12:54 PM
Problem with CreateProcess and Menus Mustafa Rabie Microsoft Dot NET Compact Framework 1 2nd Jul 2005 04:28 PM
Problem with CreateProcess =?Utf-8?B?SGFyaSBTZWxkb24=?= Microsoft Dot NET Compact Framework 2 8th Mar 2005 03:25 PM
CreateProcess/WaitForSingleObject problem Rob Hughes Microsoft Dot NET Compact Framework 4 21st Jun 2004 03:08 PM
CreateProcess Problem Chris Jones Windows XP General 0 15th Jul 2003 08:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:45 AM.