Re: Booting right into my Application at startup
- From: "Jen C." <cohjenny@xxxxxxxxx>
- Date: 29 Mar 2007 06:09:47 -0700
You can't call shell APIs before the shell is running!
Doh!
That makes sense- :P
You really want to disable the task bar no matter what.
Our end-product will have no actual keyboard, just a touch screen, so
we are safe from Alt-Tab, and Ctl-Alt-Del. However, I will take your
advice and use the registry keys to hide it and put it underneath, and
also disable and hide it from within the app.
Thank you very much for your advice and your patience, Paul.
-Jenny C.
Windows CE Newbie
On Mar 28, 2:41 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
You really want to disable the task bar no matter what. That prevents key
combinations like Alt+Tab and Ctrl+Alt+Del from doing anything, as those are
handled, normally, by the taskbar.
You can't call shell APIs before the shell is running! That's probably why
SHFullScreen is giving you unexpected results (really, it should crash).
There's nothing, short of removing the shell from the Init keys, that will
prevent some evidence of the underlying UI from being shown, even if it's
just for a moment, other than having your window come up, taking up the
whole screen, set to be in front of everything, and then polling as fast as
you can for the shell APIs to be ready and trying to immediately call
suitable functions to hide the shell UI. You can minimize the effect of
this by setting the task bar to auto-hide, but there's no registry method to
do everything you need to do, so don't throw away the code to hide and
disable the task bar...
Paul T.
"Jen C." <cohje...@xxxxxxxxx> wrote in message
news:1175106634.387149.220550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Paul,
Thank you for your reply. When I searched more I found many
previous postings on this subject, many of which you had already
replied to. Next time I will search a little harder before posting
my question.
I'm not 'locked in' on anything - it is just the first thing I
found. And nobody suggested that I add code to my application beyond
Bruce's comment which is that I should have my app be full-screen
which it already was.
That said, I did do more searching as you recommended and did find
two other ways to approach it. One is to use the FindWindow()
function to find the TaskBar window and hide it, the other is to use
SHFullScreen().
Hiding the TaskBar:
case WM_CREATE:
hTaskBar=FindWindow(L"HHTaskBar", NULL);
if(hTaskBar)
{
EnableWindow(hTaskBar, FALSE);
ShowWindow(hTaskBar, SW_HIDE);
}
break;
This didn't work so well, because I am loading my App from the HKLM/
Init registry key before the Explorer.exe gets executed. Therefore
when I try to find the TaskBar window, it is not there so hTaskBar is
NULL. I didn't want my App to load after the shell, because I don't
want the desktop to show and have my App come up later.
So I decided to try starting a timer so I coudl detect and hide the
taskbar as soon as it showed up:
case WM_CREATE:
hTimer=SetTimer(hWnd, 1, 100, NULL);
break;
case WM_TIMER:
g_hWndTaskBar=FindWindow(_T("HHTaskBar"), NULL);
if(g_hWndTaskBar)
{
EnableWindow(g_hWndTaskBar, FALSE);
ShowWindow(g_hWndTaskBar, SW_HIDE);
KillTimer(hWnd, hTimer);
hTimer=0;
} else
{
if(nTaskBarFinds>30)
{
KillTimer(hWnd, hTimer);
}
nTaskBarFinds++;
}
break;
This worked, but my task bar does show up for a second before going
away.
SHFullScreen:
This required that add the OS Feature called aygshell to my os
image. I did that and added the following code:
case WM_CREATE:
{
RECT rc;
bool bRet;
DWORD dwError;
DWORD dwState= SHFS_HIDETASKBAR /* | SHFS_HIDESTARTICON |
SHFS_HIDESIPBUTTON */ ;
bRet=SHFullScreen(hWnd, dwState );
SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN));
MoveWindow(hWnd, rc.left, rc.top, rc.right-rc.left, rc.bottom -
rc.top, TRUE);
}
break;
Well, bRet gets set to false when SHFullScreen() fails.
GetLastError returns a zero. I am assuming that because I'm not
using a Pocket PC, that this SHFullScreen function is simply not fully
implemented on my platform.
I think maybe the registiry key method might work best for me.
Any ideas on how a crafty user could bring it up if it were just
hidden via the registry keys?
-Jenny C.
On Mar 26, 12:28 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
If there's any way for a user to access the task bar, he will. It's dead
simple to disable and hide the taskbar and that prevents just about any
access to anything other than your application. You seem to be locked-in
on
changing the registry, rather than adding the necessary code to your
application and I don't understand why. Search, as previously suggested,
to
get the bits of code that you should add to your kiosk application...
Paul T.
"Jen C." <cohje...@xxxxxxxxx> wrote in message
news:1174914487.250783.94820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Paul, you were right that the task bar is still accessible.
After searching around like you said I found another key for
project.reg that seems to work for me:
; Set the taskbar on autoHide so Windows CE shell does not show
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide]
"Default"=dword:1
; Set the taskbar so it doesn't display on the of of my app so Windows
CE shell does not show
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop]
"Default"=dword:0
It seems to work fine - the task bar is hidden and I can't bring it up
by moving the pointer to the bottom of the screen. Does this seem
like a good solution for a device which should boot into an
application and never exit, or should I take a different approach?
This way seems too easy...
-Jenny C.
On Mar 23, 11:59 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
You can still access the task bar, even though it's hidden, of course.
If
that's what you want, then you're done; if not, you'll have to do more
than
just 'minimize' it... As Bruce said, there have been, I would guess,
dozens
of posts on this topic which you can find in the archives, searchable
by
visiting groups.google.com and using advanced groups search to target
microsoft.public.windowsce.*.
Paul T.
"Jen C." <cohje...@xxxxxxxxx> wrote in message
news:1174663940.815634.45580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thank you Blake!
My app now shows up just like I wanted with no task bar.
-Jenny
On Mar 23, 10:32 am, "Blake" <blake29.ch...@xxxxxxxxx> wrote:
Hi Jen,
Try the following registry setting.
[HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\AutoHide]
0 = disabled, 1 = enabled
--
I hope it is useful ^_^
Best Regards,
Blake Chang
"Jen C." <cohje...@xxxxxxxxx> wrote in message
news:1174659492.730842.106890@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Everybody,
I have been working on getting my Windows CE application to run
at
startup. Adding Launch and Depend item to the HKLM\Init key has
made
my app run at start up like I wanted. However, the task bar and
the
Start button and everything are still showing up on the bottom.
Is
there a registry key I can use to hide that?
If I prevent the shell from starting until my app exits, then I
have
no ActiveSync :(
I don't mind the shell running as long as it doesn't show up on
the
screen.
Thanks for any help.
-Jenny C.- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
.
- Follow-Ups:
- Re: Booting right into my Application at startup
- From: Paul G. Tobey [eMVP]
- Re: Booting right into my Application at startup
- References:
- Booting right into my Application at startup
- From: Jen C.
- Re: Booting right into my Application at startup
- From: Blake
- Re: Booting right into my Application at startup
- From: Jen C.
- Re: Booting right into my Application at startup
- From: Paul G. Tobey [eMVP]
- Re: Booting right into my Application at startup
- From: Jen C.
- Re: Booting right into my Application at startup
- From: Paul G. Tobey [eMVP]
- Re: Booting right into my Application at startup
- From: Jen C.
- Re: Booting right into my Application at startup
- From: Paul G. Tobey [eMVP]
- Booting right into my Application at startup
- Prev by Date: OpenGL ES on Via Epia
- Next by Date: Re: how to enable Mainstone touch screen?
- Previous by thread: Re: Booting right into my Application at startup
- Next by thread: Re: Booting right into my Application at startup
- Index(es):