VBA/Excel/Access/Word/Windows API/SYSTEM INFO

Материал из VB Эксперт
Перейти к: навигация, поиск

Is mouse installed by using SYSTEM_INFO

 
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
Type SYSTEM_INFO
   dwOemID As Long
   dwPageSize As Long
   lpMinimumApplicationAddress As Long
   lpMaximumApplicationAddress As Long
   dwActiveProcessorMask As Long
   dwNumberOrfProcessors As Long
   dwProcessorType As Long
   dwAllocationGranularity As Long
   dwReserved As Long
End Type
Declare Function abGetSystemMetrics Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Sub GetSysInfo()
    Dim intMousePresent As Integer
    Dim strBuffer As String
    Dim intLen As Integer
    Dim MS As MEMORYSTATUS
    Dim SI As SYSTEM_INFO
    Dim strCommandLine As String
    txtScreenResolution = abGetSystemMetrics(SM_CXSCREEN) & " By " & abGetSystemMetrics(SM_CYSCREEN)
    intMousePresent = CBool(abGetSystemMetrics(SM_MOUSEPRESENT))
    MsgBox IIf(intMousePresent, "Mouse Present", "No Mouse Present")
End Sub