如我要创建一个总不在前的窗口,用CreateWindowEx函数实现,其中的DWORD dwExStyle参数有WS_EX_NOACTIVATE这个值,说明是:Windows 2000: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window
结果编译时就不认识WS_EX_NOACTIVATE这个值,说没定义。我看了其他值,只要是win2000才有的风格,都编译时不认识。怎么回事?望高手解决!总不在前的窗口是很有用的。

解决方案 »

  1.   

    有没有包#include <windows.h>
      

  2.   

    下载新的PlatformSDK,然后更新一下你的VC的include 路径
    然后在工程里(stdafx.h) 加入定义:
    #define _WIN32_WINNT  0x0500或者干脆在调用CreateWindowEx之前加入下面这一行就可以了
    #define WS_EX_NOACTIVATE        0x08000000L
      

  3.   

    最新的SDK在这里,基本上每季度更新
    http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
      

  4.   

    谢谢两位的关照,kingtsui(老农民)说的非常正确,不过我想请教kingtsui(老农民)“你是怎么知道#define WS_EX_NOACTIVATE 为0x08000000L的?? ”,我下次也好去查查其他的定义是什么。
      

  5.   

    他不是说Declared in Winuser.h, include Windows.h吗? 那就直接用Notepad打开Winuser.h,然后查找WS_EX_NOACTIVATE不就找到了吗?