本帖最后由 lambition 于 2010-06-26 17:04:03 编辑

解决方案 »

  1.   

    id没问题吧,GetLastError看看为什么失败,是否有可能因为杀毒软件导致打开进程失败
      

  2.   

    The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. SyntaxDWORD GetWindowThreadProcessId(          HWND hWnd,
        LPDWORD lpdwProcessId
    );
    ParametershWnd
    [in] Handle to the window. 
    lpdwProcessId
    [out] Pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. 
    Return ValueThe return value is the identifier of the thread that created the window. 
      

  3.   

    把第二个参数换成NULL,否则什么都不返回
      

  4.   


    GetLastError怎么用啊?我菜鸟
      

  5.   


    int Erroecode = GetLastError();得到errorcode的值,然后去MSDN GetlastError这个函数里面比对。