Important! My findings concerning PtInRect() 
Author Message
 Important! My findings concerning PtInRect()

In case anyone wasn't following the original thread, there are some concerns
about using PtInRect in VB programs.

First and foremost, the declaration from APIViewer will not work.  Change it
to:

Public Declare Function PtInRect Lib "user32" (lpRect As RECT, ByVal X As
Long, ByVal Y As Long) As Boolean

You can still use the POINTAPI structure to get the point coordinates, or
use ClientToScreen() to convert them, but when you call PtInRect() you must
pass the coordinates separately.

Next, the return value is not restricted to 0 or -1.  When using the Not
operator, values have to be either 0 or -1 in order to get the desired
result, so tests such as:
    If Not PtInRect() Then
        ...
    End If

will return True all the time, and thus should not be used.



Sat, 16 Dec 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. FutureBASIC: FN PTINRECT

2. PtInRect always returns false...

3. PtInRect "Bad DLL calling convension"

4. Can I use PtInRect() from VB?

5. PtInRect() API Run-Time Error

6. API PtInRect under VB4

7. PtInRect from VB ?

8. PtInRect function WIN32API from VBasic

9. PtInRect

10. PtInRect causes Bad DLL calling convention

11. PtInRect headache

12. PtInRect API - Something is wrong ?

 

 
Powered by phpBB® Forum Software