网上查资料看到的函数,说是API函数,但是我不知道在delphi中哪个单元文件中,找了很久没找到,有哪位用过的请告知一声,谢谢

解决方案 »

  1.   

    windows或者system里面找找吧
    另外应该是GetWindowThreadProcessID
      

  2.   

    Delphi XE的Windows.pas单元下有GetProcessID这个函数.在MSDN里能够搜索到GetWindowProcessIDRetrieves the identifier of the process that created the window.
     
    DWORD GetWindowProcessID( ) throw();
     Res
    See GetWindowThreadProcessID in the Windows SDK.Example
    Visual C++  Copy Code 
    //The following example attaches an HWND to the CWindow object and 
    //calls CWindow::GetWindowProcessID() to retrieve the id of the 
    //process that created the windowCWindow myWindow;
    myWindow.Attach(hWnd);
    DWORD dwID = myWindow.GetWindowProcessID();