# File lib/spreadsheet/excel/writer/workbook.rb, line 594
  def write_window1 workbook, writer
    selected = workbook.worksheets.find do |sheet| sheet.selected end
    actidx = workbook.worksheets.index selected
    data = [
      0x0000, # Horizontal position of the document window
              # (in twips = 1/20 of a point)
      0x0000, # Vertical position of the document window
              # (in twips = 1/20 of a point)
      0x4000, # Width of the document window (in twips = 1/20 of a point)
      0x2000, # Height of the document window (in twips = 1/20 of a point)
      0x0038, # Option flags:
              # Bit  Mask    Contents
              #   0  0x0001  0 = Window is visible
              #              1 = Window is hidden
              #   1  0x0002  0 = Window is open
              #              1 = Window is minimised
              #   3  0x0008  0 = Horizontal scroll bar hidden
              #              1 = Horizontal scroll bar visible
              #   4  0x0010  0 = Vertical scroll bar hidden
              #              1 = Vertical scroll bar visible
              #   5  0x0020  0 = Worksheet tab bar hidden
              #              1 = Worksheet tab bar visible
      actidx, # Index to active (displayed) worksheet
      0x0000, # Index of first visible tab in the worksheet tab bar
      0x0001, # Number of selected worksheets
              # (highlighted in the worksheet tab bar)
      0x00e5, # Width of worksheet tab bar (in 1/1000 of window width).
              # The remaining space is used by the horizontal scrollbar.
    ]
    write_op writer, 0x003d, data.pack('v*')
  end