Fullscreen mode

G

Guest

Hi there.
Could you help me with fullscreen mode in CF2.0?

I am trying to use this code:
lHwnd = GetHwnd(Me)
SetForegroundWindow(lHwnd)
SHFullScreen(lHwnd, SHFS_HIDETASKBAR)
by adding coredll reference into my form.

But when application is swithing bettwen forms the TASKBAR is shown for a
little while anyway . :(

Exist some other method for doing this by native CF2.0/OpenNETCF2.0 code?

Thx
kp
 
P

Peter Foot [MVP]

SHFullScreen is known to behave like this. The solution is to call it from
your code when your form Activated event occurs (you may also need to call
in Deactivated too). SHFullScreen on it's own can't be relied upon to
provide a secure kiosk mode for your application, a number of system actions
from MessageBoxes and Notification bubbles can restore the taskbar and start
menu.

Peter
 
F

Fabien

Hi,

Try this when your application starts:
int h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_HIDE);

[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern int FindWindow(string lpClassName, string
lpWindowName);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern bool ShowWindow(int hwnd, int nCmdShow);

public const int SW_HIDE = 0x0000;
public const int SW_SHOW = 0x0001;

--> Normally, it hides the taskbar and you will not see it when you
swith bettwen forms.

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/
 
G

Guest

Hi,

thx for support, but it does not work on my side.
Taskbar is still shown.

I have tried paste your code into Form.Activate handler, as well as in start
program method.

:(

Cu, kp

Fabien said:
Hi,

Try this when your application starts:
int h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_HIDE);

[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern int FindWindow(string lpClassName, string
lpWindowName);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern bool ShowWindow(int hwnd, int nCmdShow);

public const int SW_HIDE = 0x0000;
public const int SW_SHOW = 0x0001;

--> Normally, it hides the taskbar and you will not see it when you
swith bettwen forms.

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/


SHFullScreen is known to behave like this. The solution is to call it from
your code when your form Activated event occurs (you may also need to call
in Deactivated too). SHFullScreen on it's own can't be relied upon to
provide a secure kiosk mode for your application, a number of system actions
from MessageBoxes and Notification bubbles can restore the taskbar and start
menu.

Peter

--
Peter Foot
Device Application Development MVPwww.peterfoot.net|www.inthehand.com










- Afficher le texte des messages précédents -
 
G

Guest

Hi Peter.
Yes, I do understand you.
I have this method in Activate event handler.
When application runs under CF1.1 it works well (Pocket PC application)
Troubbles comes after moving application on CF2.0.

I'm really desperate.

kp
 
G

Guest

Hi again.
Maybe is SHFullScreen is know to behave like this, but it does not work like
described.
So, exists any other way to handle this problem?

Thx for anything.

kp
 
Joined
Apr 11, 2007
Messages
1
Reaction score
0
I had the same issues with SHFullScreen and trying to "hide" the taskbar. To solve it, I've used the MoveWindow method to move the Taskbar outside the screen area while my application is running....I'll see if I can dig up the code, but it was basically Find the window, get the coordinates, move it outside the screen area, and then when you close your app, move the taskbar back...

To give appropriate credit, I found it on the web somewhere.

Hope it points you in a better direction...
 

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