KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

MSN-Like System Tray Icon

 
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive
View previous topic :: View next topic  
Author Message
Ashmite
KiXforms Dabbler
KiXforms Dabbler


Joined: 27 Apr 2004
Posts: 13

PostPosted: Wed Apr 28, 2004 10:18 pm    Post subject: MSN-Like System Tray Icon Reply with quote

I've created a script to assist our SysAdmins on troubleshooting workstations and lookup the version of the software baseline of an end-user workstation. The premise is one where they can click on a System Tray icon and a small form will pop up showing information like the workstation name, IP addy, MAC Addy, Windows Version, Service Pack Level, and the version of their workstation baseline.

I've included just the workings of the form, since I'm recoding from memory, and 2 quick text labels, but you'll get the idea.

A couple items of note:
1. For the example, I have the FormBorderStyle set to 5 so that you can close the applet. In the working version it is set to 0 so the users can't close the application
2. I'm running this as a Packaged Exe thanks to Stevie's editor!
3. I also have a Timer() running so that if the form goes inactive, a timer starts that closes the form in 3 seconds
4. The real app also reloads all the dynamic info on the double click so that things are always up to date.
5. You can adjust the Step value in the For loops to control the Form Speed. Right now its at 2

(Now if I can just figure out how to have it intercept "Net Sends" and tie it into a RSS feed...)

Enjoy!

--Ashmite
Code:

Break On
$System = CreateObject("Kixtart.System")


$Form = $System.Form()
$Form.Text = "System Information"
$Form.Icon = ""
$Form.ShowInTaskBar = False
$Form.ControlBox  = True
$Form.FormBorderStyle = 5
$Form.Height = 1
$Form.Width = 200
$Form.Left = $System.Screen.WorkingArea.Right  - $Form.Width
$Form.Top = $System.Screen.WorkingArea.Bottom - $Form.Height
                            
$Form.NotifyIcon = $System.NotifyIcon
$Form.NotifyIcon.Icon = $System.BuiltinIcons(34)
$Form.NotifyIcon.Visible = 1
$Form.NotifyIcon.Text = $Form.Text
$Form.NotifyIcon.OnDoubleClick = "OnIconClick()"

$Form.Label1 = $Form.Controls.Label()
$Form.Label1.Text = "Workstation Name:"
$Form.Label1.Top = 5
$Form.Label1.Left = 5
$Form.Label1.Width = 100

$Form.Label2 = $Form.Controls.Label()
$Form.Label2.Text = "@WKSTA"
$Form.Label2.Top = 5
$Form.Label2.Left = 105

$x = 1 
While $x = 1
   $=Execute($Form.DoEvents())
Loop
Exit 1

Function OnIconClick()

   If $Form.Visible
      For $tmp = 150 to 1 Step -2
         $Form.Height = $tmp
         $Form.Top = $System.Screen.WorkingArea.Bottom - $Form.Height
      Next
      $Form.Hide
   Else
      $Form.Show
      For $tmp = 1 to 150 Step 2
         $Form.Height = $tmp
         $Form.Top = $System.Screen.WorkingArea.Bottom - $Form.Height
      Next
   EndIf

EndFunction
Back to top
View user's profile Send private message
sptomey
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 18 Mar 2003
Posts: 158

PostPosted: Wed Apr 28, 2004 10:50 pm    Post subject: Reply with quote

Hey Ashmite...

Some good ideas you have here...Just one suggestion that immediately comes to mind. Instead of setting the formborderstyle to 0 to prevent the users from closing, just use the $Form.OnClosing = "" type of function so that if they do try to close it....It will just go down to the systray again.

Check out this topic for some examples...

http://www.kixforms.org/forum/viewtopic.php?p=3096#3096

_________________
-Shane
Back to top
View user's profile Send private message MSN Messenger
Ashmite
KiXforms Dabbler
KiXforms Dabbler


Joined: 27 Apr 2004
Posts: 13

PostPosted: Wed Apr 28, 2004 11:11 pm    Post subject: Reply with quote

Cool! I was looking for that event, but it isn't in the Help file. I guess I need to spend some more time cruising the forums!

Thanks!

--Ashmite
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Script Archive All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group