110,567
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using System.Collections.Generic;
namespace Text
{
public class Program
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern Boolean SendMessage(IntPtr hWnd, UInt32 Msg, Boolean wParam, UInt32 lParam);
private const UInt32 BM_GETCHECK = 0x00F0;
private const UInt32 BM_SETCHECK = 0x00F1;
static void Main(string[] args)
{
IntPtr h = new IntPtr(句柄自己取);
Boolean bChecked = SendMessage(h, BM_GETCHECK, false, 0);
Boolean bNewChecked = !bChecked;
SendMessage(h, BM_SETCHECK, bNewChecked, 0);
Console.ReadKey();
}
}
}