Posted June 1, 20178 yr 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?
June 1, 20178 yr 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.
June 3, 20178 yr Author 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.
Create an account or sign in to comment