views:

21

answers:

0

Hi, Currently I'm developing a software for HTC HD2 (WM 6.5). I don't want to allow user exit from my app unless they have authorization key to do that.

my approach is disable all hardware button which may close my foreground application. There are some solutions to disable hardware button, but none of them can disable home button.

I've tried :

  1. [DllImport("coredll.dll")]
    private static extern bool UnregisterFunc1(KeyModifiers modifiers, int keyID);
    
    
    [DllImport("coredll.dll", SetLastError = true)]
    public static extern bool RegisterHotKey(IntPtr hWnd, // handle to window
    
  2. [DllImport("coredll.dll", SetLastError = true)]
    public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
    
    
    [DllImport("aygshell.dll", SetLastError = true)]
    public static extern IntPtr SHFindMenuBar(IntPtr hwnd);
    
  3. [DllImport("coredll.dll")]
    static extern void AllKeys(bool bAllKeys);
    

None of them can disable Home button. Do you have any other different approach? Thx.