How make prg on resident memory 
Author Message
 How make prg on resident memory

Hi

i want make resident memory prg on vb.
I want see icon program  just after the clock on task bar,
i don't want see icon program just standard program in memory on task bar

can you help me !

thank's in advance

Daniel

PS. excuse my english but i'm french speaking....



Mon, 26 Feb 2001 03:00:00 GMT  
 How make prg on resident memory
    Ok... u need something like this

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

Public Const NIM_ADD = 0
Public Const NIM_MODIFY = 1
Public Const NIM_DELETE = 2
Public Const NIF_MESSAGE = 1
Public Const NIF_ICON = 2
Public Const NIF_TIP = 4

Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_RBUTTONDBLCLK = &H206
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_MOUSEMOVE = &H200
Public Const WM_NULL = &H0

Declare Function Shell_NotifyIconA Lib "shell32" _(ByVal dwMessage As Long,
lpData As NOTIFYICONDATA) As Integer

Declare Function PostMessage Lib "user32" _ Alias "PostMessageA" (ByVal hwnd
As Long, ByVal wMsg As Long, _ ByVal wParam As Long, ByVal lParam As Long)
As Long

thoose r functions that u use for putting icon on tray...

and here is code for your program to work
Private Sub Form_Load()
  Dim nd As NOTIFYICONDATA
  Dim lRet As Long
  With nd
    .cbSize = Len(nd)
    .hwnd = picHook.hwnd
    .uID = 1&
    .szTip = "This is my first TrayIcon" & Chr(0)
    .uCallbackMessage = WM_MOUSEMOVE
    .hIcon = Me.Icon
    .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
  End With
  lRet = Shell_NotifyIconA(NIM_ADD, nd)
  'Error check here
  'lRet = PostMessage(mnuPophwnd, WM_NULL, 0&, 0&) 'hrmf
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Dim nd As NOTIFYICONDATA
  Dim iRet As Integer
  With nd
    .cbSize = Len(nd)
    .hwnd = picHook.hwnd
    .uID = 1&
  End With
  iRet = Shell_NotifyIconA(NIM_DELETE, nd)
End Sub

Private Sub mnuQuit_Click(Index As Integer)
  Unload Me
End Sub

Private Sub picHook_MouseMove(Button As Integer, Shift As Integer, _
    X As Single, Y As Single)
  Static bRunning As Boolean
  Dim lMsg As Long
  lMsg = X / Screen.TwipsPerPixelX
  If Not (bRunning) Then 'avoid cascades
    bRunning = True
    Select Case lMsg
      Case WM_LBUTTONDBLCLK:
        MsgBox "You double-clicked"
      Case WM_LBUTTONDOWN:
      Case WM_LBUTTONUP:
      Case WM_RBUTTONDBLCLK:
      Case WM_RBUTTONDOWN:
      Case WM_RBUTTONUP:
        Me.PopupMenu mnuPop
        End Select
        bRunning = False
    End If
End Sub

OK?
If u don't understand something ask...



Tue, 27 Feb 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How make prg on resident memory

2. How make prg on resident memory

3. Making a VB Memory Resident Program?

4. Memory Resident Applications

5. Memory Resident

6. Calling memory-resident procedures

7. Memory Resident (2nd Post)

8. Memory Resident QB

9. memory resident database

10. How PROGRAMMATICALLY ShutDown a memory resident program ?

11. memory resident program

12. Memory Resident Applications

 

 
Powered by phpBB® Forum Software