GetWindowLong/SetWindoWLong的用法

Eddy 发布于2009-11-18 16:31:42 分类: 程序设计 已浏览loading 网友评论0条 我要评论

函数原型:
        LONG GetWindowLong( 
        HWND hWnd, //指定窗体句柄
        int nIndex  //需要获取的信息类型
        );
       用该函数获取指定窗体的信息
        int nIndex值的描述:(msdn)
 GWL_EXSTYLE            
Retrieves the extended window styles.
//获取扩展的风格
 GWL_STYLE
Retrieves the window styles.
//获取windows风格
 GWL_WNDPROC
Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure.
//得到窗口回调函数的地址,或者句柄。得到后必须使用CallWindowProc函数来调用
 GWL_ID
Retrieves the window identifier.
//应用程序运行实例的句柄
 GWL_USERDATA
Retrieves the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.
//和口相关联的32位的值(每一个窗口都有一个有意留给创建窗口的应用程序是用的32位的值)
        LONG SetWindowLong( 
        HWND hWnd,
        int nIndex,
        LONG dwNewLong
        );  //具体情况请看msdn。
实例:
  ha = GetWindow(p->WndList,GW_CHILD);  //获取p->WndList窗体上的子控件句柄
  p->ha1 = (WNDPROC)GetWindowLong(ha,GWL_WNDPROC); //得到窗体的回调函数的地址,并将它赋值给p->ha1(p->ha1是一个回调函数)
  SetWindowLong(ha,GWL_WNDPROC,(LONG)SysHeaderProc); //句柄为ha的子控件相应SysHeaderProc回调函数

已经有(0)位网友发表了评论,你也评一评吧!
原创文章如转载,请注明:转载自Eddy Blog
原文地址:http://www.rrgod.com/program/118.html     欢迎订阅Eddy Blog

关于 GetWindowLong  SetWindoWLong  用法  的相关文章

记住我的信息,下次不用再输入 欢迎给Eddy Blog留言