home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / vb_msg / mdimenu.frm < prev    next >
Text File  |  1993-07-19  |  8KB  |  307 lines

  1. VERSION 2.00
  2. Begin MDIForm MDIForm1 
  3.    Caption         =   "Menu Demonstration"
  4.    ClientHeight    =   4035
  5.    ClientLeft      =   4845
  6.    ClientTop       =   4260
  7.    ClientWidth     =   7620
  8.    Height          =   4725
  9.    Left            =   4785
  10.    LinkTopic       =   "MDIForm1"
  11.    Top             =   3630
  12.    Width           =   7740
  13.    Begin PictureBox Picture1 
  14.       Align           =   2  'Align Bottom
  15.       BackColor       =   &H00C0C0C0&
  16.       FontBold        =   0   'False
  17.       FontItalic      =   0   'False
  18.       FontName        =   "MS Sans Serif"
  19.       FontSize        =   8.25
  20.       FontStrikethru  =   0   'False
  21.       FontUnderline   =   0   'False
  22.       Height          =   300
  23.       Left            =   0
  24.       ScaleHeight     =   270
  25.       ScaleWidth      =   7590
  26.       TabIndex        =   0
  27.       Top             =   3735
  28.       Width           =   7620
  29.       Begin VBMsg VBMsg1 
  30.          Height          =   420
  31.          Left            =   7080
  32.          MessageCount    =   MDIMENU.FRX:0000
  33.          MessageList     =   MDIMENU.FRX:0002
  34.          MessageTypes    =   0  'Selected Messages
  35.          PostDefault     =   0   'False
  36.          Top             =   -60
  37.          Width           =   420
  38.       End
  39.    End
  40.    Begin Menu file 
  41.       Caption         =   "&File"
  42.       Begin Menu new 
  43.          Caption         =   "&New"
  44.       End
  45.       Begin Menu Open 
  46.          Caption         =   "&Open..."
  47.       End
  48.       Begin Menu save 
  49.          Caption         =   "&Save"
  50.       End
  51.       Begin Menu saveas 
  52.          Caption         =   "Save &As..."
  53.       End
  54.       Begin Menu saveall 
  55.          Caption         =   "Sav&e All"
  56.       End
  57.       Begin Menu close 
  58.          Caption         =   "&Close"
  59.       End
  60.       Begin Menu sep13 
  61.          Caption         =   "-"
  62.       End
  63.       Begin Menu print 
  64.          Caption         =   "&Print..."
  65.          Shortcut        =   ^P
  66.       End
  67.       Begin Menu setup 
  68.          Caption         =   "P&rint Setup..."
  69.       End
  70.       Begin Menu sep11 
  71.          Caption         =   "-"
  72.       End
  73.       Begin Menu exit 
  74.          Caption         =   "E&xit"
  75.       End
  76.    End
  77.    Begin Menu edit 
  78.       Caption         =   "&Edit"
  79.       Begin Menu undo 
  80.          Caption         =   "&Undo"
  81.          Shortcut        =   ^Z
  82.       End
  83.       Begin Menu sep4 
  84.          Caption         =   "-"
  85.       End
  86.       Begin Menu cut 
  87.          Caption         =   "Cu&t"
  88.          Shortcut        =   ^X
  89.       End
  90.       Begin Menu copy 
  91.          Caption         =   "&Copy"
  92.          Shortcut        =   ^C
  93.       End
  94.       Begin Menu paste 
  95.          Caption         =   "&Paste"
  96.          Shortcut        =   ^V
  97.       End
  98.       Begin Menu sep3 
  99.          Caption         =   "-"
  100.       End
  101.       Begin Menu find 
  102.          Caption         =   "&Find..."
  103.          Shortcut        =   ^F
  104.       End
  105.       Begin Menu next 
  106.          Caption         =   "Find &Next"
  107.          Shortcut        =   {F3}
  108.       End
  109.       Begin Menu replace 
  110.          Caption         =   "R&eplace"
  111.       End
  112.    End
  113.    Begin Menu windows 
  114.       Caption         =   "&Window"
  115.       WindowList      =   -1  'True
  116.       Begin Menu newwindow 
  117.          Caption         =   "&New Window"
  118.       End
  119.       Begin Menu casc 
  120.          Caption         =   "&Cascade"
  121.       End
  122.       Begin Menu tile 
  123.          Caption         =   "&Tile"
  124.       End
  125.       Begin Menu arran 
  126.          Caption         =   "&Arrange Icons"
  127.       End
  128.    End
  129.    Begin Menu help 
  130.       Caption         =   "&Help"
  131.       Begin Menu cont 
  132.          Caption         =   "&Contents"
  133.       End
  134.       Begin Menu serrarc 
  135.          Caption         =   "&Search for Help On..."
  136.       End
  137.       Begin Menu how 
  138.          Caption         =   "&How to Use Help"
  139.       End
  140.       Begin Menu sep9 
  141.          Caption         =   "-"
  142.       End
  143.       Begin Menu about 
  144.          Caption         =   "&About..."
  145.       End
  146.    End
  147. End
  148. Option Explicit
  149.  
  150. Const MF_SYSMENU = &H2000
  151. Const MF_SEPARATOR = &H800
  152.  
  153. Sub arran_Click ()
  154.     
  155.     MDIForm1.Arrange 3
  156.  
  157. End Sub
  158.  
  159. Sub casc_Click ()
  160.  
  161.     MDIForm1.Arrange 0
  162.  
  163. End Sub
  164.  
  165. Sub edit_Click ()
  166.  
  167.     Picture1.Cls
  168.     Picture1.Print "  Undo Last Changes, Perform Clipboard Operations, Search and Replace"
  169.  
  170. End Sub
  171.  
  172. Sub exit_Click ()
  173.     End
  174. End Sub
  175.  
  176. Sub file_Click ()
  177.  
  178.     Picture1.Cls
  179.     Picture1.Print "  Create, Open, Save, Print or Close Documents, Setup the Printer, or Ext the Application"
  180.  
  181. End Sub
  182.  
  183. Sub help_Click ()
  184.  
  185.     Picture1.Cls
  186.     Picture1.Print " Get Help on the Application"
  187.  
  188. End Sub
  189.  
  190. Sub MDIForm_Load ()
  191.     
  192.     Load Form1  ' Load original Form1.
  193.  
  194.     Form1.Print "Use the mouse to drag through the"
  195.     Form1.Print "menu items above.  Notice on the status"
  196.     Form1.Print "line the text associated with the item."
  197.     Form1.Print "VB Messenger is detecting when the MDI"
  198.     Form1.Print "parent form gets a WM_MENUSELECT message "
  199.     Form1.Print "and interprets the results to print a "
  200.     Form1.Print "line of text describing the menu item."
  201.  
  202.     VBMsg1.SubClasshWnd = MDIForm1.hWnd
  203.     
  204. End Sub
  205.  
  206. Sub newwindow_Click ()
  207.  
  208.     Static i As Integer
  209.     i = i + 1
  210.     
  211.     ReDim Preserve F(i) As New Form1
  212.  
  213.     F(i).Caption = "Child Window " & i
  214.     F(i).Show
  215.  
  216. End Sub
  217.  
  218. Sub tile_Click ()
  219.  
  220.     MDIForm1.Arrange 1
  221.  
  222. End Sub
  223.  
  224. Sub VBMsg1_WindowMessage (hWindow As Integer, Msg As Integer, wParam As Integer, lParam As Long, RetVal As Long, CallDefProc As Integer)
  225.  
  226.     Dim Dil As String
  227.     Dim rc As Integer
  228.     Dim MenuID As String * 40
  229.     
  230.     VBMsg1.lParam = lParam  'parse out LoWord and HiWord values
  231.     
  232.     If (VBMsg1.LoWord And MF_SYSMENU) Or (VBMsg1.LoWord And MF_SEPARATOR) Then
  233.  
  234.         Dil = ""
  235.  
  236.     Else
  237.  
  238.         Select Case wParam
  239.             Case 2
  240.                 Dil = "Create a New Document"
  241.             Case 3
  242.                 Dil = "Open an Existing Document"
  243.             Case 4
  244.                 Dil = "Save the Document in the Active Window"
  245.             Case 5
  246.                 Dil = "Save the Active Document under a New Name"
  247.             Case 6
  248.                 Dil = "Save All the Open Documents"
  249.             Case 7
  250.                 Dil = "Close the Active Document"
  251.             Case 9
  252.                 Dil = "Print the Active Document"
  253.             Case 10
  254.                 Dil = "Change Printer Settings"
  255.             Case 12
  256.                 Dil = "Exit the Demo Application"
  257.             Case 14
  258.                 Dil = "Undo the Last Changes"
  259.             Case 16
  260.                 Dil = "Delete the Selected Text and Copy it into the Clipboard"
  261.             Case 17
  262.                 Dil = "Copy the Selected Text into the Clipboard"
  263.             Case 18
  264.                 Dil = "Paste the Clipboard Contents into the Active Window"
  265.             Case 20
  266.                 Dil = "Find a Specified String in the Active Window"
  267.             Case 21
  268.                 Dil = "Find the Next Matching String"
  269.             Case 22
  270.                 Dil = "Replace a String in the Active Window"
  271.             Case 24
  272.                 Dil = "Create a New Window with the Same Contents as the Active Window"
  273.             Case 25
  274.                 Dil = "Cascade the Open Windows"
  275.             Case 26
  276.                 Dil = "Tile the Open Windows"
  277.             Case 27
  278.                 Dil = "Rearrange All Icons"
  279.             Case 29
  280.                 Dil = "Display Help Contents"
  281.             Case 30
  282.                 Dil = "Search for a Specific Help Topic"
  283.             Case 31
  284.                 Dil = "Display Help on Using Windows Help"
  285.             Case 33
  286.                 Dil = "Display Version Information About the Application"
  287.             Case Is < 0
  288.                 Dil = "Make the Specified Window the Active Window"
  289.             Case Else
  290.                 Dil = ""
  291.         End Select
  292.  
  293.     End If
  294.  
  295.     Picture1.Cls
  296.     Picture1.Print "  " + Dil
  297.  
  298. End Sub
  299.  
  300. Sub windows_Click ()
  301.     
  302.     Picture1.Cls
  303.     Picture1.Print "  Manage Child Windows"
  304.     
  305. End Sub
  306.  
  307.