home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / ProjectX1_562922192002.psc / ModulesCode / modCodeX5.bas < prev    next >
Encoding:
BASIC Source File  |  1997-02-19  |  1.6 KB  |  65 lines

  1. Attribute VB_Name = "modCodeX5"
  2.  
  3. 'In general section
  4. Private Type RECT
  5.     Left As Long
  6.     Top As Long
  7.     Right As Long
  8.     Bottom As Long
  9. End Type
  10. Private Type POINTAPI
  11.     X As Long
  12.     Y As Long
  13. End Type
  14.  
  15. 'Declare the API-Functions
  16. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  17. Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
  18. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  19. Public Function IsOnPic(PControl As PictureBox) As Boolean
  20. '-----------------------------------
  21. '-    IsOnPic()
  22. '-
  23. '- It'll return true if mouse going over picbox
  24. '-
  25. '-     By T-Virus Creations
  26. '- http://www.tvirusonline.be
  27. '- email: tvirus4ever@yahoo.co.uk
  28. '-
  29. '-----------------------------------
  30.  
  31.     Dim Rec As RECT, Point As POINTAPI
  32.     GetWindowRect PControl.hwnd, Rec
  33.     GetCursorPos Point
  34.     
  35. If Point.X < Rec.Left Or Point.X > Rec.Right Or Point.Y < Rec.Top Or Point.Y > Rec.Bottom Then
  36.     IsOnPic = False
  37.     Exit Function
  38. End If
  39.  
  40.     IsOnPic = True
  41. End Function
  42.  
  43.  
  44.  
  45.  
  46. Public Function IsInIDE() As Boolean
  47. '-----------------------------------
  48. '-    IsInIDE()
  49. '-
  50. '- It'll return true if running in IDE
  51. '-
  52. '-     By T-Virus Creations
  53. '- http://www.tvirusonline.be
  54. '- email: tvirus4ever@yahoo.co.uk
  55. '-
  56. '-----------------------------------
  57. '-TESTED: In VB6.0 SP5
  58. '-----------------------------------
  59. Dim X As Long
  60. On Error Resume Next
  61. X = VB.App.LogMode()
  62. If X = 1 Then IsInIDE = False Else IsInIDE = True
  63. End Function
  64.  
  65.