home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ddepm / ddepm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  12.2 KB  |  353 lines

  1. VERSION 2.00
  2. Begin Form frmMain 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "DDEPM.BAS Test Form"
  5.    ClientHeight    =   5700
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1545
  8.    ClientWidth     =   8685
  9.    Height          =   6105
  10.    Left            =   1080
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   380
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   579
  15.    Top             =   1200
  16.    Width           =   8805
  17.    Begin TextBox txtProgManDDELink 
  18.       BackColor       =   &H00FFFF00&
  19.       Height          =   285
  20.       Left            =   0
  21.       TabIndex        =   18
  22.       Text            =   "txtProgManDDELink"
  23.       Top             =   240
  24.       Visible         =   0   'False
  25.       Width           =   2055
  26.    End
  27.    Begin ListBox lstGroups 
  28.       Height          =   1395
  29.       Left            =   240
  30.       TabIndex        =   17
  31.       Top             =   390
  32.       Width           =   7845
  33.    End
  34.    Begin Frame fmeOtherFunctions 
  35.       Caption         =   "Other Functions"
  36.       Height          =   3225
  37.       Left            =   5580
  38.       TabIndex        =   0
  39.       Top             =   1890
  40.       Width           =   2505
  41.       Begin CommandButton btnddepmGetGroups 
  42.          Caption         =   "ddepmGetGroups"
  43.          Height          =   465
  44.          Left            =   150
  45.          TabIndex        =   16
  46.          Top             =   1500
  47.          Width           =   2205
  48.       End
  49.       Begin CommandButton btnddepmGroupInfo 
  50.          Caption         =   "ddepmGroupInfo"
  51.          Height          =   465
  52.          Left            =   150
  53.          TabIndex        =   1
  54.          Top             =   960
  55.          Width           =   2205
  56.       End
  57.       Begin CommandButton btnddepmExitProgMan 
  58.          Caption         =   "ddepmExitProgMan"
  59.          Height          =   465
  60.          Left            =   150
  61.          TabIndex        =   2
  62.          Top             =   420
  63.          Width           =   2205
  64.       End
  65.       Begin Label lblNote 
  66.          Caption         =   "First do GetGroups then select a groupname in the list and do GroupInfo."
  67.          ForeColor       =   &H00FF0000&
  68.          Height          =   735
  69.          Left            =   180
  70.          TabIndex        =   19
  71.          Top             =   2100
  72.          Width           =   2205
  73.       End
  74.    End
  75.    Begin Frame fmeGroupFunctions 
  76.       Caption         =   "Group Functions"
  77.       Height          =   3225
  78.       Left            =   2910
  79.       TabIndex        =   10
  80.       Top             =   1890
  81.       Width           =   2505
  82.       Begin CommandButton btnddepmShowGroup 
  83.          Caption         =   "ddepmShowGroup"
  84.          Enabled         =   0   'False
  85.          Height          =   465
  86.          Left            =   150
  87.          TabIndex        =   15
  88.          Top             =   2580
  89.          Width           =   2205
  90.       End
  91.       Begin CommandButton btnddepmSelectGroup 
  92.          Caption         =   "ddepmSelectGroup"
  93.          Height          =   465
  94.          Left            =   150
  95.          TabIndex        =   14
  96.          Top             =   2040
  97.          Width           =   2205
  98.       End
  99.       Begin CommandButton btnddepmReloadGroup 
  100.          Caption         =   "ddepmReloadGroup"
  101.          Height          =   465
  102.          Left            =   150
  103.          TabIndex        =   13
  104.          Top             =   1500
  105.          Width           =   2205
  106.       End
  107.       Begin CommandButton btnddepmDeleteGroup 
  108.          Caption         =   "ddepmDeleteGroup"
  109.          Height          =   465
  110.          Left            =   150
  111.          TabIndex        =   12
  112.          Top             =   960
  113.          Width           =   2205
  114.       End
  115.       Begin CommandButton btnddepmCreateGroup 
  116.          Caption         =   "ddepmCreateGroup"
  117.          Height          =   465
  118.          Left            =   150
  119.          TabIndex        =   11
  120.          Top             =   420
  121.          Width           =   2205
  122.       End
  123.    End
  124.    Begin Frame fmeItemFunctions 
  125.       Caption         =   "Item Functions"
  126.       Height          =   3225
  127.       Left            =   240
  128.       TabIndex        =   4
  129.       Top             =   1890
  130.       Width           =   2505
  131.       Begin CommandButton btnddepmReplaceItem 
  132.          Caption         =   "ddepmReplaceItem"
  133.          Height          =   465
  134.          Left            =   150
  135.          TabIndex        =   9
  136.          Top             =   2580
  137.          Width           =   2205
  138.       End
  139.       Begin CommandButton btnddepmDeleteItem 
  140.          Caption         =   "ddepmDeleteItem"
  141.          Height          =   465
  142.          Left            =   150
  143.          TabIndex        =   8
  144.          Top             =   2040
  145.          Width           =   2205
  146.       End
  147.       Begin CommandButton btnddepmAddItemExtT 
  148.          Caption         =   "ddepmAddItemExtT"
  149.          Enabled         =   0   'False
  150.          Height          =   465
  151.          Left            =   150
  152.          TabIndex        =   7
  153.          Top             =   1500
  154.          Width           =   2205
  155.       End
  156.       Begin CommandButton btnddepmAddItemExt 
  157.          Caption         =   "ddepmAddItemExt"
  158.          Height          =   465
  159.          Left            =   150
  160.          TabIndex        =   6
  161.          Top             =   960
  162.          Width           =   2205
  163.       End
  164.       Begin CommandButton btnddepmAddItem 
  165.          Caption         =   "ddepmAddItem"
  166.          Height          =   465
  167.          Left            =   150
  168.          TabIndex        =   5
  169.          Top             =   420
  170.          Width           =   2205
  171.       End
  172.    End
  173.    Begin Label lblProgManDDELink 
  174.       Alignment       =   2  'Center
  175.       BackColor       =   &H00FFFF00&
  176.       BorderStyle     =   1  'Fixed Single
  177.       Caption         =   "lblProgManDDELink"
  178.       Height          =   255
  179.       Left            =   0
  180.       TabIndex        =   3
  181.       Top             =   0
  182.       Visible         =   0   'False
  183.       Width           =   8685
  184.    End
  185. Option Explicit
  186. DefInt A-Z
  187. Dim mlblDDELink As label
  188. Sub btnddepmAddItem_Click ()
  189.     Dim i%
  190.     '-- 08/05/93
  191.     '-- OK
  192.     Call ddepmAddItem(mlblDDELink, "Clock.EXE", "Item1")
  193.     '-- 08/05/93
  194.     '-- OK
  195.     'For i% = 1 To 30
  196.     '    Call ddepmAddItem(mlblDDELink, "Clock.EXE", "Item" & i%)
  197.     'Next i%
  198.     '-- 08/08/93
  199.     '-- If CmdLine is Null("") then the method won't execute.
  200.     '-- If CmdLine contains even 1 letter then it will execute.
  201.     'Call ddepmAddItem(mlblDDELink, "r", "")
  202. End Sub
  203. Sub btnddepmAddItemExt_Click ()
  204.     Dim i%
  205.     Dim CmdLine$, ItemName$
  206.     Dim IconPath$, DefDir$, HotKey%
  207.     Dim IconIndex%, xPos%, yPos%, RunMinimized%
  208.     '-- 08/08/93
  209.     '-- OK
  210.     CmdLine$ = "Clock.exe"
  211.     'For i% = 1 To 5
  212.         ItemName$ = "Item" & i%
  213.         xPos% = xPos% + 32
  214.         yPos% = yPos% + 32
  215.         HotKey% = HOTKEY_MOD_CTRL + Asc("X")
  216.         DefDir$ = "C:\WinApps"
  217.         RunMinimized% = True
  218.         Call ddepmAddItemExt(mlblDDELink, CmdLine$, ItemName$, IconPath$, IconIndex%, xPos%, yPos%, DefDir$, HotKey%, RunMinimized%)
  219.     'Next i%
  220. End Sub
  221. Sub btnddepmCreateGroup_Click ()
  222.     Dim GroupName$, GroupPath$
  223.     '-- 08/08/93
  224.     '-- OK
  225.     GroupName$ = "ddepmCreateGroup Test"
  226.     GroupPath$ = "ddepm"
  227.     Call ddepmCreateGroup(mlblDDELink, GroupName$, GroupPath$)
  228.     '-- 08/08/93
  229.     '-- OK
  230.     'GroupName$ = "ddepmCreateGroup Test"
  231.     'GroupPath$ = ""
  232.     'Call ddepmCreateGroup(mlblDDELink, GroupName$, GroupPath$)
  233.     '-- 08/08/93
  234.     '-- OK *BUT* the ddepmDelete function *cannot* delete groups
  235.     '   that have a Null("") name or names that contain only spaces.
  236.     'GroupName$ = ""
  237.     'GroupPath$ = "ddepm"
  238.     'Call ddepmCreateGroup(mlblDDELink, GroupName$, GroupPath$)
  239.     '-- 08/08/93
  240.     '-- If Both the GroupName and GroupPath are Null("") then
  241.     '   no error is generated but no group is created.
  242.     'GroupName$ = ""
  243.     'GroupPath$ = ""
  244.     'Call ddepmCreateGroup(mlblDDELink, GroupName$, GroupPath$)
  245. End Sub
  246. Sub btnddepmDeleteGroup_Click ()
  247.     Dim GroupName$
  248.     '-- 08/08/93
  249.     '-- OK
  250.     GroupName$ = "ddepmCreateGroup Test"
  251.     Call ddepmDeleteGroup(mlblDDELink, GroupName$)
  252.     '-- 08/08/93
  253.     '-- This fails if GroupName is Null("") or contains
  254.     '   only spaces(even if it matches the group name of
  255.     '   nothing but spaces). So if you accidentally create
  256.     '   a group with a Null name you can't delete it via
  257.     '   DDE.
  258.     'GroupName$ = ""
  259.     'Call ddepmDeleteGroup(mlblDDELink, GroupName$)
  260. End Sub
  261. Sub btnddepmDeleteItem_Click ()
  262.     Dim i%
  263.     Dim ItemToDelete$
  264.     '-- 08/05/93
  265.     '-- OK
  266.     ItemToDelete$ = InputBox("Item to delete")
  267.     Call ddepmDeleteItem(mlblDDELink, ItemToDelete$, "")
  268.     '-- 08/05/93
  269.     '-- OK
  270.     'For i% = 1 To 30
  271.     '    Call ddepmDeleteItem(mlblDDELink, "Item" & i%, "")
  272.     'Next i%
  273.     '-- 08/08/93
  274.     '-- If CmdLine is Null("") then the method won't execute.
  275.     '-- If the Item specified doesn't exist then the method
  276.     '   won't execute.
  277.     '-- If CmdLine Matches and ItemName does not, the
  278.     '   command will execute but will flag an error that
  279.     '   it was unable to execute. Hmmm.
  280.     'Call ddepmDeleteItem(mlblDDELink, "", "")
  281. End Sub
  282. Sub btnddepmExitProgMan_Click ()
  283.     Call ddepmExitProgMan(mlblDDELink, False)
  284. End Sub
  285. Sub btnddepmGetGroups_Click ()
  286.     Dim i%
  287.     Dim GetGroups%
  288.     ReDim arrGroups$(0)
  289.     GetGroups% = ddepmGetGroups(mlblDDELink, arrGroups$())
  290.     lstGroups.Clear
  291.     For i% = 0 To UBound(arrGroups$)
  292.         lstGroups.AddItem arrGroups$(i%)
  293.     Next i%
  294. End Sub
  295. Sub btnddepmGroupInfo_Click ()
  296.     Dim GroupInfo%
  297.     Dim i%
  298.     Dim GroupName$
  299.     ReDim tarrGroupItems(0) As T_ProgManGroupItem
  300.     GroupName$ = lstGroups.Text
  301.     GroupInfo% = ddepmGroupInfo(frmMain!txtProgManDDELink, GroupName$, tarrGroupItems())
  302.     '-- The initial group info (retreived in the first line) ideally
  303.     '   wouldn't be in an element of the array of items because its
  304.     '   contents don't match the elements in the Type. Oh well, it's
  305.     '   just a test.<g>
  306.     Cls
  307.     Print "GROUP: "; tarrGroupItems(0).Name & "     FILE: " & tarrGroupItems(0).CmdLine
  308.     lstGroups.Clear
  309.     For i% = 1 To UBound(tarrGroupItems)
  310.         lstGroups.AddItem "Name: " & tarrGroupItems(i%).Name & "  CmdLine: " & tarrGroupItems(i%).CmdLine
  311.         lstGroups.AddItem "DefDir: " & tarrGroupItems(i%).DefaultDir & "  Icon Path: " & tarrGroupItems(i%).IconPath
  312.         lstGroups.AddItem "X:" & tarrGroupItems(i%).xPos & "  Y:" & tarrGroupItems(i%).yPos & "  Hot-Key:" & tarrGroupItems(i%).HotKey
  313.         lstGroups.AddItem "Icon:" & tarrGroupItems(i%).IconIndex & "  Minimize:" & tarrGroupItems(i%).RunMinimized
  314.         lstGroups.AddItem "************************************************"
  315.     Next i%
  316. End Sub
  317. Sub btnddepmReloadGroup_Click ()
  318.     Dim GroupName$
  319.     '-- 08/08/93
  320.     '-- OK if Groupname exists generates Error(won't execute
  321.     '   method) if not.
  322.     GroupName$ = "ddepmCreateGroup Test"
  323.     Call ddepmReloadGroup(mlblDDELink, GroupName$)
  324.     '-- 08/08/93
  325.     '-- Doesn't generate an error but it does seem to think
  326.     '   about it for a second before returning.
  327.     'GroupName$ = ""
  328.     'Call ddepmReloadGroup(mlblDDELink, GroupName$)
  329. End Sub
  330. Sub btnddepmReplaceItem_Click ()
  331.     Dim OldItem$, NewCmdLine$, NewItemName$
  332.     '-- 08/08/93
  333.     '-- OK
  334.     OldItem$ = "Item1"
  335.     NewCmdLine$ = "NotePad.EXE"
  336.     NewItemName$ = "Notepad"
  337.     Call ddepmReplaceItem(mlblDDELink, OldItem$, NewCmdLine$, NewItemName$)
  338. End Sub
  339. Sub btnddepmSelectGroup_Click ()
  340.     Dim GroupName$
  341.     '-- 08/09/93
  342.     '-- Works only if the Group is minimized. If the
  343.     '   Group is in a normal window state but not
  344.     '   active then it doesn't work.
  345.     GroupName$ = "ddepmCreateGroup Test"
  346.     Call ddepmSelectGroup(mlblDDELink, GroupName$)
  347. End Sub
  348. Sub filGroupFiles_Click ()
  349. End Sub
  350. Sub Form_Load ()
  351.     Set mlblDDELink = frmMain!lblProgManDDELink
  352. End Sub
  353.