despy Posted June 1, 2017 Posted June 1, 2017 an C# exe with no src code,now i want to disable some menuItems with APIs. like this: HMENU hMenu = (HMENU) PostMessage(hWnd, MN_GETHMENU, 0, 0); EnableMenuItem(hMenu,uIdEnableMenultem,MF_DISABLED); ... but it's not work for C# exe.What should I do?
Kurapica Posted June 1, 2017 Posted June 1, 2017 If the application is using the standard WinFroms menus then your technique won't work ! Those menus are not the typical WIN32 menus that respond to these APIs so you will have use Reflection, decompilation, or any other way to modify the property "Enabled" of that menu Item to FALSE. 2
despy Posted June 3, 2017 Author Posted June 3, 2017 On 2017/6/1 at 10:02 PM, Kurapica said: If the application is using the standard WinFroms menus then your technique won't work ! Those menus are not the typical WIN32 menus that respond to these APIs so you will have use Reflection, decompilation, or any other way to modify the property "Enabled" of that menu Item to FALSE. tks,i'll have a try to use reflection.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now