|
||||
GetBkColorCategory: DeviceHits: 3723 Rating: (2.66) votes 1653
Rate: 1-star 2-stars 3-stars 4-stars 5-stars
API Explanation
The GetBkColor function returns the current background color for the specified device context. Parameter Information Declare Function GetBkColor Lib "gdi32" Alias "GetBkColor" (ByVal hdc As Long) As Long · hdc Identifies the device context whose background color is to be returned. If the function succeeds, the return value is a COLORREF value for the current background color. If the function fails, the return value is CLR_INVALID.
Code
'In general section
Private Declare Function GetBkColor Lib "gdi32" (ByVal hDC As Long) As Long Private Sub Timer1_Timer() 'Set the Form's backcolor Me.BackColor = RGB(Int(Rnd*255), Int(Rnd*255), Int(Rnd*255)) 'Get the backcolor MsgBox "My backcolor is:" + Str$(GetBkColor(Me.hDC)) End Sub |