Click here to Skip to main content
971 members (283 online)
Click here to Skip to main content
Add your own
alternative version

Stats

2.3K views
Posted 12 Apr 2012

"Taskbar and Start Menu Properties Dialog" showing made easy

, 12 Apr 2012
Rate this:
Please Sign up or sign in to vote.
This article shows you ways to run Control Panel applets from VC++, even those that don't have a cpl extension file.

Sample Image - taskbarProperties.jpg

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++

Running an applet from your code is also easy:

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.

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

tanvon malik
Pakistan Pakistan
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
RA-Web1 | 2.8.171114.1 | Last Updated 12 Apr 2012
Article Copyright 2012 by tanvon malik
Everything else Copyright © RootAdmin, 1999-2017
Layout: fixed | fluid