data-ad-format="horizontal">

Open Source Project Homepage (here, download)

Current Version: 2.6.1

What is IconIP?

A small application to assist in the remote control and monitoring of a computer workstation. IconIP shows the user (via a system tray icon) the last octet of the current IP address. IconIP also has the ability to show another IP octet in the system tray (to assist in subnet recognition), and simply display a static Icon. IconIP also has the ability to create and update a text file (possibly on a network server) that contains information about the computer IconIP runs on. This file can be used for automated connections. IconIP will also recognize configuration options for various remote control applications and record the port number in use.

What does it cost?

IconIP is free to use and is an open source application. In addition to current downloads and information, you can find the source code at IconIP’s SourceForge home page here.

I have to thank Thomas Byers and Zayd Khaial for thier valuable help and suggestions during the development of IconIP.

If you’re like me, you use some sort of remote administration application to control and administer computers on your network(s). One of the biggest challenges though, is determining the IP Address and User Name of a computer if it has been assigned by DHCP or if the Host Name is not set to something entirely useful. As an administrator of a network, you can’t let finding a computer get in he way of solving a problem. IConIP run in the system try and displays the last number of the local computer’s IP Address and can periodically update a small text file that contains User Name, Host Name and IPaddress information. When used with the Virtual Admin Utility – you have a quick, mobile solution to remotely controlling the computers in your office.

Sometimes we have to tell the user to fumble with the software to determine their IP address, other times we name the computer’s host name something we recognize (like the hostname, User Name) but that fails when the computer is moved, other times we might consult the DHCP server for more information, and in even rarer situations, the user is savvy enough to determine this information on their own. In most cases, you will find that in an environment of DHCP assigned addresses – determining the IP Address of user’s computers can be very daunting because user accounts are not linked to IP addresses, so the DHCP Server is unlikely to include enough information to locate the computer your looking for.. With the help of my colleague Zayd (for the great idea) , I decided to develop a utility that would help alleviate these problems, and at the same time not be too system intensive, nor intrusive to the user. The result of this effort is the free utility, IconIP.

IconIP (shown at left) is a small tray icon that contains the last number of the local computer’s IP address. In most environments, the DHCP assigned address is only on one subnet, so the last number of the IP Address is enough to tell you what the computer’s IP Address is. You simply get the user to tell you what this number is, fill in the first part of the IP Address, and then connect to the computer remotely using your standardized remote control application (PCAnywhwere,VNCView, Radmin, Remotely Anywhere, Timbukto, NetOp Remote Controlto name a few). IconIP also accounts for changes in the IP Address over time and will change the number in the system tray based on the new IP Address. If the user hovers over the IconIP Icon, he/she will also see the full IP Address as well as the host name of the computer.

IconIP is also well-suited for a network environment. You can run the setup of IconIP in a Login script using the “/S” switch for silent operation or use a version checker to keep the IconIP.exe executable up to date. IconIP also includes code to ensure it does not run more than one instance in case it might be run twice in a login script. The process of updating the Hosts file is as clean as possible not keeping the file open for longer than the update operation itself. IconIP also supports the use of UNC (serverpathfile) paths for saving the hosts file. As a basic means of protecting the configuration, IconIP also allows you to disable the configuration User Interface to protect from casual users.

How IconIP was Made

IconIP was developed on Delphi, and uses a third-party component called CoolTrayIcon. You can get the component from http://www3.brinkster.com/troels/delphi.asp. Within this set of components, I used the wonderful TextTrayIcon that actually allows me to place text in the location of the System tray. If you remember, I previously ha d to create the icons that would represent the numbers, now TextTrayIcon takes care of that. With all of the icons sorted out, I was now able to build the code to determine the hostname and the IP Address. Here is my FormCreate() function:

procedure TForm1.FormCreate(Sender: TObject);
var
wVersionRequested : WORD;
WSAData: TWSAData;
p: PHostEnt;
s : array[0..128] of char;
p2 : pchar;

sUserName : string;
dwUserNameLen : DWord;
begin

wVersionRequested := MAKEWORD(1, 1);
wsErr := WSAStartup(wVersionRequested, wsaData);

{Get the computer name}
GetHostName(@s, 128);
p := GetHostByName(@s);
DNSName := p^.h_Name;

{Get the IpAddress}
p2 := iNet_ntoa(PInAddr(p^.h_addr_list^)^);
wsVer := Inttostr(wsaData.wHighVersion shr 8) + ‘.’ + Inttostr(byte(wsaData.wHighVersion));
wsDesc := wsaData.szDescription + string(‘ ‘) + String(wsaData.szSystemStatus);
IPAddress := p2;
WSACleanup;

// Username process
dwUserNameLen := cnMaxUserNameLen-1;
SetLength( sUserName, cnMaxUserNameLen );
GetUserName(PChar( sUserName ),dwUserNameLen );
SetLength( sUserName, dwUserNameLen );

Label7.Caption := sUserName;

// Get Last number of IP address
IPaddress := copy(Ipaddress,(LastDelimiter(‘.’,IPaddress) + 1) , Sizeof(Ipaddress));
trayicon.text := Ipaddress;
trayicon.Hint := ‘IP: ‘ + p2 + ‘ Host: ‘ + DNSName;

Label3.Caption := p2;
Label4.Caption := DNSName;
end;

The above code outlines three steps, get the computer name, use the computer name to get the IP Address and then use these pieces of information set the Tray Icon as well as the ToolTip for the tray.

Starting the application with the main form hidden

When starting the application, you will want to hide the main firm as well. This is easily done in the project’s source code, just after the CreateForm function:

Application.CreateForm(TForm1, Form1);
ShowWindow(Application.Handle,SW_HIDE);

Accounting for the changed IP Address

When the user of the system (or the DHCP server) changes the local IP Address of the system, IconIP should also change to account for the new IP Address. To achieve this, I placed a timer in the main form and set it to fire once ever 60 seconds. In the .OnTimer function, I placed all of the code that was in the FormCreate function.

Things to try next?

Although this application is quite nifty, it does represent the quick and dirty method of creating the same with much less resources. There are a number of parts of this program that could be enhanced to improve IconIP. Since this program will remain free as long as it is used, I welcome submissions from you, the user to help me make this the best utility possible.

Here are some ideas:

You could first off place the code to update the icon in its own function to reduce code duplication.

I would like to be able to close the program during the setup process, I wonder if I could send a DDE message to close it?

The detection of ports in use by Remote Control programs could support more than two applications.

There you have it, IconIP gets the job done – but could do it much faster and much more efficiently. If you have any suggestions I would love to hear from you. I have been very pleased with the response. I suggest that you give it a try to see if it works for you. I have offered a setup utility for download as well – if you would like to auto-deploy the application on your network, run IIPinstall24.exe with a parameter of /S. The “S” is capital and is case sensitive. IIPinstall.exe merely places IconIP.EXE in the “Program Files” directory and a link in the Startup older (in the Start Menu). The source code is also included with this application.