Need help, cant seem to declare a var of type WINDOWINFO - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need help, cant seem to declare a var of type WINDOWINFO

FlackFlack Posts: 88Member
Hello,

In my app I try to do the following:
[code]
WINDOWINFO pw;
pw.cbSize = sizeof(pw);
GetWindowInfo(hWnd, &pw);
[/code]
However, I get the error "error C2065: 'WINDOWINFO' : undeclared identifier". I dont understand why. I can successfully declare a var of type WINDOWPLACEMENT and the WINDOWINFO and WINDOWPLACEMENT structures are both defined in the same file.

Anyone have any suggestions?

Thanx,
-Flack

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : Hello,
    :
    : In my app I try to do the following:
    : [code]
    : WINDOWINFO pw;
    : pw.cbSize = sizeof(pw);
    : GetWindowInfo(hWnd, &pw);
    : [/code]
    : However, I get the error "error C2065: 'WINDOWINFO' : undeclared identifier". I dont understand why. I can successfully declare a var of type WINDOWPLACEMENT and the WINDOWINFO and WINDOWPLACEMENT structures are both defined in the same file.
    :
    : Anyone have any suggestions?
    :
    : Thanx,
    : -Flack
    :
    [blue]From MSDN:
    ---
    Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.
    Windows 95/98/Me: Included in Windows 98 and later.
    Header: Declared in Winuser.h; include Windows.h.
    ---

    The WINDOWS.H is bloated with the use of _WIN32_WINNT and WINVER defines. This structure definition (no doubt) is surrounded with some of these defines or even both of them.

    You should, probably, set them in the compiler command line manually. If it does not help, just copy the structure out of WINUSER.H or out of a file where it is located and paste it into your program. You can also rename it if you want to.
    [/blue]
Sign In or Register to comment.