Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Loading Programs in the System tray

Posted on 1999-10-04
8
Medium Priority
?
176 Views
Last Modified: 2010-05-02
How do i load executable files into the system tray
0
Comment
Question by:rodney_alm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
tward earned 200 total points
ID: 2096320

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
 

Author Comment

by:rodney_alm
ID: 2097020
Thanks its Great,

Rodney,
Rodney@goa1.dot.net.in
0
 

Author Comment

by:rodney_alm
ID: 2097088
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 7

Expert Comment

by:tward
ID: 2097122
Not sure what you mean??
0
 

Author Comment

by:rodney_alm
ID: 2097212
how do i go about just paste your program in a module file??

0
 
LVL 7

Expert Comment

by:tward
ID: 2097223
Sure do, simply copy it and paste it in a new or existing VB Module.
0
 

Author Comment

by:rodney_alm
ID: 2098485
does not work. could you send me your visual basic program?
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6859063
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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question