DUN entry icon in taskbar when connection has been stablished in WinXP and 2000

Posted on 2004-03-26
Medium Priority
Last Modified: 2011-10-03
I have a dun entry I dial with a software I developed.

In WInXP and 2000 I need to tell that DUN entry to check the "Show icon in taskbar" in the properties page, so it will show the connection once stablished in the taskbar.

Very simple yet I know no reasonable method to do it.

Please help!

Question by:Esopo
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
  • 5
  • 4
LVL 19

Expert Comment

by:Melih SARICA
ID: 10693670
Create a RasDialFunc for Handling All ras Connection status messages
  and then if its Connected
  then Put ur icon onthe task bar

Ur RasDialFunction can be like this
In Delphi Code
Function RasDialFunc(  unMsg : Cardinal;  rasconnstate : _RASCONNSTATE ; dwError :DWORD ) Hresult;
      if rasconnstate = $00000001 then
      if rasconnstate = $00000002 then
LVL 14

Author Comment

ID: 10697136
Thanks for your post.

Do I have to do this everytime I successfully stablish the connection?
This  ShowTaskbarIcon method will make the icon appear on the taskbar? how do I declare it?

Do you know of a way to make the change directly in the RAS entry so the next time the system shows the Taskbar icon on it's own?

Thanks again.

LVL 19

Expert Comment

by:Melih SARICA
ID: 10698928
Yeah u ave to.

U make ur own dialer. U ave to tell system wot to do.. thats it..

Windows standart dialer checks the connection  and then put its own icon on the task bar. U ave to check and put ur icon too..

And u ave to use a dial function as i ve told above to handle dialing status..

here is the SDK link for ras dial Connection State enumeration. U can get all the status information . like Connecting, Authoriaztion,Connected .. etc ..


Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

LVL 14

Author Comment

ID: 10700458
>U make ur own dialer. U ave to tell system wot to do.. thats it..
I totally agree. I just noticed that if I manually checked the "Show in taskbar" option in the RAS entry properties, then when the conection was established (and my application closes) the icon would appear directly handled by the OS. I was thinking there might be a way to check that option box using code.

Is  ShowTaskbarIcon declared in the RasApi? How does it know wich connection to show? or is this a name for a function I should make, in which case, how would that work?

LVL 19

Expert Comment

by:Melih SARICA
ID: 10701534
ShowTaskBarIcon is a Function that u ll code.. U can use some components or Prepare it With ShellApi Functions..

   wm_showmen = Wm_User + 666;
   mnoticon : _NOTIFyicondataA

Procedure ShowTaskBarIcon;
  with mnoticon do
       Wnd:=mainform; // Form which ll Handle the Callback Message
       uCallbackMessage:=wm_showmen;    // message when an system event or command triggered
       szTip:='Esopos Amazing Dialer.....';
   mShell_NotifyIcon(NIM_ADD,@mnoticon); //( NIM_delete is the deletetin Parameter) and ll be used in DeleteTaskBarIcon proc
LVL 19

Expert Comment

by:Melih SARICA
ID: 10701539
And btw..

Do not forget to add  ShellApi.dcu..  

And my points :p

hope it helps .

LVL 14

Author Comment

ID: 10701805

If I'm getting you comments right, you are providing me a method to put an icon (my own icon) on the taskbar and from there interact with the user. I guess whenever the user wants to disconnect the dial up connection he'll click on my taskbar icon and 'll have to do receive the message and do the closing with my own code, right?

Dear friend, your idea is excellent and you've provided some great code, but this in no way answers my question. It's not about the points, you can have them with an A grade and all, but I want an answer for my question.

I think we have a missunderstanding about how my application works and what my question was so I'm explaining:

>I have a dun entry I dial with a software I developed.

what I meant with this is that my application created a RAS entry, a normal RAS entry. When the user asks for a connection I ask the OS (through RAS API) to stablish such connection. I chech the messages the OS is returning and when finally connected my application closes (terminates).

The whole connection is managed by Windows and the dialing is made using a RAS entry that anybody can see in the network connections panel.

>In WInXP and 2000 I need to tell that DUN entry to check the "Show icon in taskbar" in the properties page, so it will show the connection once stablished in the taskbar.

Under Windows 98, once the connection is stablished and my application terminated (leaving the connection running) Windows itself shows a taskbar icon for the connection (since it was dialed using a standard RAS entry). So whenever the user wants to disconnect he click the icon and gets the normal/standard Windows dialog for the running connection that has a "disconnect" button.
All of this is handled directly by the OS, my application was long gone by now.

My only problem with all of this, is that under Win2000 and XP the properties for RAS entries have changed and now for the Icon in the taskbar to appear, I must manually check the "Show Icon in Taskbar" in the RAS entry properties, bacause I don't know how to access the RAS entry's properties using code.

In short words: What I want is a way to change the "Show Icon in Taskbar" propery for a RAS entry using code.

I'm increasing points for this qestion to 400 so you don't feel like you've waisted your time. I hope it's clear now. I can't use your method cause my intention from the start is to let the OS control as much as possible, besides what I'm looking for should be something like 5 lines of code, it would be unreasonable to do all the coding and checking in every OS that your idea requires when the answer I want is so simple.
LVL 19

Accepted Solution

Melih SARICA earned 1600 total points
ID: 10701844
Ok ..

When U create Ur Ras Entry, in rasEntry Paramater structure
   if   RASEO_ModemLights is set , connection icon ll be displayed in the task bar by Os...

LVL 14

Author Comment

ID: 10701863
Thank you. I'll check this up and let you know how it went tomorrow.

Featured Post


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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Simple Linear Regression

762 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