Jump to content

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


Recommended Posts

Hello.

 

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:
 

Run("Notepad.exe")
WinWait("[CLASS:Notepad]")
$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


MsgBox(0,'',1)

$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.

Sincerely,
Thomas.

Link to comment
Share on other sites

  • Developers

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

Quote

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.
  :)

Link to comment
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:

ShellExecute("desk.cpl")
    $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.

Link to comment
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?

ShellExecute("desk.cpl")
Local $HWND = WinWait("Paramètres", "")
WinActivate($HWND)
Sleep(2000)

;~ 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
Link to comment
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
 Share

×
×
  • Create New...