i want use GetWindowInfo function in an app but i have a problem...here is some of my code :
and i get :
'WINDOWINFO' : undeclared identifier
'GetWindowInfo' : undeclared identifier
i included windos.h,i try to include winuser.h but doesn't work.
i look in winuser.h and the code was there...i don't understand...please help...
i use visual c++ 6 on windows xp sp1
I have found the ordering of include files are often problematic. Try putting <windows.h> as the very first and see if that helps.
i try it but it is the same...'WINDOWINFO' : undeclared identifier
I have been trying to remember how I resolved a similiar issue I had a few weeks ago. If I get inspiration I will post.
i don't think that the problem is there,because i looked in winuser.h and the function and structure is there
#define WINVER 0x0500
At the bottom of this page: WINDOWINFO Structure it states its requirements. Basically, it asks to include windows.h (you don't have to include winuser.h), and it requires Windows 98. On this page: Using the Windows Headers, it tells you what you have to define WINVER as. You'll notice it says 0x0410, which will not work. But, take heed to the warning following the table:
"Note that some features introduced in the latest version of Windows may be added to a service pack for a previous version of Windows. Therefore, to target a service pack, you may need to define _WIN32_WINNT with the value for the next major operating system release. For example, the GetDllDirectory function was introduced in Windows Server 2003 and is conditionally defined if _WIN32_WINNT is 0x0502 or greater. This function was also added to Windows XP SP1. Therefore, if you were to define _WIN32_WINNT 0x0501 to target Windows XP, you would miss features that are defined in Windows XP SP1."
Setting WINVER to 0x0500 will work fine. When in doubt, try different values, and remove includes you think you do not need, and it helps you understand what is going on.