문제

The button control message BM_CLICK can be sent via defining a pInvoke method as follows:

[DllImport("user32.dll")]
public static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, string lParam);

and then calling the method with the corresponding Msg value, 0x00F5.

Is it possible to call the button control macro Button_Enable in a similar fashion?

도움이 되었습니까?

해결책

No, these macros are only usable from a C or C++ compiler. It is a simple text substitution, look in the windowsx.h SDK header file for the actual text that's generated when you use the macro. You'll see that you have to pinvoke EnableWindow().

You should not be using this at all btw, use an UI Automation library to commandeer another program. If these are your own buttons then use the Enabled property instead.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top