使用窗口句柄使用c#禁用鼠标单击在C#中可能吗?我已经删除了特定窗口的菜单栏和标题栏,这是实现上述要求的起点吗?我怎样才能达到这个要求。使用窗口语句删除菜单单栏和标题栏的代码:#regionConstants//按类名查找窗口[DllImport("USER32.DLL")]publicstaticexternIntPtrFindWindow(stringlpClassName,stringlpWindowName);//设置一个窗口为另一个窗口的子窗口[DllImport("USER32.DLL")]publicstaticexternIntPtrSetParent(IntPtrhWndChild,IntPtrhWndNewParent);//设置窗口属性[DllImport("USER32.DLL")]publicstaticexternintSetWindowLong(IntPtrhWnd,intnIndex,intdwNewLong);//获取窗口属性[DllImport("USER32.DLL")]publicstaticexternintGetWindowLong(IntPtrhWnd,intnIndex);[DllImport("user32.dll",EntryPoint="FindWindow",SetLastError=true)]staticexternIntPtrFindWindowByCaption(IntPtrZeroOnly,stringlpWindowName);[DllImport("user32.dll")]staticexternIntPtrGetMenu(IntPtrhWnd);[DllImport("user32.dll")]staticexternintGetMenuItemCount(IntPtrhMenu);[DllImport("user32.dll")]staticexternboolDrawMenuBar(IntPtrhWnd);[DllImport("user32.dll")]staticexternboolRemoveMenu(IntPtrhMenu,uintuPosition,uintuFlags);//需要各种常量publicstaticuintMF_BYPOSITION=0x400;公共静态uintMF_REMOVE=0x1000;公共静态intGWL_STYLE=-16;公共静态intWS_CHILD=0x40000000;//子窗口publicstaticintWS_BORDER=0x00800000;//带边框的窗口publicstaticintWS_DLGFRAME=0x00400000;//有双边框但没有标题的窗口publicstaticintWS_CAPTION=WS_BORDER|WS_DLGFRAME;//带有标题栏的窗口publicstaticintWS_SYSMENU=0x00080000;//窗口菜单#endregionpublicstaticvoidWindowsReStyle(){Process[]Procs=Process.GetProcesses();foreach(ProcessprocinProcs){if(proc.ProcessName.StartsWith("notepad")){IntPtrpFoundWindow=proc.MainWindowHandle;intstyle=GetWindowLong(pFoundWindow,GWL_STYLE);//获取菜单IntPtrHMENU=GetMenu(proc.MainWindowHandle);//获取项目计数intcount=GetMenuItemCount(HMENU);//循环并移除for(inti=0;i
