[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

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

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!

Esopo.
0
Esopo
Asked:
Esopo
  • 5
  • 4
1 Solution
 
Melih SARICACommented:
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;
  begin
      if rasconnstate = $00000001 then
            ShowTaskbarIcon;
      if rasconnstate = $00000002 then
            DeleteTaskbarIcon;
   end;
0
 
EsopoAuthor Commented:
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.


0
 
Melih SARICACommented:
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 ..

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rras/rras/rasconnstate.asp

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
EsopoAuthor Commented:
>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?

0
 
Melih SARICACommented:
ShowTaskBarIcon is a Function that u ll code.. U can use some components or Prepare it With ShellApi Functions..

Const
   wm_showmen = Wm_User + 666;
var
   mnoticon : _NOTIFyicondataA

Procedure ShowTaskBarIcon;
  with mnoticon do
    begin
       cbSize:=sizeof(_NOTIFyicondataA);
       Wnd:=mainform; // Form which ll Handle the Callback Message
       uID:=999;
       uFlags:=NIF_ICON+NIF_MESSAGE+NIF_TIP;
       uCallbackMessage:=wm_showmen;    // message when an system event or command triggered
       hIcon:=LoadIcon(happins,'mainicon');
       szTip:='Esopos Amazing Dialer.....';
    end;
   mShell_NotifyIcon(NIM_ADD,@mnoticon); //( NIM_delete is the deletetin Parameter) and ll be used in DeleteTaskBarIcon proc
end;
0
 
Melih SARICACommented:
And btw..

Do not forget to add  ShellApi.dcu..  

And my points :p


hope it helps .

0
 
EsopoAuthor Commented:
non_zero:

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.
0
 
Melih SARICACommented:
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...

0
 
EsopoAuthor Commented:
Thank you. I'll check this up and let you know how it went tomorrow.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now