Application's form collection

N

nazneen84

Hi,

On a certain event, I need my application to behave in a certain way
if it is in the foreground (any of its windows) and differently if it
is isn't.

the target platform is Windows Mobile 5.0 Smartphone SDK.

hence i can't get my application's form collection using openforms and
compare the foreground window's handle. (In order to check if the
application is in the foreground)

how do I get my application's form collection for this target
platform?
Is there another way of checking if the running application is in the
foreground?

Thanks & Regards
Nazneen
 
N

Neil Cowburn

how do I get my application's form collection for this target
platform?

You have to manage the form collection yourself since OpenForms is not
supported under the .NET Compact Framework.
Is there another way of checking if the running application is in the
foreground?

P/Invoke GetForegroundWindow and compare the resulting HWND (IntPtr) to
the Handle of your app's current form.
 
N

nazneen84

P/Invoke GetForegroundWindow and compare the resulting HWND (IntPtr)
to
the Handle of your app's current form.

My application's current form is variable. How do I get the form in my
application highest in z-order?
 
N

Neil Cowburn

P/Invoke GetForegroundWindow and compare the resulting HWND (IntPtr)
to
the Handle of your app's current form.

My application's current form is variable. How do I get the form in my
application highest in z-order?

Why not just expose a CurrentForm property from the form collection
manager that you wil need to create?
 
B

brambilla

Why not just expose a CurrentForm property from the form collection
manager that you wil need to create?


Hi
excuse my intrusion in this post. How can i expose a CurrentForm
property ?
I use windows CE embedded 6.0 R2 and i develop in VB.NET 2005. My
device is an x86. I write:

Dim Frms As New Collection
Frms.Add(Namespace.frmNavBar, "1")
Frms.Add(Namespace.frmMainMenu, "2")
......
......
but then ?!??

Thanks
Ale
 
N

Neil Cowburn

How can i expose a CurrentForm
property ?
I use windows CE embedded 6.0 R2 and i develop in VB.NET 2005. My
device is an x86. I write:

Dim Frms As New Collection
Frms.Add(Namespace.frmNavBar, "1")
Frms.Add(Namespace.frmMainMenu, "2")

You need to derive a class from Collection and then add the property yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top