How make prg on resident memory

How make prg on resident memory

Post by Daniel Leblan » Fri, 11 Sep 1998 04:00:00



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....

 
 
 

How make prg on resident memory

Post by BlackMa » Sat, 12 Sep 1998 04:00:00


    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...

 
 
 

1. Making Tables Memory Resident

I'm working on a system that will have very high transaction loads (upwards
of 300 transactions per second).  I have two questions associated with this
development.

1.)  Can SQL Server 7.0 handles that kind of load

2.)  Can I make certain tables in SQL Server 7.0 memory resident to reduce
seek time?  What are the pro's and con's of this method?

Dylan

2. Help on how to add an image to table

3. Can postgresql be run in memory (like a memory resident

4. Passing Recordset to sp

5. Can postgresql be run in memory (like a memory resident program)

6. Scripting?

7. Resident Memory

8. ADO datashape and memory resident record set

9. Side Effects of Setting Tables Memory Resident

10. Looking for best performance single-user memory-resident ISAM

11. memory resident table

12. how to caculate resident shared memory size?