HWND wd=::FindWindowW(NULL,L"DBank一点通 数据银行行长");
可以获得句柄
我现在想要单击一下  上传文件  这个按钮。。
怎么做额。。
我postmessage总是不成功

解决方案 »

  1.   

    用SPY++,具体的可以看一下这个例子http://blog.csdn.net/cvbtvbwu/article/details/5957276
      

  2.   

    本来想试吓,可是安装这个软件没那个界面,都不知道昨了.吐血http://hi.csdn.net/attachment/201109/28/2520371_13171747616r7T.jpg
      

  3.   


    /****************************************************************************
    获取主窗口下某个子窗口的窗口句柄
    参数1:最顶层父窗口
    参数2:控件ID,可使用spy++(VS2008版本) 查看
    ****************************************************************************/
    static
    HWND FindControlWnd(HWND ParentWnd,DWORD ControlID)
    {
    HWND hChild = ::GetWindow(ParentWnd, GW_CHILD); for(; hChild!=NULL ; hChild=::GetWindow(hChild,GW_HWNDNEXT))
    {
    //判断是否为需要的控件  
    if ( GetDlgCtrlID(hChild) == ControlID  )
    return hChild;   HWND FindWnd=FindControlWnd(hChild,ControlID);
    if (FindWnd)
    return FindWnd;
    }
    return NULL;
    }HWND wd=::FindWindowW(NULL,L"DBank一点通 数据银行行长");
    HWND button=FindControlWnd(wd,ControlID);  // ControlID 通过 spy++(VS2008版本) 查看
    ASSERT(button);
    ::PostMessage(button,BM_CLICK,NULL,NULL);