home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / epmsmp.zip / TEXTONLY.E < prev    next >
Text File  |  1994-12-06  |  4KB  |  97 lines

  1. compile if not defined(EPM)
  2.   include 'stdconst.e'
  3.  
  4. defmain               -- If being compiled separately, define a DEFMAIN so that
  5.    'textonly' arg(1)  -- the .ex file can be executed directly.  Note that you
  6. compile endif         -- won't be able to do a TextOnly Off if used thusly - the
  7.                       -- old frame size will be lost when the .ex is unlinked.
  8.  
  9. defc textonly
  10.    universal old_frame
  11. compile if EPM32
  12.    if upcase(arg(1))='OFF' & old_frame <> '' then
  13.       call dynalink32( 'PMWIN',
  14.                        '#875',
  15.                        gethwndc(EPMINFO_EDITFRAME) ||
  16.                        atol(3)                     ||      /* HWND_TOP   */
  17.                        substr(old_frame,13, 4)     ||
  18.                        substr(old_frame, 9, 4)     ||
  19.                        substr(old_frame, 5, 4)     ||
  20.                        substr(old_frame, 1, 4)     ||
  21.                        atol(3))                        -- SWP_SIZE (1) + SWP_MOVE (2)
  22.       return
  23.    endif
  24.    swp1 = copies(\0, 36)
  25.    swp2 = swp1
  26.    swpd = swp1
  27.    call dynalink32('PMWIN',
  28.                    '#837',
  29.                    gethwndc(EPMINFO_EDITCLIENT)  ||
  30.                    address(swp1) )
  31.    call dynalink32('PMWIN',
  32.                    '#837',
  33.                    gethwndc(EPMINFO_EDITFRAME)   ||
  34.                    address(swp2) )
  35.    call dynalink32('PMWIN',
  36.                    '#837',
  37.                    atol(1)   ||  -- HWND_DESKTOP
  38.                    address(swpd) )
  39.    x = - ltoa(substr(swp1,17,4),10)
  40.    y = - ltoa(substr(swp1,13,4),10)
  41.    cx = ltoa(substr(swpd,9,4),10) + ltoa(substr(swp2,9,4),10) - ltoa(substr(swp1,9,4),10)
  42.    cy = ltoa(substr(swpd,5,4),10) + ltoa(substr(swp2,5,4),10) - ltoa(substr(swp1,5,4),10)
  43.    old_frame = substr(swp2, 5, 16)
  44.  
  45.    call dynalink32( 'PMWIN',
  46.                     '#875',
  47.                     gethwndc(EPMINFO_EDITFRAME) ||
  48.                     atol(3)                    ||      /* HWND_TOP   */
  49.                     atol(x)                    ||
  50.                     atol(y)                    ||
  51.                     atol(cx)                   ||
  52.                     atol(cy)                   ||
  53.                     atol(3))                        -- SWP_SIZE (1) + SWP_MOVE (2)
  54. compile else
  55.    if upcase(arg(1))='OFF' & old_frame <> '' then
  56.       call dynalink( 'PMWIN',
  57.                 'WINSETWINDOWPOS',
  58.                  gethwnd(EPMINFO_EDITFRAME) ||
  59.                  atoi(0) || atoi(3)         ||      /* HWND_TOP   */
  60.                  substr(old_frame, 7, 2)    ||
  61.                  substr(old_frame, 5, 2)    ||
  62.                  substr(old_frame, 3, 2)    ||
  63.                  substr(old_frame, 1, 2)    ||
  64.                  atoi(3))                        /* SWP_MOVE | SWP_SIZE */
  65.       return
  66.    endif
  67.    swp1 = copies(\0,18)
  68.    swp2 = swp1
  69.    swpd = swp1
  70.    call dynalink('PMWIN',
  71.                  'WINQUERYWINDOWPOS',
  72.                   gethwnd(EPMINFO_EDITCLIENT)  ||
  73.                   address(swp1) )
  74.    call dynalink('PMWIN',
  75.                  'WINQUERYWINDOWPOS',
  76.                   gethwnd(EPMINFO_EDITFRAME)   ||
  77.                   address(swp2) )
  78.    call dynalink('PMWIN',
  79.                  'WINQUERYWINDOWPOS',
  80.                   atol_swap(1) ||  -- HWND_DESKTOP
  81.                   address(swpd) )
  82.    x = - itoa(substr(swp1,9,2),10)
  83.    y = - itoa(substr(swp1,7,2),10)
  84.    cx = itoa(substr(swpd,5,2),10) + itoa(substr(swp2,5,2),10) - itoa(substr(swp1,5,2),10)
  85.    cy = itoa(substr(swpd,3,2),10) + itoa(substr(swp2,3,2),10) - itoa(substr(swp1,3,2),10)
  86.    old_frame = substr(swp2, 3, 8)
  87.    call dynalink( 'PMWIN',
  88.              'WINSETWINDOWPOS',
  89.               gethwnd(EPMINFO_EDITFRAME) ||
  90.               atoi(0) || atoi(3)         ||      /* HWND_TOP   */
  91.               atoi(x)                    ||
  92.               atoi(y)                    ||
  93.               atoi(cx)                   ||
  94.               atoi(cy)                   ||
  95.               atoi(3))                        /* SWP_MOVE | SWP_SIZE */
  96. compile endif  -- EPM32
  97.