» »

vb6 + taskbar

vb6 + taskbar

DJroky ::

enkrat je bil tukaj postopek kako lahko v vb6 naredimo da program teče v ozadju in je viden samo v taskbaru. se kdo spomni kako?
hvala

webblod ::


Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, pnid As TNotifyIconData) As Boolean

Private Type TNotifyIconData
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type

Const NIM_ADD = &H0
Const NIM_MODIFY = &H1
Const NIM_DELETE = &H2
Const NIF_MESSAGE = &H1
Const NIF_ICON = &H2
Const NIF_TIP = &H4

Const WM_MOUSEMOVE = &H200
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONDBLCLK = &H203
Const WM_RBUTTONDOWN = &H204
Const WM_RBUTTONDBLCLK = &H206

Dim Nid As TNotifyIconData


Private Sub Form_Load()

'Skrijemo obrazec
Me.Visible = False

With Nid
.cbSize = Len(Nid)
.hwnd = Form1.hwnd
.uId = 0
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Form1.Icon
.szTip = App.Name
End With

Shell_NotifyIcon NIM_ADD, Nid

End Sub


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim Sporocilo As Long

AutoRedraw = True
Sporocilo = ScaleX(X, ScaleMode, vbPixels)

Select Case Sporocilo
Case WM_LBUTTONDOWN
MsgBox "Enojni klik z levim gumbom"
Case WM_LBUTTONDBLCLK
If Me.Visible Then Me.Visible = False Else Me.Visible = True
MsgBox "Dvojni klik z levim gumbom"
Case WM_RBUTTONDOWN
MsgBox "Enojni klik z desnim gumbom"
Case WM_RBUTTONDBLCLK
MsgBox "Dvojni klik z desnim gumbom"
End Select
End Sub


Private Sub Form_Unload(Cancel As Integer)

'Pospravimo ikono is opravilne vrstice
Shell_NotifyIcon NIM_DELETE, Nid

End Sub




Mislim, da razlaga ni potrebna.... Ali pač? :D
There must be a reason, why I'm so damn dissapointed on M$ Visual Basic
WEBblod.NET :: Slovenska programerska scena

Zgodovina sprememb…

  • spremenil: webblod ()

StratOS ::

hm, spet si me prehitu !!:\

webblod ::

Lahko pa napišeš razlago, ker se meni ne da... ;)
There must be a reason, why I'm so damn dissapointed on M$ Visual Basic
WEBblod.NET :: Slovenska programerska scena

DJroky ::

Probu, pa dela, sam namest App.Name je treba dat App.Title. Zdej pa me zanima še to: ko greš v Windows Task Manager je ta program pod Application. Je možno narest tako da bo pod Processes, npr. tako kot MBM?
drugače pa hvala


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

[EXCEL] Pogojno kopiranje na drug list

Oddelek: Programiranje
61769 (1691) StratOS
»

VB in kk dobit Ip od račnalnika

Oddelek: Programiranje
81198 (1032) alesrosina
»

API+VB

Oddelek: Programiranje
262082 (1786) webblod
»

Odpiranje dat.exe v VB

Oddelek: Programiranje
122979 (2772) webblod
»

Visual basic Progress bar

Oddelek: Programiranje
51556 (1489) Lunik

Več podobnih tem