Re: how to activate an application not a form
- From: "Hari" <hadusumalli@xxxxxxxxxxxxxxx>
- Date: 14 Feb 2007 05:30:08 -0800
Hi Chris,
Thanks a lot! I'm complete illiterate of 'Control panel applet' and
'Spy++'. Can you please give me links to sample app that uses these
tools that could solve my prob.
- Hari
On Feb 14, 6:10 pm, "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote:
CPL = control panel applet. THat's what the "running processes" applet is.
Spy++ is a remote tool.
--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded Worldwww.opennetcf.com
--
"Hari" <hadusuma...@xxxxxxxxxxxxxxx> wrote in message
news:1171429765.712181.215050@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks Chris and David
Hi Chris,
Then you need to do what the CPL does, which is likely sending a
WM_ACTIVATE
message to the Window. Spy++ would tell you for sure.
I did'nt follow even a bit of your suggestion. May be i should be
aware of something which i'm not. What is CPL? Can you please expand
on this??
Hi David,
Thanks a lot for the suggestion
When your form closes (i.e., upon return from ShowDialog) your next form
is
NOT the foreground window (the 'today' screen is, and it gets displayed).
I did'nt use showDialog(), because the child form has to be
minimized or hidden, not closed.
To be more clear,
form1, form2 - minimize Box - False
form3 - minimize Box - true
form1 creates and shows( calls show()) on form2 instance. Form2
creates and shows( calls show()) on Form3 instance.
So when i hit the "Cross" at the top right corner of form3, it
minimizes and its previous form, i.e. form2 is shown.
To fix this, I added code to have each of my forms keep track of its
"parent" form, and added the following code after each call to
ShowDialog:
if (Win32.GetForegroundWindow() != parent.Handle)
{
IParentForm topForm = parent;
while (topForm.ParentForm != null)
topForm = topForm.ParentForm;
Win32.SetForegroundWindow((IntPtr)(((uint)topForm.Handle) |
0x00000001));
}
So i don't think i can use this code for my case. Can i? any
suggestions??
Thanks,
Hari
.
- Follow-Ups:
- Re: how to activate an application not a form
- From: Paul G. Tobey [eMVP]
- Re: how to activate an application not a form
- References:
- how to activate an application not a form
- From: Hari
- RE: how to activate an application not a form
- From: David
- Re: how to activate an application not a form
- From: Hari
- Re: how to activate an application not a form
- From: <ctacke/>
- how to activate an application not a form
- Prev by Date: Re: FTP FtpFindFile
- Next by Date: HttpWebRequest Accept-Encoding: gzip Header
- Previous by thread: Re: how to activate an application not a form
- Next by thread: Re: how to activate an application not a form
- Index(es):
Relevant Pages
|