Wierd Sreen Effect
Vote please. Ok, It takes a screenshot (see screenshot lol) of the screen(using its Hdc) and paints it on the form using BitBlt. If you change the forms forecolor then it looks really cool, in the code it sets it to vbblue, to make it look just like the desktop use vbwhite, it looks really cool with colors like vbyellow and vbred and you could use RGB(Red,Green,Blue)
Have fun ;)
Original Author: Coding Genius
Inputs
ADD A FORM: NAME = FORM1, BORDERSTYLE = 0-NONE, WINDOWSTATE = VBMAXIMIZED
Returns
A wierd screen: To get out just press a button on the keyboard
API Declarations
Public Declare Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal dwRop As Long) As Long
Declare Function ReleaseDC Lib "USER32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Declare Function GetDC Lib "USER32" (ByVal hWnd As Long) As Long
Declare Function GetDesktopWindow Lib "USER32" () As Long
Private Declare Function ReleaseCapture Lib "USER32" () As Long
Code
'IN A MODULE
Public Declare Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal dwRop As Long) As Long
Declare Function ReleaseDC Lib "USER32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Declare Function GetDC Lib "USER32" (ByVal hWnd As Long) As Long
Declare Function GetDesktopWindow Lib "USER32" () As Long
Public Const SRCCOPY = &HCC0020
Private Declare Function ReleaseCapture Lib "USER32" () As Long
Public Const BLACKNESS = &H42
Public Const DSTINVERT = &H550009
Public Const MERGECOPY = &HC000CA
Public Const MERGEPAINT = &HBB0226
Public Const NOTSRCCOPY = &H330008
Public Const NOTSRCERASE = &H1100A6
Public Const PATCOPY = &HF00021
Public Const PATINVERT = &H5A0049
Public Const PATPAINT = &HFB0A09
Public Const SRCAND = &H8800C6
Public Const SRCERASE = &H440328
Public Const SRCINVERT = &H660046
Public Const SRCPAINT = &HEE0086
Public Const WHITENESS = &HFF0062
Public Function GetDesktop()
Dim HW As Long
Dim HA As Long
Dim iLeft As Integer
Dim iTop As Integer
Dim iWidth As Integer
Dim iHeight As Integer
Form1.AutoRedraw = True
Form1.Hide
DoEvents
HW = GetDesktopWindow()
HA = GetDC(HW)
iLeft = Form1.Left / Screen.TwipsPerPixelX
iTop = Form1.Top / Screen.TwipsPerPixelY
iWidth = Form1.ScaleWidth
iHeight = Form1.ScaleHeight
Call BitBlt(Form1.hdc, 0, 0, iWidth, iHeight, HA, iLeft, iTop, SRCCOPY)
Form1.Picture = Form1.Image
Form1.Show
Call ReleaseDC(HW, HA)
Form1.DrawMode = 9
Form1.ForeColor = RGB(0, 0, 255)
Form1.Line (0, 0)-(iWidth, iHeight), , BF
End Function
'IN A FORM CODE WINDOW
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
End
End Sub
Private Sub Form_Load()
Form1.Show
Call GetDesktop
End Sub
'THATS IT HAVE FUN :))
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.