If I got the other software's Menu handle,but i want to know Menu's MenuItem whether is checked state or unchecked state,how to use windows api to get the other software's MenuItem state.
[DllImport("user32.dll")]
public static extern int GetMenuState(int hMenu, int wID, int wFlags);
private int MF_BYPOSITION = 0x400;
int it = GetMenuState(menuHandle, 2, MF_BYPOSITION );
I'm sure the menuHandle value is correct,but return value it aways equals -1,i can't find out the reason.
can anybody help me?link url as follow:
http://www.codeproject.com/Questions/616259/how-to-use-Api-get-the-MenuItem-checked-state
[DllImport("user32.dll")]
public static extern int GetMenuState(int hMenu, int wID, int wFlags);
private int MF_BYPOSITION = 0x400;
int it = GetMenuState(menuHandle, 2, MF_BYPOSITION );
I'm sure the menuHandle value is correct,but return value it aways equals -1,i can't find out the reason.
can anybody help me?link url as follow:
http://www.codeproject.com/Questions/616259/how-to-use-Api-get-the-MenuItem-checked-state
public static extern uint GetMenuState(IntPtr hMenu, uint wID, uint wFlags);
private uint MF_BYPOSITION = 0x400;
private uint MF_BYCOMMAND = 0xFFFFFFFF;
//IntPtr menuHandle = IntPtr.Zero;
uint it = GetMenuState(menuHandle, 2, MF_BYCOMMAND);
查询:UINT GetMenuState(HMENU hMenu, UINT uId, UINT uFlags);