home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09964.iso / text / DANA104.ZIP / WINDOW.DAS < prev    next >
Text File  |  1995-10-05  |  872b  |  35 lines

  1. '---------------------------
  2. ' Windows API Using sample
  3. '---------------------------
  4. Const SW_SHOWNORMAL    = 1
  5. Const SW_SHOWMINIMIZED = 2
  6. Const SW_SHOWMAXIMIZED = 3
  7.  
  8. Declare Proc ShowWindow Lib "User32" (hWnd, nCmdShow) As Integer
  9. Declare Proc GetWindowRect Lib "User32" (hWnd%, lpRect%)
  10.  
  11. Main ()
  12.     Dim hMenu%
  13.     Dim rct$
  14.     Dim Rect(4)
  15.     hMenu = NewMenu()
  16.     AddMenuItem(hMenu, "&Normal", SW_SHOWNORMAL);
  17.     AddMenuItem(hMenu, "&Iconic", SW_SHOWMINIMIZED);
  18.     AddMenuItem(hMenu, "&Maximized", SW_SHOWMAXIMIZED);
  19.  
  20.     Dim nRC
  21.     nRC = DoMenu(hMenu)
  22.     If nRC Then
  23.         ShowWindow(.hMainWnd, nRC)
  24.     End If
  25.     DiscardMenu(hMenu)
  26.  
  27.     GetWindowRect(.hMainWnd, Rect)
  28.     rct$ = "Left & Top is " + Str$(Rect(1)) + "," + Str$(Rect(2))
  29.     rct$ = rct$ + Chr$(13) + Chr$(10)
  30.     rct$ = rct$ + "Right bottom is " + Str$(Rect(3)) + "," + Str$(Rect(4))
  31.     MsgBox(rct$, "", 0)
  32.  
  33. End Proc
  34.  
  35.