我已经用CreateProcess打开了记事本,下一步我想使记事本的保存按钮变灰,应该怎么办?如何才能获得记事本的HWND?

解决方案 »

  1.   

    获得进程的ProcessId后,再调用OpenProcess即可获得改进程的句柄。
    HANDLE OpenProcess(
      DWORD dwDesiredAccess,  // access flag
      BOOL bInheritHandle,    // handle inheritance flag
      DWORD dwProcessId       // process identifier
    );
      

  2.   

    楼上的方法不行呀
    handle不能做hwnd使用
      

  3.   

    使用FindWindow来查找记事本窗口的句柄!