home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / A_great_ne2080298212007.psc / Form1.frm < prev    next >
Text File  |  2007-08-20  |  2KB  |  61 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "With this trick"
  6.    ClientHeight    =   4860
  7.    ClientLeft      =   1440
  8.    ClientTop       =   1545
  9.    ClientWidth     =   11220
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4860
  14.    ScaleWidth      =   11220
  15.    Begin VB.Timer Timer1 
  16.       Interval        =   15
  17.       Left            =   5040
  18.       Top             =   840
  19.    End
  20.    Begin VB.Image Image1 
  21.       Height          =   2295
  22.       Left            =   1200
  23.       Picture         =   "Form1.frx":0000
  24.       Top             =   1200
  25.       Width           =   8130
  26.    End
  27. End
  28. Attribute VB_Name = "Form1"
  29. Attribute VB_GlobalNameSpace = False
  30. Attribute VB_Creatable = False
  31. Attribute VB_PredeclaredId = True
  32. Attribute VB_Exposed = False
  33. Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
  34. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
  35. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  36. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  37. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  38. Private Type POINTAPI
  39.         X As Long
  40.         Y As Long
  41. End Type
  42.  
  43.  
  44. Dim a As Single
  45.  
  46. Private Sub Form_Load()
  47. SetWindowPos Me.hwnd, -1, 100, 100, Form1.Width * 0.06, Form1.Height * 0.06, 0
  48. Ret = GetWindowLong(Me.hwnd, -20)
  49. Ret = Ret Or &H80000
  50. SetWindowLong Me.hwnd, -20, Ret
  51. SetLayeredWindowAttributes Me.hwnd, vbBlack, 255, &H2
  52. End Sub
  53.  
  54. Private Sub Timer1_Timer()
  55. a = a + 0.1
  56. Image1.Left = Cos(a) * 1000 + 1000
  57. Image1.Top = Sin(a) * 1000 + 1000
  58. If a >= 6 Then a = 0: Form1.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
  59. End Sub
  60.  
  61.