The SetWindowText function changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. However, SetWindowText cannot change the text of a control in another application.BOOL SetWindowText(
  HWND hWnd,         // handle to window or control
  LPCTSTR lpString   // title or text
);

解决方案 »

  1.   

    azuo_lee:    能把你的拦截API的程序给我看看么?
        我一直对这个很迷惑,想看个清楚。
        [email protected]
      

  2.   

    to xiaoxiaohan:
       SetWindowText是设置窗口标题,而不是显示窗口标题。举个例子,程序只需要在一启动设置一次Window Text,但是以后每次非客户区重画都要重新绘制Window Text。绘制与设置是不同的。to 111222:
       我就用的是microsoft research上的Detour。进程注入就用最偷懒的办法——SetWindowsHookEx。因为我要拦截有文字输出程序,因此对于非GUI程序即使未拦截也无关紧要。to NowCan:
       不是。DrawText与DrawTextEx最后都会调用TextOut与ExtTextOut来实现。使用DrawText与DrawTextEx绘制的文字我的程序可以拦到。事实上,以上那些部分的重绘是在WM_NCPAINT到来时由DefWindowProc完成的,而DefWindowProc在对WM_NCPAINT处理时,非但没有调用正常的文字输出函数,而是使用int 2E和一些内核代码完成(地址都大于0x8000000)。我只是想知道有什么办法可以解决这个问题——即得到标题拦重绘时的文字信息。