Forum » Programiranje » VisualBasic vprasanje
VisualBasic vprasanje
alesrosina ::
zanima me kako narest, da se ikona programa pojavi v taskbaru (tm kt je ura v Windowsih).
webblod ::
Najprej kreiraš nov podatkovni tip:
Public 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
Določiš potrebne konstante:
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206
Nato deklariraš funkcije:
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
in seveda kreiraš spremenljivko podatkovnega tipa:
Public nid As NOTIFYICONDATA
Sedaj pa še spišeš kodo, ki bo vse to 'pohandlala'... Lahko jo ustvariš v inicializaciji programa (torej main proceduri) ali pa daš uporabniku možnost izbire "Show in System Tray"... Pač kakor hočeš.
Upam da sem ti odprl pogled na zadevo...
LP
Public 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
Določiš potrebne konstante:
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206
Nato deklariraš funkcije:
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
in seveda kreiraš spremenljivko podatkovnega tipa:
Public nid As NOTIFYICONDATA
Sedaj pa še spišeš kodo, ki bo vse to 'pohandlala'... Lahko jo ustvariš v inicializaciji programa (torej main proceduri) ali pa daš uporabniku možnost izbire "Show in System Tray"... Pač kakor hočeš.
Upam da sem ti odprl pogled na zadevo...
LP
There must be a reason, why I'm so damn dissapointed on M$ Visual Basic
WEBblod.NET :: Slovenska programerska scena
WEBblod.NET :: Slovenska programerska scena
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [C#] Prosim pomagajte! Potrebujem program, ki bi pobiral podatke iz ene straniOddelek: Programiranje | 2746 (2356) | David1994 |
» | Vb6Oddelek: Programiranje | 1327 (1190) | StratOS |
» | API+VBOddelek: Programiranje | 2088 (1792) | webblod |
» | Odpiranje dat.exe v VBOddelek: Programiranje | 2988 (2781) | webblod |
» | Visual basic Progress barOddelek: Programiranje | 1561 (1494) | Lunik |