LONG GetWindowLong( 
  HWND hWnd, 
  int nIndex
); 
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 文档里说..我得到的是address of the window procedure ,or a handle representing the address of the window procedure根据我的测试..我得到的是一个这样的 LONG型数据 EditProc : ffff03c3显然...是一个handle那我怎么根据这个handle去得到真正的窗口过程的地址呢?

解决方案 »

  1.   

    为啥32位的数据就必须是HANDLE,不能是地址呢
      

  2.   

    ffff03c3
    这个地址空间不在用户空间里啊.
    难道这个窗口过程的函数是写在内核里的?
      

  3.   

    额,没仔细看~~
    GetClassName然后GetClassInfo呢?
      

  4.   

    文档里说..不是函数地址.就是函数地址的句柄.ffff03c3 这如果是一个地址.那么它是一个内核空间里的地址.
    而窗口过程不会在内核里...所以..我的结论只能是----它是一个handle representing the address of the window procedure
      

  5.   

    句柄只是内核数据的一个索引,并不是表示内核地址,所以也不是从0x80000000~0xF000000开始编码的,你仔细看,大部分句柄都是类似于0x000xxxxx格式
      

  6.   

    额,是的,这里应该是句柄。
    在OnInitDialog里面试了一下,成功获取地址
    TCHAR classname[256];
    ::GetClassName(this->m_hWnd, classname, _countof(classname));
    WNDCLASS wndClass;
    ::GetClassInfo(::GetModuleHandle(NULL), classname, &wndClass);
      

  7.   


    调用API创建的内核对象句柄是这样的,不过也可能有其他形式的句柄存在啊
      

  8.   

    如果你说的是CWnd::WindowProc的话,这个是虚函数,通过虚函数表找到地址调用的。
    但这个是在你所谓的窗口类默认的窗口过程中完成调用的。
      

  9.   

    我的意思是.比如.一个窗口类的窗口过程是MyWndProc1
    然后我通过SetWindowLong,子类化了该窗口,该窗口的窗口过程成了MySubWndProc1
    那么此时.我通过GetClassInfo得到的窗口过程是MyWndProc1通过GetWindowLong得到的是MySubWndProc1的地址句柄..
    我想知道.此时怎样得到窗口子类化后的窗口过程MySubWndProc1的地址.