进程句柄与进程id,线程句柄与线程id有何区别?在使用上要注意些什么?有没有这方面的完整解释

解决方案 »

  1.   

    MSDN如是说:
    handle
    A "number" assigned to a window that is used by the operating system to keep track of the attributes of the window. In a C or C++ library, a handle is a "pointer".每一个进程都有一张Process Handle Table 里面纪录者进程打开的所有内核对像的信息包括内核对象的局柄和内核对象的指针,这个所谓的局柄就是这张Process Handle Table(其实就是一个纪录结构的数组)的索引
      

  2.   

    进程ID是在系统中的标识,一个进程可以有多个句柄但是ID就只有一个,
    可以通过ID打开多个句柄
      

  3.   

    句柄不用了需要CloseHandle(),ID不用