Problems with SendInput. It's not working?

Hi guys,

To use SendInput I need to use the INPUT structure. When I use the INPUT structure then compiler complains that INPUT is unknown.

INPUT is also not displayed in the drop down Intellisense list box on pressing ctrl+spacebar.

Can somebody help.

keyb_event works fine.

But why INPUT is not being identified.

It happened on VS6. OS - Win2000.

But the INPUT structure is working in WindowsXP!

[417 byte] By [NibuThomas] at [2008-2-5]
# 1
What is your compiler warning/error? Show a piece of code!

Is there a chance that INPUT is defined to something else.
If you have a #define INPUT ANYTHING you can't use INPUT.

Are you sure you are using the correct SDK?
If so, is the correct WINVER set?

MartinRichter at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 2

The INPUT structure is not even listed in the INTELLISENSE listbox.

On compilation it gives an error saying INPUT is unknown. Nothing else.

The same code works perfectly in XP.

I am in my office now. I don't have the error code now. But this is what it says exactly.

I opened up the winuser.h in which it is defined. It is there. So I don't think that will be a problem.

Thanks martin once again.

NibuThomas at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 3
So INPUT is not seen by the compiler!
INPUT is guarded by a

#if (_WIN32_WINNT > 0x0400)

MartinRichter at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 4

But it is Windows 2000. It should be working.

NibuThomas at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 5

You don't understand! This is a compile guard. You have to define it to enable specific features for the OS. It has nothing to do with the OS were your program is running.

Read this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/using_the_windows_headers.asp

MartinRichter at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 6
Will this problem be solved if I define the correct version of the OS._WIN32_WINNT>=0x0500
NibuThomas at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 7
Any #define of _WIN32_WINNT than described above will work.
But its only a suggestion.
MartinRichter at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...
# 8
Thanks Martin.Big Smile
NibuThomas at 2007-9-8 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...

Software Development for Windows Vista

Site Classified