PC Review


Reply
Thread Tools Rate Thread

Changing control Panel options

 
 
art
Guest
Posts: n/a
 
      27th Oct 2008
Hello:

I was wondering how I can write a VBA code that will allow me to change the
mouse options in the control panel that switches primary and secondary
buttons. How can I access the control panel from excel? Please let me know.

Thanks.
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      27th Oct 2008
Private Declare Function SwapMouseButton Lib "user32" (ByVal _
bSwap As Long) As Long

Function DefMouseButton(Optional nButton As Long = 0)

DefMouseButton = SwapMouseButton(nButton)
End Function


DefMouseButton 1& ' right
DefMouseButton 0 ' left


Regards,
Peter T

"art" <(E-Mail Removed)> wrote in message
news:933B2E6B-F2EC-438C-9142-(E-Mail Removed)...
> Hello:
>
> I was wondering how I can write a VBA code that will allow me to change
> the
> mouse options in the control panel that switches primary and secondary
> buttons. How can I access the control panel from excel? Please let me
> know.
>
> Thanks.



 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      27th Oct 2008
> Function DefMouseButton(Optional nButton As Long = 0)

better as

Function DefMouseButton(Optional nButton As Long = 0) As Long

Peter T

"Peter T" <peter_t@discussions> wrote in message
news:(E-Mail Removed)...
> Private Declare Function SwapMouseButton Lib "user32" (ByVal _
> bSwap As Long) As Long
>
> Function DefMouseButton(Optional nButton As Long = 0)
>
> DefMouseButton = SwapMouseButton(nButton)
> End Function
>
>
> DefMouseButton 1& ' right
> DefMouseButton 0 ' left
>
>
> Regards,
> Peter T
>
> "art" <(E-Mail Removed)> wrote in message
> news:933B2E6B-F2EC-438C-9142-(E-Mail Removed)...
>> Hello:
>>
>> I was wondering how I can write a VBA code that will allow me to change
>> the
>> mouse options in the control panel that switches primary and secondary
>> buttons. How can I access the control panel from excel? Please let me
>> know.
>>
>> Thanks.

>
>



 
Reply With Quote
 
art
Guest
Posts: n/a
 
      27th Oct 2008
Thanks. What I wanted was the window "C:\Windows\system32\main.cpl" that is
the mouse option window to display. Can you tell me how to write that.

"Peter T" wrote:

> Private Declare Function SwapMouseButton Lib "user32" (ByVal _
> bSwap As Long) As Long
>
> Function DefMouseButton(Optional nButton As Long = 0)
>
> DefMouseButton = SwapMouseButton(nButton)
> End Function
>
>
> DefMouseButton 1& ' right
> DefMouseButton 0 ' left
>
>
> Regards,
> Peter T
>
> "art" <(E-Mail Removed)> wrote in message
> news:933B2E6B-F2EC-438C-9142-(E-Mail Removed)...
> > Hello:
> >
> > I was wondering how I can write a VBA code that will allow me to change
> > the
> > mouse options in the control panel that switches primary and secondary
> > buttons. How can I access the control panel from excel? Please let me
> > know.
> >
> > Thanks.

>
>
>

 
Reply With Quote
 
art
Guest
Posts: n/a
 
      27th Oct 2008
Thanks, I got already what I wanted:

Sub OPenMousenow()
Set ShellApp = CreateObject("Shell.Application")
ShellApp.ControlPanelItem ("C:\Windows\system32\main.cpl")
End Sub





Thanks Anyways.

"Peter T" wrote:

> > Function DefMouseButton(Optional nButton As Long = 0)

>
> better as
>
> Function DefMouseButton(Optional nButton As Long = 0) As Long
>
> Peter T
>
> "Peter T" <peter_t@discussions> wrote in message
> news:(E-Mail Removed)...
> > Private Declare Function SwapMouseButton Lib "user32" (ByVal _
> > bSwap As Long) As Long
> >
> > Function DefMouseButton(Optional nButton As Long = 0)
> >
> > DefMouseButton = SwapMouseButton(nButton)
> > End Function
> >
> >
> > DefMouseButton 1& ' right
> > DefMouseButton 0 ' left
> >
> >
> > Regards,
> > Peter T
> >
> > "art" <(E-Mail Removed)> wrote in message
> > news:933B2E6B-F2EC-438C-9142-(E-Mail Removed)...
> >> Hello:
> >>
> >> I was wondering how I can write a VBA code that will allow me to change
> >> the
> >> mouse options in the control panel that switches primary and secondary
> >> buttons. How can I access the control panel from excel? Please let me
> >> know.
> >>
> >> Thanks.

> >
> >

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      27th Oct 2008
Call Shell("rundll32.exe shell32.dll,Control_RunDLL main.cpl @0",
vbNormalFocus)

Regards,
Peter T

"art" <(E-Mail Removed)> wrote in message
news:BBDF8A81-866D-4A04-8FBB-(E-Mail Removed)...
> Thanks. What I wanted was the window "C:\Windows\system32\main.cpl" that
> is
> the mouse option window to display. Can you tell me how to write that.
>
> "Peter T" wrote:
>
>> Private Declare Function SwapMouseButton Lib "user32" (ByVal _
>> bSwap As Long) As Long
>>
>> Function DefMouseButton(Optional nButton As Long = 0)
>>
>> DefMouseButton = SwapMouseButton(nButton)
>> End Function
>>
>>
>> DefMouseButton 1& ' right
>> DefMouseButton 0 ' left
>>
>>
>> Regards,
>> Peter T
>>
>> "art" <(E-Mail Removed)> wrote in message
>> news:933B2E6B-F2EC-438C-9142-(E-Mail Removed)...
>> > Hello:
>> >
>> > I was wondering how I can write a VBA code that will allow me to change
>> > the
>> > mouse options in the control panel that switches primary and secondary
>> > buttons. How can I access the control panel from excel? Please let me
>> > know.
>> >
>> > Thanks.

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control panel options =?Utf-8?B?U3VzYW4=?= Windows XP Accessibility 0 8th Jan 2006 12:36 PM
Internet Options on Control Panel RG Windows XP Internet Explorer 1 24th Nov 2005 04:06 AM
control panel - folder options Maxine Windows XP Help 0 22nd Nov 2003 04:43 PM
other control panel options Ian Smith Windows XP General 1 10th Oct 2003 10:50 AM
Control Panel Internet options Ken Microsoft Windows 2000 0 13th Sep 2003 05:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:20 PM.