Re: how to activate an application not a form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




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




.



Relevant Pages

  • Re: Command that detect the calling form
    ... >Is there a command or procedure in VB6 to detect the calling form? ... >condition to know whose form call Form3 before issuing unload me in ... Parent Form, and use RaiseEvent to request data or notify the Parent ...
    (microsoft.public.vb.general.discussion)
  • MDI form help
    ... I am trying to launch a Form3 from a linked lable located on Form2. ... how to tell it that the parent is Form1. ... Dim NewMDIChild As New Form3 ...
    (microsoft.public.dotnet.languages.vb)