home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / win95nt / program / msgblast / data.z / taskbar.frm < prev    next >
Text File  |  1995-09-09  |  3KB  |  117 lines

  1. VERSION 4.00
  2. Begin VB.Form frmTaskbar 
  3.    Caption         =   "You shouldn't see this form."
  4.    ClientHeight    =   1530
  5.    ClientLeft      =   1560
  6.    ClientTop       =   2040
  7.    ClientWidth     =   2835
  8.    Height          =   2160
  9.    Left            =   1530
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1530
  12.    ScaleWidth      =   2835
  13.    Top             =   1440
  14.    Width           =   2895
  15.    Begin MessageBlaster.MsgBlaster msgbMain 
  16.       Left            =   360
  17.       Top             =   240
  18.       _version        =   65536
  19.       _extentx        =   847
  20.       _extenty        =   847
  21.       _stockprops     =   0
  22.       enabled         =   -1  'True
  23.       voodoo          =   "taskbar.frx":0000
  24.    End
  25.    Begin VB.Menu mnuHolder 
  26.       Caption         =   "mnuHolder"
  27.       Begin VB.Menu mnuHolderAbout 
  28.          Caption         =   "&About..."
  29.       End
  30.       Begin VB.Menu mnuHolderSep1 
  31.          Caption         =   "-"
  32.       End
  33.       Begin VB.Menu mnuHolderClose 
  34.          Caption         =   "&Close"
  35.       End
  36.    End
  37. End
  38. Attribute VB_Name = "frmTaskbar"
  39. Attribute VB_Creatable = False
  40. Attribute VB_Exposed = False
  41.  
  42. Option Explicit
  43. Private Sub Form_Load()
  44.  
  45.    On Error Resume Next
  46.    
  47.    'set message receiving target to desired form handle
  48.    msgbMain.hWndTarget = Me.hwnd
  49.    
  50.    'add application defined message to MessageBlaster "watch" list
  51.    msgbMain.AddMessage WM_USER, POSTPROCESS
  52.    
  53.    'add icon to Win95 taskbar
  54.    AddIcon Me, WM_USER, "Message Blaster/Taskbar Icon Sample by Cris Williams"
  55.  
  56. End Sub
  57. Private Sub mnuHolderAbout_Click()
  58.  
  59.    On Error Resume Next
  60.    
  61.    'show about box
  62.    frmAbout.Show vbModal
  63.    
  64. End Sub
  65.  
  66.  
  67. Private Sub mnuHolderClose_Click()
  68.  
  69.    On Error Resume Next
  70.    
  71.    'remove icon from Win95 taskbar
  72.    DelIcon
  73.  
  74.    'send message to designated form to shutdown
  75.    SendMessage hwnd, WM_USER, 0, WM_USER + 1
  76.    
  77. End Sub
  78. Private Sub msgbMain_Message(ByVal hwnd As Long, ByVal Msg As Long, wParam As Long, lParam As Long, nPassage As Integer, lReturnValue As Long)
  79.  
  80.    On Error Resume Next
  81.    
  82.    'evaluate lParam argument of received message
  83.    Select Case lParam
  84.    
  85.       'if left button is clicked on taskbar icon...
  86.       Case WM_LBUTTONDOWN
  87.       
  88.          'display informative message
  89.          MsgBox "The left mouse button was clicked.", vbInformation, App.Title
  90.          
  91.       'if middle or right button is clicked on taskbar icon...
  92.       Case WM_MBUTTONDOWN, WM_RBUTTONDOWN
  93.       
  94.          If IsWindowVisible(frmAbout.hwnd) Then
  95.             MsgBox "Close the About dialog, then continue.", vbExclamation, App.Title
  96.             Exit Sub
  97.          End If
  98.    
  99.          'display popup menu at mousepointer
  100.          popupmenu mnuHolder, 0, , , mnuHolderClose
  101.          
  102.       'if application defined message is received
  103.       Case WM_USER + 1
  104.          
  105.          'shutdown
  106.          End
  107.          
  108.    End Select
  109.  
  110. End Sub
  111.  
  112. Private Sub msgbMain_Click()
  113.  
  114. End Sub
  115.  
  116.  
  117.