[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

open network applet in control panel and set button ID


i want to open network applet in control panel and be able to choose
button ID

Esk
0
esk
Asked:
esk
  • 3
  • 3
  • 2
  • +1
1 Solution
 
edeyCommented:
well to show the applet try:

shellExecute(0,nil,'c:\windows\control.exe','c:\windows\system\netcpl.cpl',nil,SW_SHOW);

Gl
Mike
0
 
eskAuthor Commented:
what about the button ID?

Esk
0
 
edeyCommented:
I'm not quite sure ehat you mean, do you want to 'click' one of the applet's buttons?

GL
Mike
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
eskAuthor Commented:
yebb!!!
0
 
rwilson032697Commented:
A better way to show the network control panel is like this:

shellExecute(0,nil,'rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl','',nil,SW_SHOW);

(No clues yet about clicking the buttons...)

Cheers,

Raymond.


   
0
 
ahalyaCommented:
Here's a code snipet that would start the CPL applet and click the "Add" button.  (note that there is a minor bug in rwilson'd code: you have to pass rundll32 and the arguments seperately)



in your event handler...

var hIns : THandle;

begin;
hIns := ShellExecute(0,nil,'rundll32.exe', 'shell32.dll,Control_RunDLL netcpl.cpl',nil,SW_SHOW);
WaitForSingleObject(hIns, 10 *1000);

repeat
  h := FindWindow('#32770', 'Network');
  if h = 0 then sleep(10);
until h <> 0;

DlgID := 209; //for Add button
PostMessage(h, wm_Command, DlgID, MakeLong(h, BN_Clicked));


FYI, the following are the DLgIDs for some other buttons,

Ok : 1
Cancel : 2
Help : 9

Properties: 208
Add : 209
Remove : 210

Apply : 12321
File & Print Sharing: 113
0
 
ahalyaCommented:
btw,

I have Windows95, 4.00.950B with IE 5.00.2314.1003 installed. (and ofcouse i meant rwilson's and not rwilsoned :-) Sorry about the typo Raymond.)
0
 
rwilson032697Commented:
ahalya,

Yes, there is a bug in my example :-(, but it isn't quite the one you point out. The following does in fact work, and what I would have written if it hadn't been rather late :o)  

ShellExecute(Handle, 'open', 'rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl', '', Nil, SW_Normal);

Cheers,

Raymond.
0
 
ahalyaCommented:
wonderful. so they both work.  Let's see whether esk could click his buttons:-) with our code.
0
 
eskAuthor Commented:
Thanks

Esk
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now