home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD78957182000.psc / modTransRegion.bas < prev    next >
Encoding:
BASIC Source File  |  2000-07-18  |  2.7 KB  |  68 lines

  1. Attribute VB_Name = "modTransRegion"
  2. 'The code for the TransRegion.dll is modified from code by Chris Yates.  however, I will release it later on C/C++ of Planet
  3. 'Source Code.  However, in the meantime you may use the DLL with no warranty whatsoever and without any royalty fees
  4.  
  5. Declare Sub MakeTransparent Lib "TransRegion.dll" (ByVal WinHandle As Long, ByVal SrcHandle As Long, ByVal Red As Integer, ByVal Blue As Integer, ByVal Green As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal dat As Integer)
  6.  
  7. Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
  8. Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
  9. Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
  10. Declare Function GetParent Lib "User32" (ByVal hwnd As Long) As Long
  11. Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
  12.  
  13. 'For moving the Mouse
  14. Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  15. Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As RECT) As Long
  16.  
  17.  
  18. 'For the Window
  19. '--------------
  20. 'Put the window at the bottom of the Z-order.
  21. Public Const HWND_BOTTOM = 1
  22. 'Put the window below all topmost windows and above all non-topmost windows.
  23. Public Const HWND_NOTOPMOST = -2
  24. 'Put the window at the top of the Z-order.
  25. Public Const HWND_TOP = 0
  26. 'Make the window topmost (above all other windows) permanently.
  27. Public Const HWND_TOPMOST = -1
  28.  
  29. 'For the Flags
  30. '--------------
  31. 'Same as SWP_FRAMECHANGED.
  32. Public Const SWP_DRAWFRAME = &H20
  33. 'Fully redraw the window in its new position.
  34. Public Const SWP_FRAMECHANGED = &H20
  35. 'Hide the window from the screen.
  36. Public Const SWP_HIDEWINDOW = &H80
  37. 'Do not make the window active after moving it unless it was already the active window.
  38. Public Const SWP_NOACTIVATE = &H10
  39. 'Do not redraw anything drawn on the window after it is moved.
  40. Public Const SWP_NOCOPYBITS = &H100
  41. 'Do not move the window.
  42. Public Const SWP_NOMOVE = &H2
  43. 'Do not resize the window.
  44. Public Const SWP_NOSIZE = &H1
  45. 'Do not remove the image of the window in its former position, effectively leaving a ghost image on the screen.
  46. Public Const SWP_NOREDRAW = &H8
  47. 'Do not change the window's position in the Z-order.
  48. Public Const SWP_NOZORDER = &H4
  49. 'Show the window if it is hidden.
  50. Public Const SWP_SHOWWINDOW = &H40
  51.  
  52.  
  53. 'Types
  54. '--------------
  55. Public Type POINTAPI
  56.     X As Long
  57.     Y As Long
  58. End Type
  59.  
  60. Public Type RECT
  61.     Left As Long
  62.     Top As Long
  63.     Right As Long
  64.     Bottom As Long
  65. End Type
  66.  
  67.  
  68.