Loading Programs in the System tray

How do i load executable files into the system tray
rodney_almAsked:
Who is Participating?
 
twardConnect With a Mentor Commented:

Type NOTIFYICONDATA
   
    cbSize As Long
    hwnd As Long
    uID As Long
    uFlags As Long
    uCallbackMessage As Long
    hIcon As Long
    szTip As String * 64

End Type

Global Const NIM_ADD = 0
Global Const NIM_MODIFY = 1
Global Const NIM_DELETE = 2
Global Const NIF_MESSAGE = 1
Global Const NIF_ICON = 2
Global Const NIF_TIP = 4

Declare Function Shell_NotifyIconA Lib "SHELL32" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Integer

Public Function setNOTIFYICONDATA(hwnd As Long, ID As Long, Flags As Long, CallbackMessage As Long, Icon As Long, Tip As String) As NOTIFYICONDATA

  Dim nidTemp As NOTIFYICONDATA
 
  nidTemp.cbSize = Len(nidTemp)
  nidTemp.hwnd = hwnd
  nidTemp.uID = ID
  nidTemp.uFlags = Flags
  nidTemp.uCallbackMessage = CallbackMessage
  nidTemp.hIcon = Icon
  nidTemp.szTip = Tip & Chr$(0)
 
  setNOTIFYICONDATA = nidTemp

End Function

Private Sub AddToSystemTray_Click()

  Dim i As Integer
  Dim s As String
  Dim nid As NOTIFYICONDATA
 
  s = InputBox("Enter String:")

  nid = setNOTIFYICONDATA(hWnd:=Form1.hWnd, ID:=vbNull, Flags:=NIF_MESSAGE Or NIF_ICON Or NIF_TIP, CallbackMessage:=vbNull, Icon:=Form1.Icon, Tip:=s)

  i = Shell_NotifyIconA(NIM_ADD, nid)

End Sub
0
 
rodney_almAuthor Commented:
Thanks its Great,

Rodney,
Rodney@goa1.dot.net.in
0
 
rodney_almAuthor Commented:
since i am a begenier, could you please tell me how to make it a file. I mean do i have to draw any textboxs, etc??

rodney
rodney@goa1.dot.net.in
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
twardCommented:
Not sure what you mean??
0
 
rodney_almAuthor Commented:
how do i go about just paste your program in a module file??

0
 
twardCommented:
Sure do, simply copy it and paste it in a new or existing VB Module.
0
 
rodney_almAuthor Commented:
does not work. could you send me your visual basic program?
0
 
MoondancerCommented:
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0
All Courses

From novice to tech pro — start learning today.