|
-
Aug 20th, 2001, 05:09 AM
#1
Thread Starter
Addicted Member
GetMessage...
Hiyas,
I've tried to write code to intercept messages from Notepad. However, when I have Notepad open and I call the GetMessage routine, VB totally freezes. I can't break it, so I have to Crtl-Alt-Del it. Any idea what's wrong and how to fix it? Here's the code.
Code:
Option Explicit
Dim Message As Msg
Dim nphwnd As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetMessage Lib "user32" Alias "GetMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Sub Form_Load()
nphwnd = FindWindow(vbNullString, "Untitled - Notepad")
GetMessage Message, nphwnd, 0, 0
End Sub
Thanks,
-Git
-
Aug 20th, 2001, 05:51 AM
#2
Hyperactive Member
git, i will dig out the code for this later today, if i have time.
td.
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Aug 20th, 2001, 06:28 AM
#3
Thread Starter
Addicted Member
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
|