public void TestClickEvent()
 {
     //同期実行。BN_CLICKEDが発生していることを確認。
     NativeButton button = new NativeButton(testDlg.IdentifyFromDialogId(1000));
     Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
         delegate { button.EmulateClick(); },
         new CodeInfo(1000, NativeMethods.WM_COMMAND, BN_CLICKED)));
 }
 public void SetUp()
 {
     app = new WindowsAppFriend(Process.Start(TargetPath.NativeControls));
     EventChecker.Initialize(app);
     WindowControl main = WindowControl.FromZTop(app);
     NativeButton buttonTest = new NativeButton(main.IdentifyFromDialogId(1030));
     buttonTest.EmulateClick(new Async());
     testDlg = main.WaitForNextModal();
 }
        static void OpenFile(WindowControl fileDialog, string path)
        {
            //ボタン取得
            var buttonOpen = new NativeButton(fileDialog.IdentifyFromWindowText("開く(&O)"));

            //コンボボックスは二つある場合がある。
            //下の方を採用。
            var comboBoxPathSrc = fileDialog.GetFromWindowClass("ComboBoxEx32").OrderBy(e =>
            {
                RECT rc;
                GetWindowRect(e.Handle, out rc);
                return rc.Top;
            }).Last();
            var comboBoxPath = new NativeComboBox(comboBoxPathSrc);

            //パスを設定
            comboBoxPath.EmulateChangeEditText(path);

            //開くボタンを押す
            buttonOpen.EmulateClick();
        }
 public void TestClickEventAsync()
 {
     NativeButton button = new NativeButton(testDlg.IdentifyFromDialogId(1001));
     Async async = new Async();
     button.EmulateClick(async);
     Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async));
 }