posts - 17,  comments - 226,  trackbacks - 1
<2009年10月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

留言簿(0)

随笔档案

文章档案

搜索

最新评论

  • 1. sfwwbnwi
  • --sfwwbnwi
  • 2. re: 2D游戏碰撞检测之我见
  • 有想法是不错,可惜有错误。如果子弹速度很快,在2帧之间距离大,直接跳过了阻挡体,怎么办?
  • --cc
  • 3. clopidogrel
  • Human beings have an inalienable right to invent themselves.
  • --clopidogrel
  • 4. lipitor nargol liege
  • Patriotism is your conviction that this country is superior to all other countries because you were born in it.
  • --lipitor nargol liege
  • 5. calan
  • Never eat more than you can lift.
  • --calan
  • 6. diamox
  • The most beautiful adventures are not those we go to seek.
  • --diamox
  • 7. xanax side effects
  • Keep cool and you command everybody.
  • --xanax side effects
  • 8. vjgqqmqm
  • --vjgqqmqm
  • 9. ampicillin
  • When you encounter difficulties and contradictions, do not try to break them, but bend them with gentleness and time.
  • --ampicillin
  • 10. valium
  • A large income is the best recipe for happiness I ever heard of.
  • --valium

阅读排行榜

评论排行榜

由于写程序的需要,今天试着封装了一个窗口,遇到的一个问题是我的hwnd封装在一个类里,但是由于WndProc必须声明为类的静态方法或全局函数,所以存在可能会有类的很多个实例共用一个WndProc的情况,这样我想要修改一个hwnd所在的类中的变量就没办法了,WndProc又是由系统调用的,没有办法传递一个指针什么的过去。

后来花了好长时间思索这问题,心想要是hwnd能附带自定义的信息就好了,哪怕是4个字节。Google+翻以前搜集的电子资料终于找到了SetWindowLong这函数,使用前提是注册窗口类时把cbWndExtra设为12或以上,这样就能用DWL_USER这个参数把自己想要的指针存到窗口的附加信息里了,在WndProc里用GetWindowLong函数可以取出来。

赞M$一个。

 

posted on 2006-09-13 23:52 一个咸蛋的唠叨 阅读(15762) 评论(140)  编辑 收藏
标题  
姓名  
主页
验证码 *
内容   
  登录  使用高级评论  Top
[使用Ctrl+Enter键可以直接提交]