Jump to content

Disable a Menu Item for a seperate program


Zlow
 Share

Recommended Posts

I'm still VERY new to Autoit so please forgive my ignorance. I've tried searching on this but haven't found anything I could use.

We have a software package that is designed to print shipping labels to various printers. The problem I'm having is end users changing the printer configuration then crying about IT not being able to resolve this issue. The perfect resolution at this point is to rip off the employees arms and club them to death with the bloody appendage. I've tried locking the permissions on the config files but the software vendor insists the user needs admin rights to the software folder. This finally brings me to my question.

Is it possible for me to use an Autoit script to disable all or a single drop down menu in the shipping software?

Any help is appreciated.

Link to comment
Share on other sites

Ok, I'm impatient too, 7 views and no replies? I figured this would be a resounding 'no'. I'm just curious if the Autoit control functions work for other programs. I know you can automate an install by sending a click to a control, but could you disable the control rather than clicking it, or delete it completely?

If the answer is 'maybe' please help me understand.

If the answer is no, then is it possible to prevent the menu bar from being clicked in any other way? Educating the users to leave shit alone would be ideal, but there is a reason some people are payed $6 per hour...

Link to comment
Share on other sites

Just because you went and bumped your thread in less than 24 hours I'm not even going to look at it untill tomorrow now.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Just because you went and bumped your thread in less than 24 hours I'm not even going to look at it untill tomorrow now.

A lot of people looked at it but haven't said anything. I didn't reply to bump my thread, but thought I should clarify my question. I thought this would have been a very simple question.

/Zlow

Link to comment
Share on other sites

It is possible if you can determine the menu you need to disable. This code will disable the user from using the "New" item in the file menu of Notepad.

CODE

#include <GuiMenu.au3>

Run("notepad.exe")

WinWaitActive("[CLASS:Notepad]") ;wait until window is active

$hWnd = WinGetHandle("[CLASS:Notepad]") ;get handle of the application

$hMain = _GUICtrlMenu_GetMenu($hWnd) ;get the handle of the menu item

$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) ;get the handle of the "File" menu. For notepad position 0-File, 1-Edit, 2-Format, 3-View, 4-Help

_GUICtrlMenu_SetItemState($hFile,0,$MFS_DISABLED) ;Disable the item you need - 0 is first item, 1 is second, etc. Keep in mind spacer lines are item numbers as well.

Good luck.

Bob

You can't see a rainbow without first experiencing the rain.

Link to comment
Share on other sites

It is possible if you can determine the menu you need to disable. This code will disable the user from using the "New" item in the file menu of Notepad.

CODE

#include <GuiMenu.au3>

Run("notepad.exe")

WinWaitActive("[CLASS:Notepad]") ;wait until window is active

$hWnd = WinGetHandle("[CLASS:Notepad]") ;get handle of the application

$hMain = _GUICtrlMenu_GetMenu($hWnd) ;get the handle of the menu item

$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) ;get the handle of the "File" menu. For notepad position 0-File, 1-Edit, 2-Format, 3-View, 4-Help

_GUICtrlMenu_SetItemState($hFile,0,$MFS_DISABLED) ;Disable the item you need - 0 is first item, 1 is second, etc. Keep in mind spacer lines are item numbers as well.

Good luck.

Bob

Thank you! I'll try and find the time to invest in this now. I'm just unsure if the program is reverting its settings or if the users are changing the printer configs. Either way I'm too busy to bark up the wrong tree, thank you again.

Link to comment
Share on other sites

Thank you! I'll try and find the time to invest in this now. I'm just unsure if the program is reverting its settings or if the users are changing the printer configs. Either way I'm too busy to bark up the wrong tree, thank you again.

Just a thought but either way, you should be able to write something to fix it. If it's the users, continue as you were going to of disabling that feature, and if it's reverting itself, write something to change it before they print or somethign similar.

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

  • Recently Browsing   0 members

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