Himatika Perbanas
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Tempat ngumpulnya anak Himatika Perbanas
 
IndeksPortailLatest imagesPencarianPendaftaranLogin

 

 Me lihat status memory

Go down 
PengirimMessage
yadoy666
Script Learner
Script Learner
yadoy666


Jumlah posting : 121
Registration date : 20.09.07

Me lihat status memory Empty
PostSubyek: Me lihat status memory   Me lihat status memory EmptySun 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
http://yadoy666.blogspot.com
 
Me lihat status memory
Kembali Ke Atas 
Halaman 1 dari 1
 Similar topics
-
» Online Status
» YM Status Checker

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