-
It you have used the "ie super label" and set is to transparent you notice a bug that copys the screen before you run your program and dosn't refresh afterwards. So you can create some kick ass screen savers (or anything of a likeness) from exploing the bug. the only problem is that the bug is very buggy and crashes on 75% of computers 3 out of 4 times :) so if anyone knows of a thing like this that isn't as crash happy please let me know.
-
I don't know the "ie super label" , but I use the following code to copy the screen.
First set your apps startup property to Sub Main and set your forms borderstyle to none.
Add a standard module with this code:
Code:
Option Explicit
Private Declare Function GetWindowDC Lib "user32" (ByVal Hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal Hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDCDest As Long, ByVal XDest As Long, ByVal YDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hDCSrc As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Sub Main()
Load Form1
Form1.AutoRedraw = True
Call CopyScreen(Form1)
Form1.Show
End Sub
Public Sub CopyScreen(DestForm As Form)
Dim retVal As Long
Dim hWndDesk As Long
Dim hDCDesk As Long
Dim WidthDesk As Long
Dim HeightDesk As Long
'define the screen coordinates (upper
'corner (0,0) and lower corner (Width, Height)
WidthDesk = Screen.Width \ Screen.TwipsPerPixelX
HeightDesk = Screen.Height \ Screen.TwipsPerPixelY
'get the desktop handle and device context
hWndDesk = GetDesktopWindow()
hDCDesk = GetWindowDC(hWndDesk)
'copy the desktop to the form
retVal = BitBlt(DestForm.hdc, 0, 0, WidthDesk, HeightDesk, hDCDesk, 0, 0, vbSrcCopy)
retVal = ReleaseDC(hWndDesk, hDCDesk)
End Sub
And add the following code to your forms module
Code:
Option Explicit
Private Sub Form_Load()
Me.Top = 0
Me.Left = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub
Private Sub Form_DblClick()
Unload Me
End Sub
-
Thanks for the code...
It is kind of like this... the screen cap part. But after the screen cap the form dosen't refresh (only the mouse dose) so if you move a windows over the form you'd get 100 copys of what the form looked like (depens on hwo fast you move the window over the form.) see if you can find the ielabel.ocx,when loaded in vb it's called ie super label. Comes with IE4 i think or just go to microsoft's site and download it.