|
-
May 4th, 2000, 04:52 AM
#1
Thread Starter
PowerPoster
Uhm, what about the SendMessageTimeout function?
I tried to figure out how it works, but I couldn't found anything... I tried this code, but it seems to have wrong parameters or something...
Code:
Function HungUp(iProcess As ProcessEntry32) As Boolean
Dim Temp As Long
Dim Process As Long
Process = OpenProcess(PROCESS_TERMINATE, 0, iProcess.ProcessID)
Temp = SendMessageTimeout(Process, WM_NULL, 0, 0,_
SMTO_NORMAL Or SMTO_ABORTIFHUNG Or SMTO_BLOCK, 1000, Temp)
If Temp = 0 Then
HungUp = True
End If
End Function
I think WM_NULL is not that good, but I have no idea what to use else... anyone knows?
Thanks in advance!
-
May 4th, 2000, 07:11 AM
#2
Frenzied Member
OK, yer big mistake is that where the procedure expects an hWnd you've given it a process handle.(first parameter)
the first four params are the parameters you normaly use for sendmessage, the fith is reserved for flags, you can probably get away with setting it to 0, the last parameter is how long the function should waid before it returns, if the message is not processed after this time the function returns 0.
WM_NULL always returns Zero. I can't offhand think of any message that will never return 0. but there must be a message you're trying to get to work, use that to test it.
-
May 4th, 2000, 12:04 PM
#3
Thread Starter
PowerPoster
Well, I tried it with the hWnd, didn't work so I tried the process 
However, thx for your time, I'll play around with it
-
May 7th, 2000, 11:06 PM
#4
Thread Starter
PowerPoster
no no...
I'd say it's the same as I tried, especially the function. My mistake was to take the process instead of the window handle 
Thx anyway...
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
|