Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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 ..


Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

636 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