Results 1 to 8 of 8

Thread: Weird Stuff - Backward form

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Weird Stuff - Backward form

    I was playing around with APIs today, and i stumbed upon code to switch the form backward so the close buttons is on the left no the right. Also i managed to create a see through form that doesn't recieve any input, so you click on the form and it will select what is behind the form.

    So i was wondering if there are any other wierd stuff like this out there.
    1. backward form
    VB Code:
    1. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    2. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    3. Const GWL_EXSTYLE = (-20)
    4. Const WS_EX_LAYERED = &H80000
    5.  
    6. Private Sub Form_Load()
    7. Dim ret As Long
    8. ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
    9. ret = ret Or -WS_EX_LAYERED
    10. SetWindowLong Me.hwnd, GWL_EXSTYLE, ret
    11. End Sub

    2. see through unselectable form
    VB Code:
    1. Const LWA_COLORKEY = &H1
    2. Const LWA_ALPHA = &H2
    3. Const GWL_EXSTYLE = (-20)
    4. Const WS_EX_LAYERED = &H80000
    5. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    6. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    7. Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
    8. Private Sub changeWindow()
    9.     Dim ret As Long
    10.     ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
    11.     ret = ret Or WS_EX_LAYERED
    12.     SetWindowLong Me.hWnd, GWL_EXSTYLE, ret
    13.     SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA
    14.    
    15.     ret = ret Or Not WS_EX_LAYERED
    16.     SetWindowLong Me.hWnd, GWL_EXSTYLE, ret
    17. End Sub
    18.  
    19. Private Sub Form_Load()
    20. changeWindow
    21. End Sub
    Attached Images Attached Images  
    Last edited by Andrew G; Dec 28th, 2005 at 07:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width