Quantcast
Viewing latest article 17
Browse Latest Browse All 585

Access "Windows Security" dialog from my MFC app

I am struggle to hit OK button from a "Windows Security" dialog, from my MFC app. Here is this dialog in Win7:

Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

and here is the same dialog in Win10:

Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

after a friend advice me to get informations regarding this dialogs with inspect.exe, here is what I get from introspection:

How found:	Selected from tree...
Name:	"Windows Security"
ControlType:	UIA_WindowControlTypeId (0xC370)
LocalizedControlType:	"window"
BoundingRectangle:	{l:492 t:276 r:948 b:638}
IsEnabled:	true
HasKeyboardFocus:	false
ProcessId:	13708
RuntimeId:	[2A.1607F2]
FrameworkId:	"XAML"
ClassName:	"Credential Dialog Xaml Host"
NativeWindowHandle:	0x1607F2
ProviderDescription:	"[pid:6776,providerId:0x1607F2 Main:Nested [pid:13708,providerId:0x1607F2 Main(parent link):Unidentified Provider (unmanaged:Windows.UI.Xaml.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"
ClickablePoint:	{x:720 y:457}
LegacyIAccessible.ChildId:	0
LegacyIAccessible.DefaultAction:	""
LegacyIAccessible.Description:	""
LegacyIAccessible.Help:	""
LegacyIAccessible.KeyboardShortcut:	""
LegacyIAccessible.Name:	"Windows Security"
LegacyIAccessible.Role:	window (0x9)
LegacyIAccessible.State:	focusable (0x100000)
............
FirstChild:	"Windows Security" text
LastChild:	"Cancel" button
Next:	"Pagina login - Internet Explorer" window
Previous:	"Inspectx86" window
Other Props:	Object has no additional properties
Children:	"Windows Security" text"Close" button"" pane"OK" button"Cancel" button
Ancestors:	"Desktop 1" pane
	[ No Parent ]

and the OK button is present itself just like this:

How found:	Selected from tree...
Name:	"OK"
ControlType:	UIA_ButtonControlTypeId (0xC350)
LocalizedControlType:	"button"
BoundingRectangle:	{l:517 t:581 r:718 b:613}
IsEnabled:	true
IsOffscreen:	false
IsKeyboardFocusable:	true
HasKeyboardFocus:	false
AccessKey:	"Alt, O"
ProcessId:	13708
RuntimeId:	[2A.1607F2.4.12]
AutomationId:	"OkButton"
FrameworkId:	"XAML"
ClassName:	"Button"
IsControlElement:	true
IsContentElement:	true
ProviderDescription:	"[pid:13708,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:Windows.UI.Xaml.dll)]"
IsPeripheral:	false
LiveSettingProperty:	Off (0)
IsPassword:	false
IsRequiredForForm:	false
IsDataValidForForm:	true
ClickablePoint:	{x:617 y:597}
Culture:	1033
Orientation:	0
PositionInSet:	4294967295
SizeOfSet:	4294967295
Level:	4294967295
LandmarkType:	none (0x0)
HeadingLevel:	HeadingLevel_None (0x138B2)
LegacyIAccessible.ChildId:	0
LegacyIAccessible.DefaultAction:	"Press"
LegacyIAccessible.Description:	""
LegacyIAccessible.Help:	""
LegacyIAccessible.KeyboardShortcut:	"Alt, O"
LegacyIAccessible.Name:	"OK"
LegacyIAccessible.Role:	push button (0x2B)
LegacyIAccessible.State:	focusable (0x100000)
LegacyIAccessible.Value:	""
.....
FirstChild:	"OK" text
LastChild:	"OK" text
Next:	"Cancel" button
Previous:	"" pane
Other Props:	Object has no additional properties
Children:	"OK" text
Ancestors:	"Windows Security" window"Desktop 1" pane
	[ No Parent ]

 

this post is derived from this one: https://social.msdn.microsoft.com/Forums/en-US/337d6aa4-31eb-4e6d-a207-fd2332ad0a9d/chtmlview-access-quotwindows-securityquot-dialog?forum=vcgeneral

How can I remotely hit "OK" button, from my MFC app ? Can you give me a little help ?


Viewing latest article 17
Browse Latest Browse All 585

Trending Articles