home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol10n17.zip / DESKEXT.RLZ < prev    next >
Text File  |  1991-09-11  |  783b  |  26 lines

  1. ' deskext.rlz
  2.  
  3. external "user" func GetDesktopWindow () as word
  4. external "user" func GetWindowDC (word) as word
  5. external "user" proc ReleaseDC (word, word)
  6. external "gdi" func GetWindowExt (word) as dword
  7. external "gdi" func GetWindowOrg (word) as dword
  8.  
  9. func LOWORD(dw)
  10.     return (dw mod 65536)
  11. end func
  12.  
  13. func HIWORD(dw)
  14.     return (Floor(dw / 65536))
  15. end func
  16.  
  17. hDesktop = GetDesktopWindow()
  18. hDc = GetWindowDC(hDesktop)
  19. ext = GetWindowExt(hDC)
  20. org = GetWindowOrg(hDC)
  21. Print "desktop window: ", LOWORD(org), HIWORD(org), LOWORD(ext), HIWORD(ext)
  22. ' if bail out before execute next line, eventually crash Windows:
  23. ' HDCs are a precious resource in WIndows; managing them in an interpreted
  24. ' environment (or in a debugger) is tricky.
  25. ReleaseDC(hDesktop, hDC)
  26.