CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    41

    Enabling shortcut keys when program does not have focus

    Hi

    Does anyone know of a way of defining shortcut keys which will work even if the program does not have focus?

    I am trying to write a C++ program which takes a screen capture of another program. When I press a button I want my C++ program to take a screen capture even though the program I am capturing has the focus.

    Cheers

    Robbie

  2. #2
    Join Date
    Oct 2005
    Location
    Bangalore
    Posts
    1,051

    Re: Enabling shortcut keys when program does not have focus

    - Sreehari
    "Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
    " Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin

  3. #3
    Join Date
    Apr 2005
    Posts
    41

    Re: Enabling shortcut keys when program does not have focus

    Thanks

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Enabling shortcut keys when program does not have focus

    No need for any type of hooking to do this.
    Just use RegisterHotKey.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured