|
-
Jan 5th, 2003, 06:29 AM
#1
Thread Starter
Frenzied Member
Taskbar Problem
Hi there,
I have made an application which has only one form, i m running the application in startup and the code i got from the forum, it is working fine. Now the problem is that, I want my application to run in taskbar, means when system starts, application should run but the form should not be displayed on the screen until user double clicks the icon on the task bar.
Thanx
-
Jan 5th, 2003, 06:52 AM
#2
Addicted Member
did u mean the taskbar (near the start button) or the system tray (near the clock)? im sure i have a module for the system tray
-=[Ç¥ßè®Ìú§]=-
How many microsoft employees does it take to change a lightbulb? None, they simply define darkness as the new industry standard.
CAUTION: OVERCLOCKING A 386 TO 5Ghz MAY BE HAZARDOUS
-
Jan 5th, 2003, 03:41 PM
#3
Thread Starter
Frenzied Member
-
Jan 5th, 2003, 08:04 PM
#4
VB Code:
'Puts app icon in the system tray
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
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
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const WM_MOUSEMOVE = &H200
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Const WM_RBUTTONDBLCLK = &H206
Private Const WM_RBUTTONDOWN = &H204
Private Const WM_RBUTTONUP = &H205
Private SysTray As NOTIFYICONDATA
Dim Result As Long
Private Sub StartInSysTray()
SysTray.cbSize = Len(SysTray)
SysTray.hWnd = Picture1.hWnd
SysTray.uId = 1&
SysTray.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
SysTray.ucallbackMessage = WM_MOUSEMOVE
'change the below line to the desired icon
SysTray.hIcon = Me.Icon
SysTray.szTip = App.EXEName & ".exe"
Shell_NotifyIcon NIM_ADD, SysTray
Me.Hide
End Sub
Private Sub Form_Load()
StartInSysTray
End Sub
Private Sub Form_Unload(Cancel As Integer)
'Remove the icon from the system tray
SysTray.cbSize = Len(SysTray)
SysTray.hWnd = Picture1.hWnd
SysTray.uId = 1&
Shell_NotifyIcon NIM_DELETE, SysTray
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
Static rec As Boolean, msg As Long
Dim RetVal As String
Dim returnstring
Dim retvalue
msg = x / Screen.TwipsPerPixelX
If rec = False Then
rec = True
Select Case msg
Case WM_LBUTTONDOWN
Case WM_LBUTTONUP
Case WM_RBUTTONDOWN
'Bring up the menu if the right mouse button is clicked over the icon
If Button = vbRightButton Then
PopupMenu mnuFile
End If
Case WM_RBUTTONUP
End Select
rec = False
End If
End Sub
Last edited by Nightwalker83; Jan 5th, 2003 at 08:08 PM.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 6th, 2003, 12:40 PM
#5
Thread Starter
Frenzied Member
Hi there,
Code is working fine and places the application in system tray, but on double clicking the icon on system tray, application is not coming on the desktop. Can u solve it ??
Thanx for code.
-
Jan 6th, 2003, 02:00 PM
#6
Fanatic Member
did you add code to the dblclick event to make it do so??
if no you'll need to do that.
It Never Fails. Everytime I try to make a program idiot proof, the world makes a better idiot.
-
Jan 6th, 2003, 03:07 PM
#7
Thread Starter
Frenzied Member
Taskbar Problem
Double click event for which control. As soon as I runs the application, it comes in the system tray, so please tell me where and what code for the double click event.
Thanx
-
Jan 6th, 2003, 03:46 PM
#8
Fanatic Member
double click for picture1
It Never Fails. Everytime I try to make a program idiot proof, the world makes a better idiot.
-
Jan 6th, 2003, 04:46 PM
#9
Thread Starter
Frenzied Member
Sir, I will be thankful to you if you also send me the code for the double click of the picture to show the form on desktop because I am new in VB.
Thanx
-
Jan 7th, 2003, 08:57 AM
#10
Fanatic Member
VB Code:
Private Sub Picture1_DblClick()
Me.Show
Me.WindowState = vbNormal
End Sub
It Never Fails. Everytime I try to make a program idiot proof, the world makes a better idiot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|