Go Back   Gaming Gutter


» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post I'm about nready to...
Yesterday 08:58 PM
Last post by Xenocide
Today 06:16 AM
10 Replies, 154 Views
Go to first new post What movie have you just...
11-29-2008 10:34 AM
by Kospor
Last post by Hodizzle
Today 06:08 AM
22 Replies, 142 Views
Go to first new post BD pets for USD/NP
12-03-2008 12:02 AM
by jsndin
Last post by xzNoobxz
Today 06:08 AM
1 Replies, 14 Views
Go to first new post Good Night Thread
01-11-2007 03:13 AM
By emit
Last post by Bex
Today 05:58 AM
916 Replies, 9,912 Views
Go to first new post S> 40 month main w/Lab,...
Yesterday 02:56 PM
Last post by Bex
Today 05:57 AM
5 Replies, 34 Views
View Single Post

 
Old 06-25-2008, 08:20 PM   #8 (permalink)
Violent_J
Site Programmer

Male Violent_J is offline
 
Violent_J's Avatar
 
Join Date: Nov 2006
Location: Sacramento, California
Age: 17
Posts: 937
GPoints: 752
iTrader: 5 / 100%
Violent_J Is Amongst RoyaltyViolent_J Is Amongst Royalty
Rep Power: 9
Quote:
Originally Posted by aggieman122 View Post
why cant people play by the rulez. youre makin it harder on the fair people
Then why the fuck are you on a cheating forum? xD

I made a minimize to tray tut
works for me

Note: This is NOT my source code. I only edited it...
OK, when I was first programming I tried minimize to tray. It didn't work because I kept on getting ambiguous file detected or some shit like that. This means 2 things are declared with the same name I think.
Now, minimize to tray and HTTPwrapper declared the same name.
So I changed the minimize to tray to say 2 for everything and got it to work

here is the tut

First, you will need
1 command button called cmdmin
The module I will give the source to

Now add a new module
Put this in the MODULES source
Code:
Code:
      Public Type NOTIFYICONDATA2
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Public Const NIM_ADD2 = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE2 = &H2
Public Const WM_MOUSEMOVE2 = &H200
Public Const NIF_MESSAGE2 = &H1
Public Const NIF_ICON2 = &H2
Public Const NIF_TIP2 = &H4
Public Const WM_LBUTTONDBLCLK2 = &H203
Public Const WM_LBUTTONDOWN2 = &H201
Public Const WM_LBUTTONUP2 = &H202
Public Const WM_RBUTTONDBLCLK2 = &H206
Public Const WM_RBUTTONDOWN2 = &H204
Public Const WM_RBUTTONUP2 = &H205
Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA2) As Boolean
Then, declare this at the very top of your code
Code:
Code:
      Dim nid As NOTIFYICONDATA2
lol...remember that I changed the code to have 2 so it is not the same name as the wrapper lol
next add this
Code:
Code:
      Sub minimize_to_tray()
Me.Hide
nid.cbSize = Len(nid)
nid.hwnd = Me.hwnd
nid.uId = vbNull
nid.uFlags = NIF_ICON2 Or NIF_TIP2 Or NIF_MESSAGE2
nid.uCallBackMessage = WM_MOUSEMOVE2
nid.hIcon = Me.Icon 
nid.szTip = "Violent_J's alarm Clock" & vbNullChar
Shell_NotifyIcon NIM_ADD2, nid
End Sub
The nidsztip will be showed when you hoverover the Icon. For now, it will say "Violent_J's alarm clock" until you change it to th name of your own program!
Now, add this code
Code:
Code:
      Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim msg As Long
Dim sFilter As String
msg = x / Screen.TwipsPerPixelX
Select Case msg
Case WM_LBUTTONDOWN2
Me.Show ' show form
Shell_NotifyIcon NIM_DELETE2, nid ' del tray icon
Case WM_LBUTTONUP2
Case WM_LBUTTONDBLCLK2
Case WM_RBUTTONDOWN2
Case WM_RBUTTONUP2
Me.Show
Shell_NotifyIcon NIM_DELETE2, nid
Case WM_RBUTTONDBLCLK2
End Select
End Sub
This is the mouse move and shiz
Now add the command button that will minimize it to tray

Code:
      Private sub cmdmin_click()
minimize_to_tray
end sub
EDIT:

You must also add



Code:
             Shell_NotifyIcon NIM_DELETE, nid
In your form unload cancel as integer code

here is mine for you to use



Code:
           Private Sub Form_Unload(Cancel As Integer)
  Shell_NotifyIcon NIM_DELETE, nid ' del tray icon
    Dim frmTemp As Form
    For Each frmTemp In Forms
        Unload frmTemp
        Set frmTemp = Nothing
    Next
    End
End Sub
Enjoy minimize to tray in your programs
__________________



Current rep: 111
  Reply With Quote
 
Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 06:19 AM.


vBulletin skin developed by: eXtremepixels
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.13357997 seconds (100.00% PHP - 0% MySQL) with 18 queries