如何在对话框中单击“是" [英] How to click yes in dialog box

查看:78
本文介绍了如何在对话框中单击“是"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在具有选项yes,no和help的对话框中单击yes.
我认为DIALOG_CLASS_NAME ="ComboLBox"和EXE_FILE_NAME ="OUTLOOK.EXE".

I want to click yes on a dialog that has the options yes, no, and help.
I think that the DIALOG_CLASS_NAME="ComboLBox" and EXE_FILE_NAME="OUTLOOK.EXE".

HWND GetOutlookAsDialog(void) {
    datastruct ds = {0};
    EnumWindows(GetOutlookAsDialogProc, (LPARAM)&ds);
    Save_ProcessID = ds.ProcessID;
    Save_HWND=ds.hWnd;
    return ds.hWnd;
}

//I need to modify this block below
void _stdcall Handle_Outlook_Prompts() {
    if (HWND hWnd = GetOutlookAsDialog()) {
        HWND Button_SaveAs = ::GetDlgItem(hWnd, IDYES);
        {
            HANDLE ProcessHandle_SaveAs = OpenProcess(SYNCHRONIZE, FALSE, Save_ProcessID);
            ::PostMessage(hWnd, WM_COMMAND, MAKEWPARAM(IDYES, BN_CLICKED), (LPARAM)Button_SaveAs);
            WaitForSingleObject(ProcessHandle_SaveAs, INFINITE);
            CloseHandle(ProcessHandle_SaveAs);
        }
    }
}

推荐答案

我认为AutoIt是您想要的! AutoIt脚本可以EXE形式进行编译,只需尝试!
I think AutoIt is what you want! AutoIt script can be compiled in EXE form, just try!


这篇关于如何在对话框中单击“是"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆