Thread: Windows Key Unstopable?!

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    265

    Windows Key Unstopable?!

    Ok, I hate the windows key with a vengence, and so do just about all the little llama gamers i know. Always bumping the stupid key in a game, etc. So i tried to use my working perfectly keyhooking app to stop that key, Normally to pass on a keypress i would return
    Code:
    return( CallNextHookEx(hhookHooks[KEYBOARDINDEX], nCode, wParam, lParam));
    however to stop a key from being pressed i simply return 1, and everything is ok. This approach works with every keypress i have tried, except for the windows and right-click keys. How can i interupt these keys? How can i end their reign of tyranny?! Thanks for your time.

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    You can check out:

    http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/

    Scroll down to just below Figure 7, there is source (Fig. 8) for a program that does this, among other things.

    You will need to implement the callback within a DLL, to do a systemwide hook like this -- perhaps that is your problem.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    265
    Yes, thanks for the fast reply, I already searched the board and found a thread about disabling ctrl alt del which used the code:
    Code:
    HWND hwnd = FindWindow("Shell_traywnd", NULL);
    EnableWindow(hwnd, FALSE); // disable it
    All that managed to do is hang the taskbar. It doesnt stop the windows key at all (im on 2k btw)

    My huge global keyhooking app works for every single key, and it does see the keypresses for the windows key. I perform actions when the key is pressed, however windows still sees it first. This is driving me nuts! lol

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    It's really quite easy, actually.

    Here's what you need:

    1) A screwdriver
    2) Pair of needle-nose pliers

    No programming required!
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #5
    Registered User
    Join Date
    Feb 2003
    Posts
    265
    If it werent 4am, i would have a witty reply to that. Ill edit my reply later to add it. Until then, just imagine a witty reply. Be afraid. Be very afraid.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows regedit Osen Kusnadi key
    By Niara in forum Tech Board
    Replies: 4
    Last Post: 01-15-2008, 06:24 AM
  2. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  5. Lil Anti Windows Humor
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 10-02-2002, 12:01 PM