473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Block (or Hide) Control Panel

Jay
Hey There,
I've been trying to see if there is a way to programmatically block,
or hide, the Control Panel. Since it is a "Virtual Folder", just
blocking an .exe from running doesn't work. Even some of the applet
items in the Control Panel are problematic. The "Fonts" link or the
"Network Connections" link are both "Virtual Folders", so when I block
..cpl files doesn't affect them. Anybody out there have any suggestions?

Thanks!
Jay
(patelj27b at gmail dot com)

Dec 15 '06 #1
7 4306
I've been trying to see if there is a way to programmatically block,
or hide, the Control Panel. Since it is a "Virtual Folder", just
blocking an .exe from running doesn't work. Even some of the applet
items in the Control Panel are problematic. The "Fonts" link or the
"Network Connections" link are both "Virtual Folders", so when I block
.cpl files doesn't affect them. Anybody out there have any suggestions?
1) Start
2) Run
3) gpedit.msc
4) User Configuration
5) Administrative Templates
6) Control Panel
7) Prohibit access to the Control Panel
8) Enabled

Eric
Dec 15 '06 #2
Jay
Eric,
Thanks for the reply, but that way is doing it throught the GUI. I'm
looking for a way to do this programatically, using C++. Any insight
into that method would be greatly appreciated!

-Jay
(patelj27b at gmail dot com)
Eric Hill wrote:
I've been trying to see if there is a way to programmatically block,
or hide, the Control Panel. Since it is a "Virtual Folder", just
blocking an .exe from running doesn't work. Even some of the applet
items in the Control Panel are problematic. The "Fonts" link or the
"Network Connections" link are both "Virtual Folders", so when I block
.cpl files doesn't affect them. Anybody out there have any suggestions?

1) Start
2) Run
3) gpedit.msc
4) User Configuration
5) Administrative Templates
6) Control Panel
7) Prohibit access to the Control Panel
8) Enabled

Eric
Dec 15 '06 #3
Thanks for the reply, but that way is doing it throught the GUI. I'm
looking for a way to do this programatically, using C++. Any insight
into that method would be greatly appreciated!
That policy setting modifies the following registry key:

[HKCU\Software\Microsoft\Windows\CurrentVersion\Pol icies\Explorer]
NoControlPanel=REG_DWORD:0x00000001

The documentation for this setting is in TechNet:

http://technet2.microsoft.com/Window...19b081033.mspx

Eric
Dec 15 '06 #4
Jay
I've seen that registry keey modification before, and while that is a
step in the right direction, It also requires a reboot of the machine
in order for the setting to take effect. I am hoping for a way that
will be able to do it run-time, in a service (hopefully).

-Jay
(patelj27b at gmail dot com)

Eric Hill wrote:
Thanks for the reply, but that way is doing it throught the GUI. I'm
looking for a way to do this programatically, using C++. Any insight
into that method would be greatly appreciated!

That policy setting modifies the following registry key:

[HKCU\Software\Microsoft\Windows\CurrentVersion\Pol icies\Explorer]
NoControlPanel=REG_DWORD:0x00000001

The documentation for this setting is in TechNet:

http://technet2.microsoft.com/Window...19b081033.mspx

Eric
Dec 15 '06 #5
I've seen that registry keey modification before, and while that is a
step in the right direction, It also requires a reboot of the machine
in order for the setting to take effect. I am hoping for a way that
will be able to do it run-time, in a service (hopefully).
Actually, no, the policy editor does it without a reboot. Once you make
the change in the registry, you need to tell all the top-level windows
that "something has changed" and that will cause Explorer to re-load those
settings from the registry.

Specifically, change the registry key and do this:

::SendMessageTimeout(
HWND_BROADCAST,
WM_SETTINGCHANGE,
0, // user policy change = 0, computer policy change = 1
L"Policy",
SMTO_NORMAL,
2000, // 2 second timeout for each window handle
&result);

From here:

http://msdn.microsoft.com/library/en...asp?frame=true

Eric
Dec 15 '06 #6
Jay
Eric,
That is extremely helpful! I just have one last question. Since this
involves window handles, would this need to be called from a user-level
application, or could it be called from a service? I don't think a
service could do this because of the desktop interaction.

-Jay
(patelj27b at gmail dot com)

Eric Hill wrote:
I've seen that registry keey modification before, and while that is a
step in the right direction, It also requires a reboot of the machine
in order for the setting to take effect. I am hoping for a way that
will be able to do it run-time, in a service (hopefully).

Actually, no, the policy editor does it without a reboot. Once you make
the change in the registry, you need to tell all the top-level windows
that "something has changed" and that will cause Explorer to re-load those
settings from the registry.

Specifically, change the registry key and do this:

::SendMessageTimeout(
HWND_BROADCAST,
WM_SETTINGCHANGE,
0, // user policy change = 0, computer policy change = 1
L"Policy",
SMTO_NORMAL,
2000, // 2 second timeout for each window handle
&result);

From here:

http://msdn.microsoft.com/library/en...asp?frame=true

Eric
Dec 15 '06 #7

"Jay" <pa*******@gmail.comwrote in message
news:11*********************@16g2000cwy.googlegrou ps.com...
Eric,
That is extremely helpful! I just have one last question. Since this
involves window handles, would this need to be called from a user-level
application, or could it be called from a service? I don't think a
service could do this because of the desktop interaction.
Would BroadcastSystemMessage() work?

-- David
Dec 17 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: R6_2003 | last post by:
Hello all, i dunno if that's the right newsgroup to ask, but i'll try, please ignore me if u feel its not 0:) i've been messing with a control panel app for so long.. previously i was using...
2
by: AKR | last post by:
I have to create control panel applet using C# . I have read in the net that it is not possible using C# . How can i create control panel applet using C# .
2
by: John Seelig | last post by:
I have a vb.net program that calls an msi to uninstall a control panel (*.cpi, *.cpl and *.exe). However, after uninstall the icon persists in the control panel window until a refresh (F5) is...
0
by: Mac via DotNetMonster.com | last post by:
I have a MDI parent form and the only control on it is a panel anchored to the left hand side. I have menu items on the MDI parent that show & hide this panel. Ideally I would like it to show by...
3
by: pealy2 | last post by:
Sorry if this is in the wrong group, I've searched long & hard without finding anything even slightly useful. (recommendations for a more relevant group gratefuly received) I need to change the...
1
by: Glenn | last post by:
Hello Is there any documentation around which shows you ( if it is possible) how to create a new category for the windows xp control panel.( in category view) I would like to create a new...
1
by: Frank Burleigh | last post by:
A while ago I installed Net 2.0 to our Server 2003 web machine, but the Control Panel folder icon for configuring Net 2.0 never made it to the Control Panel folder. Thinking this might indicate a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.