灰太狼你是用mouse_event实现的还是?

解决方案 »

  1.   

    我使用mouse_event遇到的问题是 运行点击按钮代码后鼠标停留在按钮上 但是没有点击的效果 只是鼠标位置对了
      

  2.   

    BOOL ActiveSudaExplorer(CString& strParam)
    {// 
    printf("ActiveSudaExplorer start \n");
    RECT rect;
    // CString strTitle("2345网址导航-我的个性化主页-中国最好的网址站  -  速达浏览器");
    CString strTitle("http://www.suda123.com/sucess.asp?uid=djwillis&snn=d...  -  速达浏览器");
    CString strChangedTitle;

    HWND hSudaHwnd = ::FindWindow(NULL, strTitle.GetBuffer(0));
    if (hSudaHwnd)
    {
    printf("速达浏览器\n");
    //查找Internet Explorer Service
    DWORD Width = GetSystemMetrics(SM_CXSCREEN);
    DWORD Heigth = GetSystemMetrics(SM_CYSCREEN);
    MoveWindow(hSudaHwnd, 0, 0, Width, Heigth, TRUE); GetSudaExplorerHwnd(hSudaHwnd, NULL);
    if (g_hSudaIEServiceHwnd)
    {
    printf("找到速达浏览器IEService\n"); ::GetWindowRect(g_hSudaIEServiceHwnd, &rect);
    CRect IERect(&rect);
    // for(int i = IERect.top + IERect.bottom/2; i < IERect.bottom; i+=20)
    // {
    DWORD X = IERect.left + IERect.right/2;
    DWORD Y = 135;
     
    for(int j = X; j < IERect.right; j+=5)
    {
    LPARAM lparam=(Y<<16)+j;
    //printf("x = %d y = %d lparam = %d \n", j, Y, lparam);
    ::PostMessage(g_hSudaIEServiceHwnd, WM_LBUTTONDOWN, MK_LBUTTON, lparam); 
    ::PostMessage(g_hSudaIEServiceHwnd, WM_LBUTTONUP, MK_LBUTTON, lparam);
    Sleep(1000);
    ::GetWindowText(hSudaHwnd, strChangedTitle.GetBuffer(128), 128);
    if (strTitle.Compare(strChangedTitle) != 0)
    {
    SendCountDataToServer(strParam);
    printf("已经激活浏览器");
    //goto SUCCESSFULLY;
    break;
    }
    }
    // }
    //SUCCESSFULLY:
    // ;
    } ::SendMessage(hSudaHwnd, WM_CLOSE, 0, 0); 
    }
    else
    {
    printf("没有找到句柄 \n");
    }

    printf("ActiveSudaExplorer end \n");
    return TRUE;
    }
      

  3.   

    你不是能取得对话框的句柄吗?
    然后MoveWindow不行吗?