Hi,
I'm trying to find a window handle using FindWindowEx. I get an error
undecalred identifier if I use FindWindowEx() and not a member of global
namespace if I use ::FindWindowEx()... Even though FindWindow() works
perfectly well.
I have imported <windows.h> but being quite new to C++ I can't find a
solution, can anyone help me?
Jeff Partch [MVP] - 18 Mar 2005 13:31 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> I have imported <windows.h> but being quite new to C++ I can't find a
> solution, can anyone help me?
All I can think of it that it's wrapped in the preprocessor conditional...
#if(WINVER >= 0x0400)

Signature
Jeff Partch [VC++ MVP]
Simon Matthews - 18 Mar 2005 13:57 GMT
Sorry, some C++ stuff is new to me.... including preprocessor conditionals,
where can I find it and is it possible to change them to always include the
findwindowex?
> All I can think of it that it's wrapped in the preprocessor conditional...
>
> #if(WINVER >= 0x0400)
Tamas Demjen - 18 Mar 2005 18:25 GMT
You're probably running VC++ on Win95, where WINVER is lower. Just
#define WINVER 0x0400
// ^^ put this before you include windows.h
#include <windows.h>
Your program won't run of course, because your Windows is too old.
Tom
> Sorry, some C++ stuff is new to me.... including preprocessor conditionals,
> where can I find it and is it possible to change them to always include the
> findwindowex?
Severian - 21 Mar 2005 00:00 GMT
>Hi,
>
[quoted text clipped - 5 lines]
>I have imported <windows.h> but being quite new to C++ I can't find a
>solution, can anyone help me?
FindWindowEx will only run on NT4 or later and Win95 or later, so
WINVER must be defined as at least 0x0400.
Your program will not run on NT3.1 or 3.5, though that's not likely to
matter!
--
Sev