Tempat ngumpulnya anak Himatika Perbanas
 
IndeksPortailCalendarFAQAnggotaGroupPencarianPendaftaranLogin

Share | 
 

 Me lihat status memory

Topik sebelumnya Topik selanjutnya Go down 
PengirimMessage
yadoy666
Script Learner
Script Learner


Jumlah posting : 121
Registration date : 20.09.07

PostSubyek: Me lihat status memory   Sun Sep 23, 2007 1:20 pm

Disini kita membutuhkan 1 form dan satu timer. pad timer di set intervalnya jadi 200.. lalu pastekan kod berikut ini pada form....

===============[Start Copy here ]==================
Option Explicit

Const SR = 0
Const GDI = 1
Const USR = 2
Const VER_PLATFORM_WIN32s = 0
Const VER_PLATFORM_WIN32_WINDOWS = 1
Const VER_PLATFORM_WIN32_NT = 2

Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type

Private Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type


Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)

Private Declare Function pBGetFreeSystemResources Lib "rsrc32.dll" _
Alias "_MyGetFreeSystemResources32@4" (ByVal iResType As Integer) As Integer

Private Declare Function GetVersionEx Lib "kernel32" _
Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long




Private Sub Timer1_Timer()
Dim MS As MEMORYSTATUS
Dim OSInfo As OSVERSIONINFO

Me.Caption = "Memory Statistics/System Resources"

MS.dwLength = Len(MS)
Call GlobalMemoryStatus(MS)
With MS
lbl(0) = Format$(.dwTotalPhys / 1024, "#,###.##")
lbl(1) = Format$(.dwAvailPhys / 1024, "#,###.##")
lbl(2) = Format$(.dwTotalVirtual / 1024, "#,###.##")
lbl(3) = Format$(.dwAvailVirtual / 1024, "#,###.##")
lbl(4) = Format$(.dwTotalPageFile / 1024, "#,###.##")
lbl(5) = Format$(.dwAvailPageFile / 1024, "#,###.##")
lbl(6) = Format$(.dwMemoryLoad, "##0.00") & " %"
End With

OSInfo.dwOSVersionInfoSize = Len(OSInfo)
Call GetVersionEx(OSInfo)
If OSInfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then
lblUser = CStr(pBGetFreeSystemResources(USR))
lblSystem = CStr(pBGetFreeSystemResources(SR))
lblGDI = CStr(pBGetFreeSystemResources(GDI))
Else
lblUser = "N/A"
lblSystem = "N/A"
lblGDI = "N/A"
End If

End Sub


================== [ stop Copy Here]=================
Kembali Ke Atas Go down
Lihat profil user http://yadoy666.blogspot.com
 
Me lihat status memory
Topik sebelumnya Topik selanjutnya Kembali Ke Atas 
Halaman 1 dari 1
 Similar topics
-
» Update Status Facebook via Blueberry, Telepon Umum, Wartel, Kantor Pos, HP Pinjaman, Warnet, Hati
» Arti Cinta
» Tukeran No HP yuk...
» singkat,padat,dan jelas.....
» YoYo

Permissions in this forum:Anda tidak dapat menjawab topik
Himatika Perbanas :: Interaksi Forum Pilihan :: Forum Membahas Semua Jenis Programming-
Navigasi: