dbTalk Databases Forums  

Control Panel

comp.databases.ms-access comp.databases.ms-access


Discuss Control Panel in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Salad
 
Posts: n/a

Default Control Panel - 09-17-2010 , 08:11 PM






The following code opens the control panel
Public Function ShowControlPanel() As Boolean
On Error Resume Next
Shell "rundll32 shell32,Control_RunDLL", vbNormalFocus
ShowControlPanel = Err.Number = 0
End Function

This code from Lyle Fairfield opens up the datetime option in the
control pannel
Public Sub SetTime()
' should work from win 95/IE 4.0 inclusive onwards
Dim s32 As Object
Set s32 = CreateObject("Shell.Application")
s32.settime
' I doubt if this next line is required
Set s32 = Nothing
End Sub

I'm unsure how Lyle figured out executing the icon. How would one open
a specific icon in the control panel? Ex: System.

Reply With Quote
  #2  
Old   
mbyerley
 
Posts: n/a

Default Re: Control Panel - 09-17-2010 , 09:40 PM






http://babek.info/libertybasicfiles/.../nl137/cpl.htm

"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
The following code opens the control panel
Public Function ShowControlPanel() As Boolean
On Error Resume Next
Shell "rundll32 shell32,Control_RunDLL", vbNormalFocus
ShowControlPanel = Err.Number = 0
End Function

This code from Lyle Fairfield opens up the datetime option in the control
pannel
Public Sub SetTime()
' should work from win 95/IE 4.0 inclusive onwards
Dim s32 As Object
Set s32 = CreateObject("Shell.Application")
s32.settime
' I doubt if this next line is required
Set s32 = Nothing
End Sub

I'm unsure how Lyle figured out executing the icon. How would one open a
specific icon in the control panel? Ex: System.

Reply With Quote
  #3  
Old   
Salad
 
Posts: n/a

Default Re: Control Panel - 09-18-2010 , 12:53 AM



mbyerley wrote:

Quote:
http://babek.info/libertybasicfiles/.../nl137/cpl.htm
Good site. Thanks.

If I select Start/Run and enter in the dialog
rundll32.exe shell32.dll Control_RunDLL timedate.cpl
it works like a champ.

Within Access (v2003), If I enter in the immediate window
? Shell("rundll32.exe shell32.dll Control_RunDLL
timedate.cpl",,vbNormalFocus)
it opens and closes. Nothing in the start bar. RunDLL is in the list
of tasks in the TaskManager.


Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:u8mdnQU6qOIljAnRnZ2dnUVZ_tGdnZ2d (AT) earthlink (DOT) com...

The following code opens the control panel
Public Function ShowControlPanel() As Boolean
On Error Resume Next
Shell "rundll32 shell32,Control_RunDLL", vbNormalFocus
ShowControlPanel = Err.Number = 0
End Function

This code from Lyle Fairfield opens up the datetime option in the control
pannel
Public Sub SetTime()
' should work from win 95/IE 4.0 inclusive onwards
Dim s32 As Object
Set s32 = CreateObject("Shell.Application")
s32.settime
' I doubt if this next line is required
Set s32 = Nothing
End Sub

I'm unsure how Lyle figured out executing the icon. How would one open a
specific icon in the control panel? Ex: System.




Reply With Quote
  #4  
Old   
mbyerley
 
Posts: n/a

Default Re: Control Panel - 09-18-2010 , 09:25 AM



"Salad" <salad (AT) oilandvinegar (DOT) com> wrote

Quote:
mbyerley wrote:

http://babek.info/libertybasicfiles/.../nl137/cpl.htm

Good site. Thanks.

If I select Start/Run and enter in the dialog
rundll32.exe shell32.dll Control_RunDLL timedate.cpl
it works like a champ.

Within Access (v2003), If I enter in the immediate window
? Shell("rundll32.exe shell32.dll Control_RunDLL
timedate.cpl",,vbNormalFocus)
it opens and closes. Nothing in the start bar. RunDLL is in the list of
tasks in the TaskManager.

dunno. Since Shell is just a VBA Wrapper for the ShellExecute API, I
suspect there is not enough parameters passed for this particular applet.
Just use the API directly as the following works as expected:

'declare at the module scope
Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

then in your code:
Dim i As Long
i = ShellExecute(0, "open", "rundll32.exe", _
"shell32.dll Control_RunDLL timedate.cpl", "", vbNormalFocus)


Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:u8mdnQU6qOIljAnRnZ2dnUVZ_tGdnZ2d (AT) earthlink (DOT) com...

The following code opens the control panel
Public Function ShowControlPanel() As Boolean
On Error Resume Next
Shell "rundll32 shell32,Control_RunDLL", vbNormalFocus
ShowControlPanel = Err.Number = 0
End Function

This code from Lyle Fairfield opens up the datetime option in the control
pannel
Public Sub SetTime()
' should work from win 95/IE 4.0 inclusive onwards
Dim s32 As Object
Set s32 = CreateObject("Shell.Application")
s32.settime
' I doubt if this next line is required
Set s32 = Nothing
End Sub

I'm unsure how Lyle figured out executing the icon. How would one open a
specific icon in the control panel? Ex: System.



Reply With Quote
  #5  
Old   
Salad
 
Posts: n/a

Default Re: Control Panel - 09-18-2010 , 10:50 AM



mbyerley wrote:

Quote:
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:iqmdne-5evFOzgnRnZ2dnUVZ_gmdnZ2d (AT) earthlink (DOT) com...

mbyerley wrote:


http://babek.info/libertybasicfiles/.../nl137/cpl.htm

Good site. Thanks.

If I select Start/Run and enter in the dialog
rundll32.exe shell32.dll Control_RunDLL timedate.cpl
it works like a champ.

Within Access (v2003), If I enter in the immediate window
? Shell("rundll32.exe shell32.dll Control_RunDLL
timedate.cpl",,vbNormalFocus)
it opens and closes. Nothing in the start bar. RunDLL is in the list of
tasks in the TaskManager.

dunno. Since Shell is just a VBA Wrapper for the ShellExecute API, I
suspect there is not enough parameters passed for this particular applet.
Just use the API directly as the following works as expected:

'declare at the module scope
Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

then in your code:
Dim i As Long
i = ShellExecute(0, "open", "rundll32.exe", _
"shell32.dll Control_RunDLL timedate.cpl", "", vbNormalFocus)

That hit the spot. Thanks.

Quote:

"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message
news:u8mdnQU6qOIljAnRnZ2dnUVZ_tGdnZ2d (AT) earthlink (DOT) com...


The following code opens the control panel
Public Function ShowControlPanel() As Boolean
On Error Resume Next
Shell "rundll32 shell32,Control_RunDLL", vbNormalFocus
ShowControlPanel = Err.Number = 0
End Function

This code from Lyle Fairfield opens up the datetime option in the control
pannel
Public Sub SetTime()
' should work from win 95/IE 4.0 inclusive onwards
Dim s32 As Object
Set s32 = CreateObject("Shell.Application")
s32.settime
' I doubt if this next line is required
Set s32 = Nothing
End Sub

I'm unsure how Lyle figured out executing the icon. How would one open a
specific icon in the control panel? Ex: System.




Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.