volevo chiedervi perchè secondo voi questo semplice programma usa 20 megabyte di memoria ram:
c'è un modo per ridurre l'uso della memoria?codice:Module Module1 Friend WithEvents nfiIcona As NotifyIcon Friend WithEvents ctlTimer As Timer Private ProcO() As Process, i As Long Private Sub Init() nfiIcona = New NotifyIcon() nfiIcona.Icon = My.Resources.trusted nfiIcona.Text = "Outlook Viewer Process" ctlTimer = New Timer ctlTimer.Interval = 1000 ctlTimer.Start() End Sub Sub Main() AddHandler Application.ApplicationExit, AddressOf OnApplicationExit ProcO = Process.GetProcessesByName("Outlook") Init() nfiIcona.Visible = True Application.Run() End Sub Private Sub OnApplicationExit(ByVal sender As Object, ByVal e As System.EventArgs) ctlTimer = Nothing ProcO = Nothing If nfiIcona.Visible = True Then nfiIcona.Visible = False nfiIcona = Nothing End Sub Private Sub ctlTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ctlTimer.Tick ProcO = Process.GetProcessesByName("Outlook") If ProcO.Length = 0 Then Application.Exit() For i = 0 To ProcO.Length - 1 If ProcO(i).Responding = False Then ProcO(i).Kill() ProcO(i).Refresh() ProcO(i).Dispose() Next End Sub End Module

Rispondi quotando


