CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2013
    Posts
    2

    Keyboard & mouse hook example program (for VS Express 2012)?

    I was using an old example system wide keyboard and mouse hook written by Paul DiLascia. It works in Windows XP in Visual Studio NET 2003. But now I need an example system wide keyboard and mouse hook for Visual Studio Express 2012 in Windows 8. I'm familiar with C++, but I could learn C# or Visual Basic. I can do the programming syntax and logic, but I have trouble with the Windows interface code. I would like to again use an example hook and replace the guts with my own code.

    Thanks.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Keyboard & mouse hook example program (for VS Express 2012)?

    So doesn't the code of Paul DiLascia work in Visual Studio Express 2012 in Windows 8?
    Victor Nijegorodov

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: Keyboard & mouse hook example program (for VS Express 2012)?

    If the example doesn't compile for Visual Studio Express 2012, what compile errors are you getting?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  4. #4
    Join Date
    Sep 2013
    Posts
    2

    Re: Keyboard & mouse hook example program (for VS Express 2012)?

    I made some progress and then ran into this

    error C1083: Cannot open include file: 'afxwin.h'

    Apparently Visual Studio Express does not include MFC.

    I might try using "virtual box" or whatever it's called to run Windows XP and my Visual Studio NET 2003. That will probably be quicker than restoring Windows XP when I need to adjust my macro recorder code. I do almost no programming. Once in a great while, I use the same macro recorder, changing the recorder output text to whatever scripting language I'm using at the time. Few and far between programming tasks. Buying a professional version of C++ in order to get MFC working in Windows 8 isn't going to happen here.

    Thanks to the replies.

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Keyboard & mouse hook example program (for VS Express 2012)?

    Quote Originally Posted by zolds View Post
    I made some progress and then ran into this

    error C1083: Cannot open include file: 'afxwin.h'

    Apparently Visual Studio Express does not include MFC.
    Which MFC classes do you use?
    What happens if you comment out this #include?
    Victor Nijegorodov

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Keyboard & mouse hook example program (for VS Express 2012)?

    Quote Originally Posted by zolds View Post
    I was using an old example system wide keyboard and mouse hook written by Paul DiLascia. It works in Windows XP in Visual Studio NET 2003. But now I need an example system wide keyboard and mouse hook for Visual Studio Express 2012 in Windows 8.
    I don't see why you cannot use VS NET 2003 in Win8.

    Quote Originally Posted by zolds View Post
    Buying a professional version of C++ in order to get MFC working in Windows 8 isn't going to happen here.
    Pure Win32 API mouse hook sample: mouhook_dll_with_shared_section_win32_api_only.zip (proved to work in Win 7)
    Best regards,
    Igor

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