Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Panel Acces 5

Status
Not open for further replies.

ShyFox

Programmer
Mar 22, 2003
210
ES
Hy,
Does anyone know how to acces the control panel components?
I accesed them till now by searching the *.cpl through all the computer and storing their paths into a *.dbf.
What do I do when I meet a hdd with 120Gb? That's why I don't think that my method is competitive.
Is there any solution to make it easyier?
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
Hi

Copy the code and run it from command window..
*********************************************************
pDir = "C:\"
CREATE CURSOR filename (cfilename c(128))
omyfiler = CREATEOBJECT('Filer.FileUtil')
oMyFiler.FileExpression = '*.CPL' && CPL file search
omyfiler.searchpath = pDir && Search Directory
omyfiler.subfolder = 1 && 1=add all subdirectories else 0
oMyFiler.SortBy = 0
omyfiler.FIND(0)
LOCAL ncount
ncount = 1
FOR nfilecount = 1 TO omyfiler.FILES.COUNT
IF omyfiler.FILES.ITEM(nfilecount).NAME = "." OR ;
omyfiler.FILES.ITEM(nfilecount).NAME = ".."
LOOP
ENDIF
APPEND BLANK
REPLACE cfilename ;
WITH UPPER(omyfiler.FILES.ITEM(nfilecount).PATH)+ ;
UPPER(omyfiler.FILES.ITEM(nfilecount).NAME)
ENDFOR
BROW
*********************************************************


ramani :)
(Subramanian.G)
 
RUN /N control desktop
RUN /N setup
RUN /N control fonts
RUN /N control keyboard
etc
You just need to figure out the keyword

Cheerio




Michael Ouellette
mouellette@compuserve.com
 
Ramani
Your code will be usefull to me (to create tables with another type of fils, eg *.dbf), star to you

Monika from Warszawa (Poland)
(monikai@yahoo.com)
 
try this ways

*timedate.cpl
*access.cpl
*main.cpl : mouse
*appwiz.cpl : add-remove program
*sysdm.cpl : system
*desk.cpl : desktop
*intl.cpl : international
*joy.cpl : Joystick properties
*mmsys.cpl : multimedya
*modem.cpl : modem

*run samples
RUN/n2 rundll32.exe shell32.dll,Control_RunDLL intl.cpl
RUN/n2 rundll32.exe shell32.dll,Control_RunDLL desk.cpl
RUN/n2 rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl
RUN/n2 rundll32.exe shell32.dll,Control_RunDLL timedate.cpl

or

?runCtrlPanelApplet()

function runCtrlPanelApplet
lparameter tcApplet, tcPage
local lcCmd,lcPage,lnParamcount,lcApplet
lnParamCount = pcount()
do case
case lnParamCount = 0
lcApplet = [appwiz.cpl] && by default we run Add/Remove Programs
lcPage = [0]
case lnParamCount = 1
if file(tcApplet) && check the file existance
lcApplet =alltr(tcApplet)
lcPage = [0]
else
return .null.
endif
otherwise
if file(tcApplet)
lcApplet =alltr(tcApplet)
lcPage = alltr(tcPage)
else
return .null.
endif
endcase
lcCmd = [run /n rundll32.exe shell32.dll,Control_RunDLL ]+;
lcApplet+[,@0,]+lcPage
&lcCmd
return




Soykan OEZCELIK
 
Hi

Michael Ouellette method will be better if you know the action and want to open the control panel for specific thing.. But better the following way than RUN command.

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, STRING cAction, STRING cFileName, ;
STRING cParams, STRING cDir, INTEGER nShowWin
=ShellExecute(0,"OPEN","CONTROL","desktop","",1)
=ShellExecute(0,"OPEN","CONTROL","fonts","",1)

:)

ramani :)
(Subramanian.G)
 
Thank you all
Stars ...
Now I come with bigger problem ... (that's why asked you for another solution and droped my dbf solution.
I've told you about my 120 Gb hdd but as I didn't have enough time to write I omited to tell you that I have 3 OS's on my HDD. ('98, 'XP, '.NET). So if I do this search I end with a 120 Gb entirely searched (much time ... I tell you for sure) and 3 Desktop items (every desk.cpl for every OS.
Not good.
Doesn't windows have a function to let me kow it's own *.cpl's?
Or to find what OS I run and what's the partition of the active OS. This way I could search only 25 Gb but not 120 Gb.
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
You could use GETENV("WinDir") to return the system directory, then just search the subfolders. That's where they should be anyway, not scattered all over the hard drive. I don't think all control panel applets are stored, such as a registry entry, I think control panel reads them in when it is started.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Dave,
Thank you !
Star
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top