我想写一个程序:用来自动登录QQ,怎么样获取输入QQ号的cmbobox的句柄呢?

解决方案 »

  1.   

    先用spy看看combobox的名字,然后Findwinow函数,这样可以么~
      

  2.   

    先看看是什么类名,然后findwindow+枚举组件
      

  3.   

    HWND FindWindow(          LPCTSTR lpClassName,
        LPCTSTR lpWindowName
    );
    ParameterslpClassName
    [in] Pointer to a null-terminated string that specifies the class name or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. 
    If lpClassName points to a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names. If lpClassName is NULL, it finds any window whose title matches the lpWindowName parameter. lpWindowName
    [in] Pointer to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match. 
    Return ValueIf the function succeeds, the return value is a handle to the window that has the specified class name and window name.If the function fails, the return value is NULL. To get extended error information, call GetLastError. 
      

  4.   


    获取组件的句本柄用FindWindowEx这个句柄可能获取不到,API可能被QQ拦截了,没试过
      

  5.   

    QQ我记得是直接画上去的,可能是DirectUI