Jump to content

How disable the drop-down menu of a program? - (Moved)

Recommended Posts



For a project of a tool, I have to launch a program.
This one: Display Properties control (run desk.cpl)

I have to resize it, so we can see what's necessary.

I'm getting there.

The problem is that there is a drop-down menu: so I want to disable it.
How to do this?

I already did a test with the notepad. By deactivating the "close" button.

Here is the code:

$Hwnd = WinGetHandle("[CLASS:Notepad]")

$menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE


$menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",1)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF060, "int", 0x0);SC_CLOSE

I would like to do the same, but with the drop-down menu (with DllCall).
Is it possible to disable / block (or other) the drop-down menu of a program?

Thank you for your answers.


Share this post

Link to post
Share on other sites

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:


General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.

Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

Thank you for your answers.

I had a hard time finding all CLASSNN of  window.
I found four, only one of which was functional.

Here is the code:

    $hWnd = WinWait("Paramètres")
    ControlDisable($hWnd, "", "ApplicationFrameTitleBarWindow1")
;~ ControlDisable($hWnd, "", "Windows.UI.Core.CoreWindow1")
;~ ControlDisable($hWnd, "", "ApplicationFrameTitleBarWindow2")
;~ ControlDisable($hWnd, "", "ApplicationFrameInputSinkWindow1")

;~ Windows.UI.Core.CoreWindow1
;~ ApplicationFrameTitleBarWindow1
;~ ApplicationFrameTitleBarWindow2
;~ ApplicationFrameInputSinkWindow1

In short, it disables the menu bar (reduce, exit, etc.).
But I haven't found anything for the drop-down menu yet.

I'm continuing my research.
If you have any ideas, I'll take them.

Yours sincerely.

Share this post

Link to post
Share on other sites

Hi. 😃

I would like to reopen the subject.

First of all, I didn't succeed with controldisable....

So I asked myself: and if I did an action on a button ? It could be good for me... No need for "controldisable" if it works.

But... Even with the correct coordinates (x,y of au3info), "controlclick" does not work.
But, with mouseclick, it works, if window doesn't move.

ControlClick seems to me more "clean", snif......

Here's my code, what do you think?

Local $HWND = WinWait("Paramètres", "")

;~ ControlClick($hWnd, "", "","left",1,380,420)
MouseClick("left",870, 600,3)

I have the impression that there is a restriction on the window, because on a window of another program, everything works.

Thank you for helping me.

Sincerely, Thomas.



Edited by littleboy62
Remove french sorry :P

Share this post

Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By nacerbaaziz
      hello autoit team
      please i need your help today
      am trying to make the list of features in list view and control it
      am using the dism command line to read output
      i've made the code
      but i found some problems
      what i need is the list of features in 2d array
      $array[$n][0]= name $array[$i][1] = state
      when i tested the code
      it give me some results that i don't need to it e.g
      ------ ------  | --------
      name       | state
      i need just the list of features and there state
      please help me to do that
      here is my example
      #RequireAdmin #NoTrayIcon #include <AutoItConstants.au3> Wow64EnableWow64FsRedirection(false) _Windows_Get_Features() func _Windows_Get_Features() local $a_FeaturesArray[1][2] $a_FeaturesArray[0][0] local $i_Dism_Run = Run("DISM /online /english /get-features /format:table", "", @sw_hide, BitOR($STDERR_CHILD, $STDOUT_CHILD)) local $s_OutputDism = "", $a_OutPutDism While 1 $s_OutputDism = StdoutRead($i_Dism_Run) If @error Then exitLoop if ($s_OutputDism = "") or (StringRegExp($s_OutputDism, "^((\-){1,})?(?:\s)\|?(?:\s)((\-){1,})$", 0) = 1) then ContinueLoop if (StringRegExp($s_OutputDism, "((([\s\d\-\+\_\,]{1})\|([\s\d\-\+\_\,]{1})){1,})", 0) = 1) then $a_OutPutDism = StringSplit($s_OutputDism, @lf) for $i = 1 to $a_OutPutDism[0] if msgBox(1, $i, $a_OutPutDism[$i]) = 1 then exitLoop next endIf Wend endFunc func Wow64EnableWow64FsRedirection($b_Enabled) local $h_OpenFS = DLLOpen("kernel32.dll") local $Return = DllCall($h_OpenFS, "boolean", "Wow64EnableWow64FsRedirection", "boolean", $b_Enabled) if @error then DLLClose($h_OpenFS) Return SetError(@error, @extended, -1) else DLLClose($h_OpenFS) Return $Return[0] endIf endFunc  
    • By anit
      I am trying to select a value from a drop-down (highlighted in the attached image). There is no control ID associated with the window, so I am unable to use the Control* type functions. There are two values starting with 'C' in the drop-down. I tried fetching the drop-down value by passing Send("{custom}") but it always selects the first occurrence of value starting with 'C'.
      Please suggest how may I resolve this.

    • By UGH
      Autoit team are assbags.    They want to hold out that they are soooo much smarter than everyone else and they really don't want to help anyone with their questions.   In that case then why have a website.   Oh i know, they get their kicks out of laughing at everyone. 
    • By zzghost
      I have been reading every tutorial and help document I can find trying to figure out how to capture from a website the content of a dropdown in order to populate it into a GUI with checkboxes to run some code based off of the selections...
      I would like a script to read the options from this form-group and populate a gui. I have all the code written except this part, as of now I have to manually pull this from the site and dump into my code but it changes from time to time so I would like my code to be more flexible...
      Hope this makes sense?
    • By kelso
      Hello Guru's,
      I'm trying to write an autoit script to select from the dropdown list as you see in the attached picture. 
      I read the help page for _IEFormElementOptionSelect, but I cannot grasp how to correlate that with the source code that I'm seeing. any suggestions?

  • Create New...