Mirage Source http://www.miragesource.net/forums/ |
|
Server System Tray Support http://www.miragesource.net/forums/viewtopic.php?f=210&t=463 |
Page 1 of 1 |
Author: | Tutorial Bot [ Sat Sep 02, 2006 10:13 pm ] |
Post subject: | Server System Tray Support |
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: 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) Add this in Sub DestroyServer, a few lines below "Dim I": 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) Now, in frmServer add this code: 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 That's all! |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |