Results 1 to 8 of 8

Thread: Weird Stuff - Backward form

  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.

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Weird Stuff - Backward form

    Both interessting and useful. I simply cannot wait until my boss asks me to create one of these 2 things at work and I'll be able to answer instantly with a confident retort.
    I don't live here any more.

  3. #3
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Weird Stuff - Backward form

    I clicked it and it still selects my browser window.

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Weird Stuff - Backward form

    does the Backward form thing works on Win 98?
    Show Appreciation. Rate Posts.

  5. #5

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

    Re: Weird Stuff - Backward form

    Quote Originally Posted by wossname
    Both interessting and useful. I simply cannot wait until my boss asks me to create one of these 2 things at work and I'll be able to answer instantly with a confident retort.
    Do i detect a hint of sarcasm?

    Quote Originally Posted by Harsh Gupta
    does the Backward form thing works on Win 98?
    I have no idea. I only have access to XP and ME.

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Re: Weird Stuff - Backward form

    Sometimes I wish I was inside-out boy.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7

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

    Re: Weird Stuff - Backward form


  8. #8
    Hyperactive Member Rattled_Cage's Avatar
    Join Date
    Dec 2005
    Posts
    315

    Re: Weird Stuff - Backward form

    i compile it and i made a form backwards that i can drag icons though
    Attached Images Attached Images  

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