02-09-2006, 10:13 PM
Author: Magnus
Difficulty: 1/5
:: SERVER SIDE ::
First, add the existing module "modSysTray" (it's in the server folder) to your project.
Now, in Sub InitServer, a few lines below "Randomize Timer" add the following:Add this in Sub DestroyServer, a few lines below "Dim I":Now, in frmServer add this code:That's all!
Difficulty: 1/5
:: SERVER SIDE ::
First, add the existing module "modSysTray" (it's in the server folder) to your project.
Now, in Sub InitServer, a few lines below "Randomize Timer" add the following:
Code:
nid.cbSize = Len(nid)
nid.hWnd = frmServer.hWnd
nid.uId = vbNull
nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
nid.uCallBackMessage = WM_MOUSEMOVE
nid.hIcon = frmServer.Icon
nid.szTip = "Server" & vbNullChar 'You can add your game name or something.
' Add to the sys tray
Call Shell_NotifyIcon(NIM_ADD, nid)
Code:
nid.cbSize = Len(nid)
nid.hWnd = frmServer.hWnd
nid.uId = vbNull
nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
nid.uCallBackMessage = WM_MOUSEMOVE
nid.hIcon = frmServer.Icon
nid.szTip = "Server" & vbNullChar
' Add to the sys tray
Call Shell_NotifyIcon(NIM_DELETE, nid)
Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lmsg As Long
lmsg = x / Screen.TwipsPerPixelX
Select Case lmsg
Case WM_LBUTTONDBLCLK
frmServer.WindowState = vbNormal
frmServer.Show
End Select
End Sub