Hello, all


M

McFar

In my pocket pc application (i write it on .NET CF) i show a dialog using
ShowDialog method, when user closes the dialog box my application become not
active and to activate it I sould go to Settings->memory->running
programs -> activat

What the matter? If I do something wrong?
Please help me my pocket pc have a lot of such forms and it is not usable
when after any form closed my application become not active...
 
Ad

Advertisements

M

McFar

and sorry I do not want to use any PInvoke calls like in opennetcf
SetForegroundWindow(hwnd)
 
M

McFar

Well...
I am developing a pure .NET CF application and do not want to write it being
platform depended...
and using this function fill require that the plantform my application
started on has coredll.dll module and SetForegroundWindow function.
another reason is that when I use the code
Caprure = true
GetCapture
Capture - false
SetForegroundWindow
it helps to activate and show my application window, but the screen still
flicks
(the desktop window or a window of some other active application is shown
before activating of my application window)
I do not know why it always happens, I know there is a BringToFron function
but it seems does nothing


Peter Foot said:
Why don't you want to use any P/Invoke? You don't need to use the whole of
the OpenNETCF code just for this function, just define the P/Invokes you
need:-
http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=a4bca0e4-439b-411a-87cd-0950e9d16b10

[DllImport("coredll")]
private static extern IntPtr GetCapture();

[DllImport("coredll")]
private static extern bool SetForegroundWindow(IntPtr hwnd);

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://blog.opennetcf.org/pfoot/

McFar said:
and sorry I do not want to use any PInvoke calls like in opennetcf
SetForegroundWindow(hwnd)

become
not
 
Ad

Advertisements

P

Peter Foot [MVP]

Every WindowsCE system has coredll, and any Windows CE system which supports
Windows Forms will support GetCapture and SetForegroundWindow. The problem
with BringToFront is it doesn't work when your application goes behind a
window owned by another process. This code will work on any CE version which
supports .NETCF, if you want your code to work on the desktop too, then wrap
your calls to these P/Invoke functions with:-

if(System.Environment.OSVersion.Platform==PlatformID.WinCE)
{
}

Then they won't be called on the desktop.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://blog.opennetcf.org/pfoot/

McFar said:
Well...
I am developing a pure .NET CF application and do not want to write it
being
platform depended...
and using this function fill require that the plantform my application
started on has coredll.dll module and SetForegroundWindow function.
another reason is that when I use the code
Caprure = true
GetCapture
Capture - false
SetForegroundWindow
it helps to activate and show my application window, but the screen still
flicks
(the desktop window or a window of some other active application is shown
before activating of my application window)
I do not know why it always happens, I know there is a BringToFron
function
but it seems does nothing


Peter Foot said:
Why don't you want to use any P/Invoke? You don't need to use the whole
of
the OpenNETCF code just for this function, just define the P/Invokes you
need:-
http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=a4bca0e4-439b-411a-87cd-0950e9d16b10

[DllImport("coredll")]
private static extern IntPtr GetCapture();

[DllImport("coredll")]
private static extern bool SetForegroundWindow(IntPtr hwnd);

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://blog.opennetcf.org/pfoot/

McFar said:
and sorry I do not want to use any PInvoke calls like in opennetcf
SetForegroundWindow(hwnd)

In my pocket pc application (i write it on .NET CF) i show a dialog using
ShowDialog method, when user closes the dialog box my application become
not
active and to activate it I sould go to Settings->memory->running
programs -> activat

What the matter? If I do something wrong?
Please help me my pocket pc have a lot of such forms and it is not usable
when after any form closed my application become not active...
 

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