?
Solved

open network applet in control panel and set button ID

Posted on 2000-02-16
10
Medium Priority
?
143 Views
Last Modified: 2010-04-04

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

Esk
0
Comment
Question by:esk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 6

Expert Comment

by:edey
ID: 2528325
well to show the applet try:

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

Gl
Mike
0
 

Author Comment

by:esk
ID: 2528344
what about the button ID?

Esk
0
 
LVL 6

Expert Comment

by:edey
ID: 2528415
I'm not quite sure ehat you mean, do you want to 'click' one of the applet's buttons?

GL
Mike
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:esk
ID: 2528422
yebb!!!
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2528800
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
 
LVL 7

Accepted Solution

by:
ahalya earned 400 total points
ID: 2529950
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
 
LVL 7

Expert Comment

by:ahalya
ID: 2529956
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
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2530048
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
 
LVL 7

Expert Comment

by:ahalya
ID: 2533270
wonderful. so they both work.  Let's see whether esk could click his buttons:-) with our code.
0
 

Author Comment

by:esk
ID: 2539535
Thanks

Esk
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question