From: Tony Selke on
We are using C# with the CF v2.0 on WM 5.0. We have a requirement to trap
hardware buttons to prevent the associated actions while a particular
application has the focus. My team has had had no trouble doing this with
the HardwareButton & HardwareKeys entities for "normal" buttons, however this
process does not seem to work with the "Windows" button that (typically)
brings up the "Start Menu" pop-up. We even tried a WindowSink:MessageWindow
with a WndProc(Message) handler, but that doesn't get called by the button
either. None of us has been successful in finding an answer. Is there
something that will work?
From: dule on
Hi,
I have encountered the simillar problem on the Recon device and this is how
I have solved it:

typedef BOOL (__stdcall *UnregisterFunc1Proc)( UINT, UINT );


void DisableWinKey (HWND hWnd)
{
HINSTANCE hCoreDll;
UnregisterFunc1Proc procUndergisterFunc;
hCoreDll = LoadLibrary(_T("coredll.dll"));
ASSERT(hCoreDll);

procUndergisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll,
_T("UnregisterFunc1"));

ASSERT(procUndergisterFunc);

int i=0x5b;
procUndergisterFunc(MOD_WIN, i);
RegisterHotKey(hWnd, i, MOD_WIN, i);


FreeLibrary(hCoreDll);

}

Just call this function at the start of your program. The value of variable
'i' I have found with Remote Spy by watching the messages that are sent when
theWin key is pressed. Maybe that value is different on your device.

Hope this helps,
Dusko




"Tony Selke" <TonySelke(a)discussions.microsoft.com> wrote in message
news:C6FD4C10-3185-4F4D-88E7-5FA94869D25A(a)microsoft.com...
> We are using C# with the CF v2.0 on WM 5.0. We have a requirement to trap
> hardware buttons to prevent the associated actions while a particular
> application has the focus. My team has had had no trouble doing this with
> the HardwareButton & HardwareKeys entities for "normal" buttons, however
> this
> process does not seem to work with the "Windows" button that (typically)
> brings up the "Start Menu" pop-up. We even tried a
> WindowSink:MessageWindow
> with a WndProc(Message) handler, but that doesn't get called by the button
> either. None of us has been successful in finding an answer. Is there
> something that will work?


From: Tony Selke on
Thank you for your reply. This does work in WM2003, however in WM5, it does
not capture the "Windows" button (which activates the Start menu). The C#
code that we used to validate this came from Microsoft's Input class in this
example:

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/PInvokeLib.asp

In fact, this class captures all hardware buttons on the WM2003 emulator,
but the ONLY button it captures in the WM5.0 emulator is the calendar button.
The other buttons don't even get passed to the MessageWindow.WndProc()
function. All of the other buttons can be captured using the built-in CF2
classes, but the "Windows" button that opens the pop-up Start menu still
eludes us.

Tony

"dule" wrote:

> Hi,
> I have encountered the simillar problem on the Recon device and this is how
> I have solved it:
>
> typedef BOOL (__stdcall *UnregisterFunc1Proc)( UINT, UINT );
>
>
> void DisableWinKey (HWND hWnd)
> {
> HINSTANCE hCoreDll;
> UnregisterFunc1Proc procUndergisterFunc;
> hCoreDll = LoadLibrary(_T("coredll.dll"));
> ASSERT(hCoreDll);
>
> procUndergisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll,
> _T("UnregisterFunc1"));
>
> ASSERT(procUndergisterFunc);
>
> int i=0x5b;
> procUndergisterFunc(MOD_WIN, i);
> RegisterHotKey(hWnd, i, MOD_WIN, i);
>
>
> FreeLibrary(hCoreDll);
>
> }
>
> Just call this function at the start of your program. The value of variable
> 'i' I have found with Remote Spy by watching the messages that are sent when
> theWin key is pressed. Maybe that value is different on your device.
>
> Hope this helps,
> Dusko
>
>
>
>
> "Tony Selke" <TonySelke(a)discussions.microsoft.com> wrote in message
> news:C6FD4C10-3185-4F4D-88E7-5FA94869D25A(a)microsoft.com...
> > We are using C# with the CF v2.0 on WM 5.0. We have a requirement to trap
> > hardware buttons to prevent the associated actions while a particular
> > application has the focus. My team has had had no trouble doing this with
> > the HardwareButton & HardwareKeys entities for "normal" buttons, however
> > this
> > process does not seem to work with the "Windows" button that (typically)
> > brings up the "Start Menu" pop-up. We even tried a
> > WindowSink:MessageWindow
> > with a WndProc(Message) handler, but that doesn't get called by the button
> > either. None of us has been successful in finding an answer. Is there
> > something that will work?
>
>
>
From: Tony Selke on
Perhaps we are asking the wrong question. We have found a good deal of code
all over that shows how you would do this in WM2003 and we have seen it work
in WM2003, but not in WM5.0. Unless the API has changed significantly, we
have to presume that the key code values for the hardware buttons are not the
same in the WM5.0 emulator as they are in the WM2003 emulator.

Can anyone help us figure out how to capture/view the key codes? We tried
hooking up Spy++ Remote, but while we can see the window list, we can't get
it to show any messages. Are we on the right track?

Tony

"Tony Selke" wrote:

> We are using C# with the CF v2.0 on WM 5.0. We have a requirement to trap
> hardware buttons to prevent the associated actions while a particular
> application has the focus. My team has had had no trouble doing this with
> the HardwareButton & HardwareKeys entities for "normal" buttons, however this
> process does not seem to work with the "Windows" button that (typically)
> brings up the "Start Menu" pop-up. We even tried a WindowSink:MessageWindow
> with a WndProc(Message) handler, but that doesn't get called by the button
> either. None of us has been successful in finding an answer. Is there
> something that will work?
From: Fabien on
Hi,

You can make a breakpoint in your WndProc function and watch the
message in parameters when you click on a hardware button... if the
keys are different you can strore your hardwarekey mapping in registry.

BR


Fabien Decret
Windows Embedded Consultant

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




Tony Selke a écrit :

> Perhaps we are asking the wrong question. We have found a good deal of code
> all over that shows how you would do this in WM2003 and we have seen it work
> in WM2003, but not in WM5.0. Unless the API has changed significantly, we
> have to presume that the key code values for the hardware buttons are not the
> same in the WM5.0 emulator as they are in the WM2003 emulator.
>
> Can anyone help us figure out how to capture/view the key codes? We tried
> hooking up Spy++ Remote, but while we can see the window list, we can't get
> it to show any messages. Are we on the right track?
>
> Tony
>
> "Tony Selke" wrote:
>
> > We are using C# with the CF v2.0 on WM 5.0. We have a requirement to trap
> > hardware buttons to prevent the associated actions while a particular
> > application has the focus. My team has had had no trouble doing this with
> > the HardwareButton & HardwareKeys entities for "normal" buttons, however this
> > process does not seem to work with the "Windows" button that (typically)
> > brings up the "Start Menu" pop-up. We even tried a WindowSink:MessageWindow
> > with a WndProc(Message) handler, but that doesn't get called by the button
> > either. None of us has been successful in finding an answer. Is there
> > something that will work?

 |  Next  |  Last
Pages: 1 2
Prev: Asus A636 connector
Next: citrix for PPC WM5.0