|
-
Apr 14th, 2003, 11:41 PM
#1
Thread Starter
Hyperactive Member
vb closes? :o - This be resolved.... kinda -
in a module i have:
VB Code:
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const GWL_WNDPROC = -4
Public Const WM_RBUTTONUP = &H205
Public lpPrevWndProc As Long
Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
Select Case uMsg
Case WM_RBUTTONUP
PopupMenu mnuSticky
Case Else
WindowProc = CallWindowProc(lpPrevWndProc, hwnd, _
uMsg, wParam, lParam)
End Select
End Function
Public Sub Hook(hwnd As Long)
lngHWnd = hwnd
lpPrevWndProc = SetWindowLong(lngHWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
Public Sub UnHook()
Dim lngReturnValue As Long
lngReturnValue = SetWindowLong(lngHWnd, GWL_WNDPROC, lpPrevWndProc)
End Sub
and in the form i have:
VB Code:
Private Sub Form_Load()
Hook (txtSticky.hwnd)
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnHook
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|