Quote:
> I am actually new to windows api so I need a little help.
> I have built a program that counts the time you stay
> connected to the internet.
> I want it to start in the windows startup. It should
> automatically detect the internet connection (just like
> messengers or ICQ) & start counting
> I have the following questions:
> 1. How can I add it to the quick launch toolbar so that it
> resides in the backgound & gets activated when an internet
> connection takes place.
Hmm, do you mean add an icon to the quick launch toolbar or add your
application to get started when windows gets started? I think you're
probably getting your terminology mixed up here but just in case here's an
expert from a post I wrote on the subject a few weeks ago:
<quote>
By toolbar do you mean the IE quick-launch box or the system tray? If the
latter then there are numerous examples around, for the former then I did
some research and came up with the following:
'***
OSfCreateShellLink "..\..\APPLIC~1\MICROS~1\INTERN~1\QUICKL~1", _
strProgramIconTitle, strProgramPath, strProgramArgs, fPrivate, sParent
'***
However I don't know how reliable it is but I've found the same code in a
couple of different places so it may be ok. The full path is :
"{userappdata}\Microsoft\Internet Explorer\Quick Launch\"
</quote>
To make your application load on startup, just create a shortcut to it and
place it in Start -> Programs -> Startup or in this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
There's plenty of examples online about accessing the registry with VB, but
there's a couple of good tutorial on this here:
http://www.*-*-*.com/
http://www.*-*-*.com/
Quote:
> 2. when the user is connected to the internet , how can I
> add an icon (or whatever u call it) in the quick lauch
> toolbar that displays the number of
> minutes (just like the getright downloads).
I think you're probably wanting to create an icon in the system tray,
there's plenty of examples of this online, just do a search:
http://www.*-*-*.com/ +system+tray+icon
Hope this helps,
Mike
-- EDais --
- Microsoft Visual Basic MVP -
WWW: http://www.*-*-*.com/