Jump to content

check radio buttons


gal9
 Share

Recommended Posts

Link to comment
Share on other sites

The right class is WindowForms10.Window.8.app.0.297b065_r69_ad1

Just copy/paste the right class from the au3info tool and replace it from MMCMainFrame

ps. alternatively you can just use the title of the window...

Link to comment
Share on other sites

1 minute ago, Nine said:

The right class is WindowForms10.Window.8.app.0.297b065_r69_ad1

Just copy/paste the right class from the au3info tool and replace it from MMCMainFrame

ps. alternatively you can just use the title of the window...

 What's wrong? can you help me, please
i try to do this with [class:]

Local $hWnd = WinWaitActive("[CLASS:WindowsForms10.Window.8.app.0.297b065_r69_ad1]", "", 5)
ConsoleWrite("WinWaitActive " & @error & "/" & $hWnd & @CRLF)
Local $hControl = ControlGetHandle($hWnd, "", "WindowsForms10.BUTTON.app.0.297b065_r64_ad13")
ConsoleWrite("Not configured " & @error & "/" & $hControl & @CRLF)
Local $iResult = _GUICtrlButton_GetCheck($hControl)
If $iResult = $BST_CHECKED Then MsgBox($MB_SYSTEMMODAL, "", "Checked")
If $iResult = $BST_INDETERMINATE  Then MsgBox($MB_SYSTEMMODAL, "", "Inderterminate")
If $iResult = $BST_UNCHECKED  Then MsgBox($MB_SYSTEMMODAL, "", "Cleared")

but it is still not work

image.thumb.png.14a32b0139858ec77b1f6d303259cb36.png

Link to comment
Share on other sites

I forgot to activate the window first :

#include <GuiButton.au3>

Local $hWnd = WinActivate("[CLASS:WindowsForms10.Window.8.app.0.297b065_r69_ad1]")
ConsoleWrite("WinActivate " & @error & "/" & $hWnd & @CRLF)
WinWaitActive($hWnd)
Local $hControl = ControlGetHandle($hWnd, "", "WindowsForms10.BUTTON.app.0.297b065_r64_ad13")
ConsoleWrite("Not configured " & @error & "/" & $hControl & @CRLF)
Local $iResult = _GUICtrlButton_GetCheck($hControl)
If $iResult = $BST_CHECKED Then MsgBox($MB_SYSTEMMODAL, "", "Checked")
If $iResult = $BST_INDETERMINATE  Then MsgBox($MB_SYSTEMMODAL, "", "Inderterminate")
If $iResult = $BST_UNCHECKED  Then MsgBox($MB_SYSTEMMODAL, "", "Cleared")

 

Link to comment
Share on other sites

2 minutes ago, Nine said:

I forgot to activate the window first :

#include <GuiButton.au3>

Local $hWnd = WinActivate("[CLASS:WindowsForms10.Window.8.app.0.297b065_r69_ad1]")
ConsoleWrite("WinActivate " & @error & "/" & $hWnd & @CRLF)
WinWaitActive($hWnd)
Local $hControl = ControlGetHandle($hWnd, "", "WindowsForms10.BUTTON.app.0.297b065_r64_ad13")
ConsoleWrite("Not configured " & @error & "/" & $hControl & @CRLF)
Local $iResult = _GUICtrlButton_GetCheck($hControl)
If $iResult = $BST_CHECKED Then MsgBox($MB_SYSTEMMODAL, "", "Checked")
If $iResult = $BST_INDETERMINATE  Then MsgBox($MB_SYSTEMMODAL, "", "Inderterminate")
If $iResult = $BST_UNCHECKED  Then MsgBox($MB_SYSTEMMODAL, "", "Cleared")

 

now I get in the console

 image.png.3da4c45ef935878c7cbeba471a8c636c.png

but still, I get Cleared.
my info about Not configured: (Maybe that's the problem)

image.thumb.png.8519a4690dce2d9c737f254052b9e909.png


 

Link to comment
Share on other sites

Link to comment
Share on other sites

3 minutes ago, Nine said:

Ah it is because you do not have the right class of the button, see ?

What do you mean? but Class and Instance it is like what is written no?
image.png.337ad5b01c8b36ee1172a2f1bbc31556.png

info:

>>>> Window <<<<
Title:  Allow Sideloading of extension
Class:  WindowsForms10.Window.8.app.0.297b065_r69_ad1
Position:   177, 303
Size:   700, 643
Style:  0x16CD0000
ExStyle:    0x00010100
Handle: 0x0003082C

>>>> Control <<<<
Class:  WindowsForms10.BUTTON.app.0.297b065_r69_ad1
Instance:   3
ClassnameNN:    WindowsForms10.BUTTON.app.0.297b065_r69_ad13
Name:   
Advanced (Class):   [CLASS:WindowsForms10.BUTTON.app.0.297b065_r69_ad1; INSTANCE:3]
ID: 919492
Text:   Not &Configured
Position:   9, 57
Size:   108, 22
ControlClick Coords:    77, 18
Style:  0x5601000B
ExStyle:    0x00000000
Handle: 0x000E07C4

>>>> Mouse <<<<
Position:   271, 409
Cursor ID:  0
Color:  0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Allow Sideloading of extension
&Next Setting
&Previous Setting
Not &Configured
&Enabled
&Disabled
Supported on:
Comment:
Microsoft Edge on Windows 10, Version 1809 or later
Options:
Sideloading installs and runs unverified extensions in Microsoft Edge. With this policy, you can specify whether unverified extensions can be sideloaded in Microsoft Edge.

If enabled or not configured, sideloading of unverified extensions in Microsoft Edge is allowed.

If disabled, sideloading of unverified extensions in Microsoft Edge is not allowed. Extensions can be installed only through Microsoft store (including a store for business), enterprise storefront (such as Company Portal) or PowerShell (using Add-AppxPackage).  When disabled, this policy does not prevent sideloading of extensions using Add-AppxPackage via PowerShell. To prevent this, in Group Policy Editor, enable Allows development of Windows Store apps and installing them from an integrated development environment (IDE), which is located at:

Computer Configuration > Administrative Templates > Windows Components > App Package Deployment

Supported versions: Microsoft Edge on Windows 10, version 1809
Default setting: Disabled or not configured
Related policies:
- Allows development of Windows Store apps and installing them from an integrated development environment (IDE)
- Allow all trusted apps to install
Help:
OK
&Apply
Cancel


>>>> Hidden Text <<<<

 

Edited by gal9
Link to comment
Share on other sites

21 minutes ago, Nine said:

Man, take you time, and read carefully the code and the au3info.  There is a difference (a 4 instead of a 9)

What should I write in the ControlGetHandle function ?

I have all the info from the Autoit tool.

I read the Autoit docs: https://www.autoitscript.com/autoit3/docs/functions/ControlGetHandle.htm, but there it's very simple, they are using notepad. And they use ClassnameNN, but when I used the same idea it's not working.

This is the only line that I don't know how to use correctly: Local $hControl = ControlGetHandle($hWnd, "", "CLASS:WindowsForms10.Window.8.app.0.297b065_r69_ad13")
The "CLASS:WindowsForms10.Window.8.app.0.297b065_r69_ad13" is exactly ClassnameNN according to Autoit info.

Thanks in advance.

Link to comment
Share on other sites

39 minutes ago, Nine said:

Man, take you time, and read carefully the code and the au3info.  There is a difference (a 4 instead of a 9)

I didn't understand:

1) How to use that handle,  I catch the Handle, it's 0x000C0756 and also with your code it is the same. What can I do with that ?

2) What is "There is a difference (a 4 instead of a 9)" that you wrote?

Link to comment
Share on other sites

11 hours ago, gal9 said:

2) What is "There is a difference (a 4 instead of a 9)" that you wrote?

The code in your posts above show
WindowsForms10.BUTTON.app.0.297b065_r64_ad13

Should be 
WindowsForms10.BUTTON.app.0.297b065_r69_ad13

Link to comment
Share on other sites

On 10/31/2022 at 3:24 AM, spudw2k said:

The code in your posts above show
WindowsForms10.BUTTON.app.0.297b065_r64_ad13

Should be 
WindowsForms10.BUTTON.app.0.297b065_r69_ad13

image.thumb.png.d295da710ca687a6aa5c002dc18b45fa.png

still not working, What other solution could there be?

Link to comment
Share on other sites

12 hours ago, gal9 said:

What other solution could there be?

Why try to get the value of AllowSideloadingOfExtensions by manipulating & interrogating the GPEdit MMC GUI when you can get the value directly from the source (where gpedit is getting it), the registry?

image.png.20798e2c61b07fd7fe4674b37c54c2b3.png

#include <Constants.au3>

example()

Func example()
    Local $vValue

    ;Get value of AllowSideloadingOfExtensions (if Not Configured, then return with error message)
    $vValue = RegRead("HKLM\Software\Policies\Microsoft\MicrosoftEdge\Extensions", "AllowSideloadingOfExtensions")
    If @error Then Return MsgBox($MB_ICONERROR, "RegRead Error", "@error = " & @error)
    
    ;Display value of AllowSideloadingOfExtensions
    ConsoleWrite("AllowSideloadingOfExtensions = " & $vValue & @CRLF)
EndFunc

 

Edited by TheXman
Link to comment
Share on other sites

I was following along as an exercise to help sharpen my skills. For ControlGetHandle, shouldn't the 3rd argument be the "advanced mode" versus the "class" only?

Also, if $iResult returns an integer, is there a mapping of that integer to the results?  

 

EDIT:

To answer my first question, it's advanced mode. Also I changed _GUICtrlButton_GetCheck to _GUICtrlButton_GetState. $iResult returns an 8 for a radio button that is checked and 0 for unchecked. My second question still stands. I see something about BitAND in the help but I don't see how that works.

Edited by rsn
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...