高手指教!如何用创建进程的方法打开控制面板中的各选项?(200分)

H

huxan

Unregistered / Unconfirmed
GUEST, unregistred user!
高手指教!如何用创建进程的方法打开控制面板中的各选项?
 
每个CPL的控制面板程序都是DLL,他们一般都在System32下面(2000/XP)<br>你用Delphi生成一个控制面板程序看看就明白了<br><br>CtlPanel.CPlApplet<br>function CPlApplet(hwndCPl: THandle; uMsg: DWORD; lParam1, lParam2: Longint): Longint;<br>var<br>&nbsp; Temp: Boolean;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; Temp := True;<br>&nbsp; try<br>&nbsp; &nbsp; with Application, Application.Modules[lParam1] do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; FControlPanelHandle := hwndCPl;<br><br>&nbsp; &nbsp; &nbsp; case (umsg) of<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_INIT :<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DoInit(Temp);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Result := Integer(Temp);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_GETCOUNT:<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Result := ModuleCount;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DoCount(Result);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_STARTWPARMS :<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DoStartWParms(PChar(LParam2));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Result := 1;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_INQUIRE &nbsp; &nbsp; : DoInquire(PCplInfo(lParam2)^);<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_NEWINQUIRE &nbsp;: DoNewInquire(PNewCPLInfo(lParam2)^);<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_DBLCLK &nbsp; &nbsp; &nbsp;: DoActivate(LongInt(lParam2));<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_STOP &nbsp; &nbsp; &nbsp; &nbsp;: DoStop(LongInt(LParam2));<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_EXIT &nbsp; &nbsp; &nbsp; &nbsp;: DoExit;<br>&nbsp; &nbsp; &nbsp; &nbsp; CPL_SETUP &nbsp; &nbsp; &nbsp; : DoSetup;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; except<br>&nbsp; &nbsp; Application.HandleException(Application);<br>&nbsp; &nbsp; Result := 1;<br>&nbsp; end;<br>end;
 
顶部