0% found this document useful (0 votes)
21 views2 pages

Taskbar and Start Menu Properties Dialog Showing Made Easy

This article provides methods to run Control Panel applets from VC++, specifically focusing on how to display the Taskbar and Start Menu properties dialog. It outlines simple commands for running applets from the Run box and demonstrates how to invoke the dialog using the IDispatch method in VC++. The article emphasizes the importance of initializing and uninitializing COM when using these methods.

Uploaded by

kate.moss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Taskbar and Start Menu Properties Dialog Showing Made Easy

This article provides methods to run Control Panel applets from VC++, specifically focusing on how to display the Taskbar and Start Menu properties dialog. It outlines simple commands for running applets from the Run box and demonstrates how to invoke the dialog using the IDispatch method in VC++. The article emphasizes the importance of initializing and uninitializing COM when using these methods.

Uploaded by

kate.moss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

https://www.codeproject.

com/Articles/15577/Taskbar-and-Start-Menu-Properties-Dialog-showing

Taskbar and Start Menu Properties Dialog showing made easy

tanvon malik

1.89/5 (8 votes)

19 Sep 2006CPOL 1
This article shows you ways to run Control Panel applets from VC++, even those that don't have a cpl
extension file.

Background

In one of the newsgroups, a guy asked about how to show the Taskbar and Start Menu properties dialog in
VC++. I am going to show here the ways in which several different Control Panel applets can be run from VC+
+.

Running from Run box

Running an applet from the "Run" box is easy' just type "control desk.cpl" and press OK. It will show you the
Desktop properties dialog box.

Running from VC++


1
Running an applet from your code is also easy:

C++
ShellExecute( this->m_hWnd, NULL, "desk.cpl", NULL, NULL, 0);

Then what is the problem

The problem with showing the "Taskbar and Start Menu Properties" applet is this that you can't find a "cpl" file
which shows this dialog.

Solution

For help, I searched MSDN which says "you can show this dialog with any scripting language". But what about
VC++? Here is how to show this dialog the IDispatch way.

C++
CString ss = ("TrayProperties");
BSTR szMember = ss.AllocSysString();
DISPID dispid;
COleDispatchDriver disp;
disp.CreateDispatch("Shell.Application");
disp.m_lpDispatch->GetIDsOfNames(IID_NULL,&szMember,1,LOCALE_USER_DEFAULT,&dispid);
disp.InvokeHelper(dispid, DISPATCH_METHOD, NULL,NULL,NULL);
SysFreeString( szMember);

Never forget to initialize and uninitialize COM.

You might also like