CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2001
    Location
    Delhi-India
    Posts
    112

    SendInput() function 'INPUT' : undeclared identifier

    I want to use SendInput function to simulate mouse event ..
    but if i declare object of INPUT structure , compiler prompts me with the error
    'INPUT' : undeclared identifier

    I have also included 'WinUser.h' and 'Windows.h' i have also included User32.lib in the project settings -link tab.

    I m stuck ! can some Guru help me out !
    Thanks in advance ... needless to say gurus are always rated .

    Abhishek Narula
    (Member Technical Staff)
    Syndew.Com Pvt. Ltd.

  2. #2
    Join Date
    Feb 2001
    Location
    Sydney, Australia
    Posts
    1,909

    Re: SendInput() function 'INPUT' : undeclared identifier

    put this line into stdafx.h before any includes

    #define _WIN32_WINNT 0x0500


    Please - rate answer if it helped you
    It gives me inspiration when I see myself in the top list =)

    Best regards,

    -----------
    Igor Soukhov (Brainbench/Tekmetrics ID:50759)
    igor@soukhov.com | ICQ:57404554 | http://soukhov.com

    Member of Russian Software Developer Network http://rsdn.ru
    Best regards,
    Igor Sukhov

    www.sukhov.net

  3. #3
    Join Date
    Jul 2001
    Location
    Delhi-India
    Posts
    112

    Hats off to you boss

    Thanks a zillion boss !
    i would also appreciate if you can throw little more light on this
    '#define _WIN32_WINNT 0x0500' thing. Although the thing has started moving ..but what is the reason behind that. why is this include required , how do find it out , where all do we require these kind of includes !

    Thanks a lot!
    Regards,

    Abhishek Narula
    (Member Technical Staff)
    Syndew.Com Pvt. Ltd.

  4. #4
    Join Date
    Feb 2002
    Posts
    1

    Re: SendInput() function 'INPUT' : undeclared identifier

    Igor, thanks so much. I was struggling with this problem for a very long time, and had absolutely no idea what was wrong until I saw your post. Now everything compiles perfectly

    Ulysses


  5. #5
    Join Date
    May 2017
    Posts
    12

    Re: SendInput() function 'INPUT' : undeclared identifier

    This is a non-issue with new compilers like VS2015 where SendInput() readily compiles but for VC6, the #include didn't work. I had to add the flag /D _WIN32_WINNT=0x401 to project settings at C/C++ tab > Catagory General (combo box) and down on that page to "Project Options". I added this /D _WIN32_WINNT=0x401 right after UNIICODE flag.

    Note /d is just telling the compiler it is followed by the flag and _WIN32_WINNT=0x401 is the actual flag.

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

    Re: SendInput() function 'INPUT' : undeclared identifier

    Quote Originally Posted by caezar View Post
    This is a non-issue with new compilers like VS2015 where SendInput() readily compiles but for VC6, the #include didn't work. I had to add the flag /D _WIN32_WINNT=0x401 to project settings at C/C++ tab > Catagory General (combo box) and down on that page to "Project Options". I added this /D _WIN32_WINNT=0x401 right after UNIICODE flag.

    Note /d is just telling the compiler it is followed by the flag and _WIN32_WINNT=0x401 is the actual flag.
    And what and whom did you want to explain with your post in this more than 15 years old thread?
    Victor Nijegorodov

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