????? ??????? ???? ?? ???? ??????? Windows 95/98/Me ???? ?????? ????? ???????

?????? ????????? ?????? ?????????
???? ???????: 149276 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

??????

???? Windows API ?????? ??? ????? ???????? ????? ?????? ?? ???? ?????? ?? ???? ?????? ????? ??????? ? ???????? ?? ???? ??????? Windows 95, Windows 98 ? Windows Me ? Windows NT 4.0 ? Windows 2000 shell. ????? ????? ??? ??????? ???????? ?????? Shell_NotifyIcon ???? ??? ??????? ??? Shell32.dll ???. ??? ?????? API ??? ???? ?????? ??? ????? ????? ???? ToolTip ???????? ??? ???? ?????? ?????? ????? ?????? ??? ?????. ?????? ???? ????? ?? ??? ?????? ????? ?????? Visual Basic ???? ???? ????? ??????? ??? ?????? API.

????? ?????? ??? ????? ????? ??? ??? ?????? ??? ????? ?? "????? ????? ???? ??????" ??? ????? ?? ?????. ??? 4.0 Visual Basic ?? ????? ????? ?? ??????? ?????? ? ???? ????? ?????? ????? ?? ????? ??? ????????? ???????? ???????? 4.0 Visual Basic ???. ??? ????? ??? ??????? ?? Visual Basic 5.0 (?????????? ??????) ?? ????? ???? ??????? AddressOf. ??? ?? ???????? ?????? ???????? 4.0 Visual Basic ???? ?? ???? ????? ?? ??????? ??? ?? ??? OCX ???? ??????? OCX ??????? ?? ??????? ????? ????? Microsoft ???????? ?? ??? "???????" ?? ??? ??????? ?? ??????? OLE ?????? ???? ????? ?? ???? Bruce McKinney ???? Visual Basic. ?????? ??? ???? ?? ????????? ??? ?? ?? ??? ???????? ???? ??? "???????". ???? ?? ????? ??? ???????? Visual Basic ? ?? ????? ????? ??? ?????? Microsoft ?????????.

??????? ????

???? ?????? ?????? ?????? ????? Visual Basic ???? ????? ???? ????? ??????? ???? API Shell_NotifyIcon.

???? ???? ?????

  1. ??? ????? Visual Basic. ??? ????? Form1 ???? ???????.
  2. ????? ????? ??? ??????? ??? ??? ???? ????? ??????? ?? "????? ????? ???? ??????".
  3. ???? CommandButtons ??????? ??? ???????.
  4. ??? ?????? ??????? ?? ????? "?????" ?????? ?????? ????? ????????? ?????? ???? ??? ???????.
  5. ?? ?????? ????????? ???????? ??????? ????? ?? ?????? "?" ??? "?" ??????? ????? ??? ?????? ??????? 1:
          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
    					
  6. ???????? ???????? ??????? ?? ???? ???? ???????? ???? ????? ??? ????? ???? NOTIFYICONDATA ????? ?????? ????? ?? ??? ?????. ????? ??? Form1:
          Private 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
    					
  7. ????? ??????? ?? ??? ?????? ?? ????????? ???????? ??????? ?????? ??????? ?? ?????? 5 ?????? ???????? ????? ???? "????? ??????? ?? ???? ??????". ????? ??? ???????? ???????? ??? Form1 ?????:
          Private Sub Command1_Click()
              'Add an icon.  This procedure uses the icon specified in
              'the Icon property of Form1. This can be modified as desired.
    
              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
    
             Private Sub Command2_Click()
                 'Modify an existing icon. This procedure uses the icon
                 'specified in the Icon property of Form1. This can be modified
                 'as desired.
    
                 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_MODIFY, nid)
             End Sub
    
             Private Sub Command3_Click()
                 'Delete an existing icon.
    
                 Dim i As Integer
                 Dim nid As NOTIFYICONDATA
    
              nid = setNOTIFYICONDATA(hWnd:=Form1.hWnd, _
                                      ID:=vbNull, _
                                      Flags:=NIF_MESSAGE Or NIF_ICON _
                                      Or NIF_TIP, _
                                      CallbackMessage:=vbNull, _
                                      Icon:=Form1.Icon, _
                                      Tip:="")
    
              i = Shell_NotifyIconA(NIM_DELETE, nid)
          End Sub
    					
  8. ???? ??????? F5 ?? ??? "????" ?? ????? ????? ?????? ???????. ???? ??? ???? ????? ?? ???? ????? ???? ?????? ???. ???? ??? ???? ?????? ?????? ??? ????? ? ?????? ???? ?????.

?????

???? Visual Basic Bruce McKinney Microsoft Press 1995.

SDK Win32 Microsoft ? Shell_NotifyIcon ? NOTIFYICONDATA.

Microsoft Systems ???????? 1996 ?????? "????????? ?????" ???? 93.

Q&A ???????? 1996 ???? Visual Basic ????????? ?????? 136.

?????? ??? ??????? ??????? ???? ??? ??? ??????? ????? ?????? ?? "????? ??????? ?? Microsoft:
162613????? ??????? ???? ?? ???? ?????? ?? Visual Basic

???????

???? ???????: 149276 - ????? ??? ??????: 24/???? ??????/1435 - ??????: 3.1
????? ???
  • Microsoft Visual Basic 4.0 Standard Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
????? ??????: 
kbnosurvey kbarchive kbmt kbapi kbhowto KB149276 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????149276

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com