|
You probably read this code there? The most important thing is that you don't post, do you think it useful?
Fortunately, the pallet code is everywhere.
dwState is a property of m_IconData, you can think so.
And m_IconData defines NOTIFYICONDATA structure.
If nothing is wrong, I think there should be something like this in your code: Dim m_IconData As NOTIFYICONDATA
This structure, you can break it down like this
Private Type NOTIFYICONDATA
cbSize As Long 'structure size (bytes)
hwnd As Long 'Handle of the window processing the message
uId As Long 'unique identifier
uFlags As Long 'Flags
uCallBackMessage As Long 'Message received by the message processing window
hIcon As Long '' Tray Icon Handle
szTip As String * 128 'Tooltip
dwState As Long 'Tray Icon State
dwStateMask As Long 'State Mask
szInfo As String * 256 'balloon prompt text
uTimeoutOrVersion As Long 'balloon prompt disappear time or version
'uTimeout-Time to disappear balloon prompt (unit: ms, 10000-30000)
'uVersion-Version (0 for V4, 3 for V5)
szInfoTitle As String * 64 'balloon tip title
dwInfoFlags As Long 'balloon tip icon
End Type
If you can't understand this structure, you should check MSDN, MSDN has explained in detail
dwState
Version 5.0. State of the icon. There are two flags that can be set independently. Flag Description
NIS_HIDDEN The icon is hidden.
NIS_SHAREDICON The icon is shared.
Your code should have the following definitions:
'dwState to NOTIFYICONDATA structure
Private Const NIS_HIDDEN =&H1 'Hide icon
Private Const NIS_SHAREDICON =&H2 'Share icon
This has already been explained, dwState As Long 'Tray Icon State
And dwStateMask's explanation in MSDN is
dwStateMask
Version 5.0. A value that specifies which bits of the state member are retrieved or modified. For example, setting this member to NIS_HIDDEN causes only the item's hidden state to be retrieved.
Therefore, the value of dwstate is obtained by performing an AND operation with dwstatemask. As long as dwstatemask is 0, dwstate is 0 no matter what. This is why dwstate = 0.
In fact, if you comment this sentence, the program will run. |
|