Link to home
Start Free TrialLog in
Avatar of wimpos
wimpos

asked on

Triggering hotkey's with a minimized form

Hello

I'm writing an application for a PDA;

    * OS: Microsoft Windows Mobile 5.0
    * lang: C# .Net 2.0
    * IDE: Microsoft Visual Studio 2005

I wanted to override the green "call" button of the PDA. So the cprog.exe (default phone application does not launches. This succeeded using this code:


long res = SendMessage(SHFindMenuBar(this.Handle), SHCMBM_OVERRIDEKEY, VK_TTALK,
                (SHMBOF_NODEFAULT | SHMBOF_NOTIFY) | (SHMBOF_NODEFAULT | SHMBOF_NOTIFY) << 16);


and

...
 if (m.Msg == WM_HOTKEY)
                {
                    int key = m.LParam.ToInt32() >> 16;
                    switch(key)
                    {
                        case VK_TTALK:
                            MessageBox.Show("CLICK");
                            break;
                    }
                }
...

But once my application is minimized (thus still running on the background), the function of the "call" button hotkey is no longer triggerd and overridden by my application...

Is there a solution for this problem?

Kind regards and thanks for your effort


Wimpos
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wimpos
wimpos

ASKER

@Mika: yes it is

But I already found the solution.
In addition with the Keyoverride I have to add a WindowHook.

http://blog.opennetcf.org/ayakhnin/PermaLink,guid,84b95802-76d7-499c-b266-e2251ab15706.aspx

Thanks for your time