使用C#修改鼠标属性(在main.cpl中) [英] Modifying mouse proprties(in main.cpl) using C#

查看:123
本文介绍了使用C#修改鼠标属性(在main.cpl中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我正在开发鼠标应用程序,需要使用我自己的应用程序为用户更改鼠标设置.我已经设计了与默认鼠标属性"界面相同的Interface(GUI)(外观: http://img192 .imageshack.us/img192/1494/cap1e.png [ ^ ])

我的想法:
当用户在我的App上执行操作时,请选中切换主按钮和辅助按钮"复选框.然后,该效果与在默认鼠标属性表单中选中同一框相同,即更改"main.cpl"的内容(嗯,到目前为止,我发现鼠标设置是通过我的应用程序手动存储在system32的"main.cpl"中的.)

我的问题:
我对C#非常幼稚"(就添加控件动作和编码而言,但可以设计Windows Form App),我不知道如何实现.我指的是C#鼠标类和所有类. .以及确定",取消"和应用"按钮中的相应更改.

我也想知道工具箱"中的哪个工具"已用于指针选项"选项卡下的自定义:"部分.请让我知道(我已经使用TableLayoutPanel实现了它,并且它与默认设置不同) .

我的软件:
操作系统:Windows 7 Ultimate 64-bit
Visual Studio 2010旗舰版
.NET4.0
[extras:OpenCv,OpenCvSharp,用于后端,我认为上述问题无需考虑]
我基本上需要代码片段帮助或相关链接,或者最终您能想到的任何东西.我只剩下2-3周的时间即可完成该项目.

请帮助!
感谢您在Advance中的帮助.

Hi Everyone!
I''m am developing a mouse App and need to change the mouse settings for the user using my own App. I have designed the Interface(GUI) same as "default mouse properties" interface(have a look: http://img192.imageshack.us/img192/1494/cap1e.png[^])

My Idea:
When the user performs an action on my App,say checks the "switch primary and secondary buttons" checkbox.Then the effect will be same as checking the same box in default mouse properties form,i.e.,change the content of "main.cpl"(well,so far I found mouse settings are stored in "main.cpl" in system32) manually through my App.

My Problem:
I''m "completely naive" to C# (in terms to adding control actions and coding,but can design the Windows Form App) and I''ve no idea how to achieve it.I mean the C# mouse classes and all...and also the corresponding changes in "OK", "Cancel" and "Apply" buttons.

Also I want to know which "tool" from "toolbox" have been used to make "Customize:" section under "Pointer Options" tab.Please let me know(I''ve implemented using TableLayoutPanel and its not same as default one).

My Software:
OS: Windows 7 Ultimate 64-bit
Visual Studio 2010 Ultimate
.NET4.0
[extras:OpenCv,OpenCvSharp,for Back end,no need to consider for above problems I think]
I basically needs code snippet help or related links or finally anything You can come up with.I got only 2-3 weeks left to finish the project.

Please help!
Thanks for Your help in Advance.

推荐答案

[DllImport("user32.dll")]
        public static extern Int32 SwapMouseButton(Int32 bSwap);
        private void button1_Click(object sender, EventArgs e)
        {
            // swap mouse buttons 1= swapped 0 = normal
            SwapMouseButton(1);
            SwapMouseButton(0);
        }


这篇关于使用C#修改鼠标属性(在main.cpl中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆