02 May 2013

Mengetahui Ukuran Screen Yang Sebenarnya

Untuk mengetahui ukuran screen atau disebut layar komputer yang sebenarnya (dikurangi tinggi layar) adalah dengan cara sebagai berikut .



Option Explicit

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long

Public Function ScreenWidth() As Single
    Dim R As RECT
    GetWindowRect GetDesktopWindow(), R
    ScreenWidth = R.Right * Screen.TwipsPerPixelX
End Function

Public Function ScreenHeight() As Single
    Dim R As RECT
    GetWindowRect GetDesktopWindow(), R
    ScreenHeight = R.Bottom * Screen.TwipsPerPixelY
End Function


Semoga bermanfaat -_-

1 comment:

  1. See Role Designs Movie On the net - With permission Possible?


    Here is my homepage; juggle

    ReplyDelete

Recent Comment

Contact Form

Name

Email *

Message *

2012 © Jabat Software