VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Creates a icon in your System tray which minimizes all your applications when you double click it(i

Anita  (1 Submission)   Windows API Call/Explanation   Visual Basic 5.0   Unknown Difficulty   Tue 30th January 2001   Mon 8th February 2021

Creates a icon in your System tray which minimizes all your applications when you double click it(icon in SysTray).

API Declarations


Const KEYEVENTF_KEYUP = &H2
Const VK_LWIN = &H5B

'Declare a user-defined variable to pass to the Shell_NotifyIcon
'function.
Private 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

'Declare the constants for the API function. These constants can be
'found in the header file Shellapi.h.

'The following constants are the messages sent to the
'Shell_NotifyIcon function to add, modify, or delete an icon from the System Tray
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2

'The following constant is the message sent when a mouse event occurs
'within the rectangular boundaries of the icon in the System Tray
'area.
Private Const WM_MOUSEMOVE = &H200

'The following constants are the flags that indicate the valid
'members of the NOTIFYICONDATA data type.
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4

'The following constants are used to determine the mouse input on the
'the icon in the taskbar status area.

'Left-click constants.
Private Const WM_LBUTTONDBLCLK = &H203 'Double-click
Private Const WM_LBUTTONDOWN = &H201 'Button down
Private Const WM_LBUTTONUP = &H202 'Button up

'Right-click constants.
Private Const WM_RBUTTONDBLCLK = &H206 'Double-click
Private Const WM_RBUTTONDOWN = &H204 'Button down
Private Const WM_RBUTTONUP = &H205 'Button up

'Declare the API function call.
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean

'Dimension a variable as the user-defined data type.
Dim nid As NOTIFYICONDATA


Rate Creates a icon in your System tray which minimizes all your applications when you double click it(i (2(2 Vote))
Creates a icon in your System tray which minimizes all your applications when you double click it(i.bas

Creates a icon in your System tray which minimizes all your applications when you double click it(i Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters