Results 1 to 5 of 5

Thread: vb closes? :o - This be resolved.... kinda -

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Colonel Klink's Avatar
    Join Date
    Aug 2002
    Location
    Gold Coast, Australia
    Posts
    329

    vb closes? :o - This be resolved.... kinda -

    in a module i have:

    VB Code:
    1. Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
    2.     (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    3. Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
    4.     (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, _
    5.     ByVal wParam As Long, ByVal lParam As Long) As Long
    6. Public Const GWL_WNDPROC = -4
    7. Public Const WM_RBUTTONUP = &H205
    8. Public lpPrevWndProc As Long
    9.  
    10. Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, _
    11.                     ByVal lParam As Long) As Long
    12.     Select Case uMsg
    13.         Case WM_RBUTTONUP
    14.             PopupMenu mnuSticky
    15.         Case Else
    16.             WindowProc = CallWindowProc(lpPrevWndProc, hwnd, _
    17.             uMsg, wParam, lParam)
    18.     End Select
    19. End Function
    20.  
    21. Public Sub Hook(hwnd As Long)
    22.     lngHWnd = hwnd
    23.     lpPrevWndProc = SetWindowLong(lngHWnd, GWL_WNDPROC, AddressOf WindowProc)
    24. End Sub
    25.  
    26. Public Sub UnHook()
    27.     Dim lngReturnValue As Long
    28.     lngReturnValue = SetWindowLong(lngHWnd, GWL_WNDPROC, lpPrevWndProc)
    29. End Sub

    and in the form i have:

    VB Code:
    1. Private Sub Form_Load()
    2.     Hook (txtSticky.hwnd)
    3. End Sub
    4.  
    5. Private Sub Form_Unload(Cancel As Integer)
    6.     UnHook
    7. End Sub

    what its sposed to do is take the system right click menu, with copy and past etc, and replace it with my own

    now, when i goto run this, as soon as i press the play button, VB exits

    any idea on how to fix?
    Last edited by Colonel Klink; Apr 15th, 2003 at 12:22 AM.
    Our Father, who 0wnz heaven, j00 r0ck!
    May all 0ur base someday be belong to you!
    May j00 0wn earth just like j00 0wn heaven.
    Give us this day our warez, mp3z, and pr0n through a phat pipe.
    And cut us some slack when we act like n00b lamerz, just as we teach n00bz when they act lame on us.
    Please don't give us root access on some poor d00d'z box when we're too pissed off to think about what's right and wrong, and if you could keep the fbi off our backs, we'd appreciate it.
    For j00 0wn r00t on all our b0x3s 4ever and ever, 4m3n.

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