Results 1 to 2 of 2

Thread: Minmixing ... well sorta

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2001
    Location
    Maine
    Posts
    214

    Minmixing ... well sorta

    how would you make it so a program it in the bar on the bottom of the screen where the time is, and how would you make it so when you click on the X it minimizes down to there. Thnx

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
    2.  
    3. Private Type NOTIFYICONDATA
    4.     cbSize As Long
    5.     hWnd As Long
    6.     uId As Long
    7.     uFlags As Long
    8.     ucallbackMessage As Long
    9.     hIcon As Long
    10.     szTip As String * 64
    11. End Type
    12.  
    13. Private Const NIM_ADD = &H0
    14. Private Const NIM_MODIFY = &H1
    15. Private Const NIM_DELETE = &H2
    16. Private Const WM_MOUSEMOVE = &H200
    17. Private Const NIF_MESSAGE = &H1
    18. Private Const NIF_ICON = &H2
    19. Private Const NIF_TIP = &H4
    20. Private Const WM_LBUTTONDBLCLK = &H203
    21. Private Const WM_LBUTTONDOWN = &H201
    22. Private Const WM_LBUTTONUP = &H202
    23. Private Const WM_RBUTTONDBLCLK = &H206
    24. Private Const WM_RBUTTONDOWN = &H204
    25. Private Const WM_RBUTTONUP = &H205
    26.  
    27. Private SysTray As NOTIFYICONDATA
    28.  
    29. Private Sub StartInSysTray()
    30.     SysTray.cbSize = Len(SysTray)
    31.     SysTray.hwnd = Picture1.hwnd
    32.     SysTray.uId = 1&
    33.     SysTray.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
    34.     SysTray.ucallbackMessage = WM_MOUSEMOVE
    35.     SysTray.hIcon = Me.Icon
    36.     SysTray.szTip = "&R&e&s&t&a&r&t" & Chr$(0)
    37.     Shell_NotifyIcon NIM_ADD, SysTray
    38.     Me.Hide
    39.     App.TaskVisible = False
    40. End Sub
    41.  
    42. Private Sub Form_Load()
    43. StartInSysTray
    44. End Sub
    45.  
    46. Private Sub Form_Unload(Cancel As Integer)
    47.     SysTray.cbSize = Len(SysTray)
    48.     SysTray.hwnd = Picture1.hwnd
    49.     SysTray.uId = 1&
    50.     Shell_NotifyIcon NIM_DELETE, SysTray
    51. End Sub
    52.  
    53. 'Add A Picture Control To The Form.   Set its visible property to False
    54. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    55.  
    56. Static rec As Boolean, msg As Long
    57.     Dim RetVal As String
    58.     Dim returnstring
    59.     Dim retvalue
    60.     msg = X / Screen.TwipsPerPixelX
    61.     If rec = False Then
    62.         rec = True
    63.     Select Case msg
    64.     Case WM_LBUTTONDOWN
    65.    
    66.     Case WM_LBUTTONDBLCLK
    67.          
    68.     Case WM_LBUTTONUP
    69.          
    70.     Case WM_RBUTTONUP
    71.          
    72.     End Select
    73.         rec = False
    74.     End If
    75.  
    76. End Sub
    77.  
    78. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    79.         Select Case UnloadMode
    80.             Case vbFormControlMenu 'UnloadMode 0
    81.                  'form is being unloaded via the X
    82.                  Me.Hide
    83.             Case vbFormCode        'UnloadMode 1
    84.                  'Unload Me has been issued from code
    85.             Case vbAppWindows      'UnloadMode 2
    86.                  'Windows itself is closing
    87.             Case vbAppTaskManager  'UnloadMode 3
    88.                  'the Task Manager is closing the app
    89.             Case vbFormMDIForm     'UnloadMod 4
    90.                  'an MDI child form is closing because
    91.                  'its parent form is closing
    92.         End Select
    93. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width