这段代码帮忙改成C#的
改了一下,不知行不行,你试一试吧
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace FindTest
{
public partial class Form1 : Form
{
[DllImport("user32.dll", EntryPoint = "FindWindow")]
private extern static IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", EntryPoint = "SendMessage")]
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
const int WM_USER = 0x0400;
const int WM_DEVICE_COMM = WM_USER + 9;
const int SET_MOUSE_BUTTON_TAPDRAG = 7;
public Form1()
{
InitializeComponent();
SetTrackPadTapToClickState(0);
}
public void SetTrackPadTapToClickState(int nEnableDisableSwitch)
{
int MouseTap;
int nTapLockEnable = 0;
int nTapToClick = nEnableDisableSwitch;
IntPtr hwnd = FindWindow(null, "计算器");
if (hwnd == IntPtr.Zero)
{
MessageBox.Show("没有找到计算器窗口");
return;
}
MouseTap = nTapToClick | (nTapLockEnable
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!