If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Creating control panel applets in .NET

Hi Boris,

to answer your question, "No" . <g> To write a control panel applet, your
program has to expose std calls (I think), similar to win32 API. As there is
no way to do this in managed .net, the only way is to write it in C++ . You
could write a C++ component that exposed the necessary functions, or geneic
ones, and then have that have a managed interface, but there is no such
component as part of dotnet's CLR libraries at present.

"Boris F." <borisf@hotmail.com> wrote in message
news:3b61187e@news.devx.com...
> Is there a way to create a control panel applet using vb.net?
>
> Thanks in advance.
>
> Boris.
>
>

Re: Creating control panel applets in .NET

The "long" answer is that the .NET framework provides a ServiceBase class,
which you can inherit to create services. You implement the OnStart, OnStop,
etc. with the functionality you need your service to provide.

The service you create can be controlled by the Service Manager. The .NET
framework provides a ServiceController class, which you can use to programatically
control a service from your own code. This allows you to query a service
to see its current running state, see if it's busy, etc.

The final step would be to create a control panel app using this ServiceController.
A CPL is nothing but a DLL that exposes one single function called CPIApplet
(which looks like, and basically is, a message handler). Control.exe calls
into this function any time you need to initialize, terminate, etc., an control
panel app. Unfortunately, there is no class that acts as a proxy between
Control.exe and your .NET code like there is for services. (of course, CPL's
aren't used strictly for working with services either)

However, it shouldn't be difficult at all for somebody to create this proxy
in C++ and either expose another callback which your .NET code could use
(ala Desware tools), or send notification directly to your .NET code via
delegates.

On the other hand, services (and other management tasks) are increasingly
being controlled by Management Console, and .NET does handle MMC integration.
There's a sample in the beta (which I admitadly haven't actually used yet).

-Rob

"Bill McCarthy" <bill_mcc@iprimus.com.au> wrote:
>Hi Boris,
>
>to answer your question, "No" . <g> To write a control panel applet, your
>program has to expose std calls (I think), similar to win32 API. As there
is
>no way to do this in managed .net, the only way is to write it in C++ .
You
>could write a C++ component that exposed the necessary functions, or geneic
>ones, and then have that have a managed interface, but there is no such
>component as part of dotnet's CLR libraries at present.
>
>
>"Boris F." <borisf@hotmail.com> wrote in message
>news:3b61187e@news.devx.com...
>> Is there a way to create a control panel applet using vb.net?
>>
>> Thanks in advance.
>>
>> Boris.
>>
>>
>
>