質問編集履歴

3

UI Automation画像の追加

2019/08/26 08:34

投稿

GoogleWindows
GoogleWindows

スコア23

test CHANGED
File without changes
test CHANGED
File without changes

2

UI Automation画像の追加

2019/08/26 08:34

投稿

GoogleWindows
GoogleWindows

スコア23

test CHANGED
File without changes
test CHANGED
@@ -372,6 +372,14 @@
372
372
 
373
373
 
374
374
 
375
+ ### 追記:2019/08/26 16:13
376
+
377
+
378
+
379
+ ![イメージ説明](d581c3c1cbbb11872fa51cab049cb269.png)
380
+
381
+
382
+
375
383
  ### 開発環境
376
384
 
377
385
  Windows10 x64

1

報告漏れ

2019/08/26 07:13

投稿

GoogleWindows
GoogleWindows

スコア23

test CHANGED
File without changes
test CHANGED
@@ -324,6 +324,54 @@
324
324
 
325
325
 
326
326
 
327
+ ### 追記:2019/08/22 10:50
328
+
329
+
330
+
331
+ お伝えし忘れていました。
332
+
333
+ 以下部分のコードは、UI Automationとは別の方法でボタンを押そうとしている処理です。
334
+
335
+ ウインドウハンドルは取得できていますが、ボタンが取得できていません。
336
+
337
+ 変数hButtonの中身を見ると、0が代入されていました。
338
+
339
+
340
+
341
+ ```VBA
342
+
343
+ hwnd = FindWindow("Credential Dialog Xaml Host", "Windows セキュリティ")
344
+
345
+ Set uiAuto = New CUIAutomation
346
+
347
+ Set elmIE = uiAuto.ElementFromHandle(hwnd)
348
+
349
+
350
+
351
+ '''Set objDocument = IEDOMFromhWnd(hwnd)
352
+
353
+ 'ソースの確認
354
+
355
+ ''''Debug.Print objDocument.body.innerHTML
356
+
357
+
358
+
359
+ Dim hButton As Long
360
+
361
+ hButton = FindWindowEx(hwnd, 0&, "Credential Dialog Xaml Host", "OK")
362
+
363
+
364
+
365
+ Call SendMessage(hButton, &H6, 1, 0&) 'ボタンをアクティブにする
366
+
367
+ Call SendMessage(hButton, &HF5, 0, 0&) 'ボタンをクリックする
368
+
369
+
370
+
371
+ ```
372
+
373
+
374
+
327
375
  ### 開発環境
328
376
 
329
377
  Windows10 x64