home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pc3270sa.zip / vbdde / fgsysfmt.frm < prev    next >
Text File  |  2002-02-28  |  5KB  |  160 lines

  1. VERSION 4.00
  2. Begin VB.Form FormGetSysFormats 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Get System Formats"
  5.    ClientHeight    =   2184
  6.    ClientLeft      =   3996
  7.    ClientTop       =   3528
  8.    ClientWidth     =   3972
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   7.8
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   2508
  20.    Left            =   3948
  21.    LinkMode        =   1  'Source
  22.    LinkTopic       =   "Form2"
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   2184
  26.    ScaleWidth      =   3972
  27.    ShowInTaskbar   =   0   'False
  28.    Top             =   3252
  29.    Width           =   4068
  30.    Begin VB.Frame Frame1 
  31.       Caption         =   "Supported Windows Clipboard Formats"
  32.       Height          =   1212
  33.       Left            =   240
  34.       TabIndex        =   2
  35.       Top             =   240
  36.       Width           =   3492
  37.       Begin VB.ListBox FormatList 
  38.          BackColor       =   &H00C0FFFF&
  39.          Height          =   816
  40.          ItemData        =   "FGSYSFMT.frx":0000
  41.          Left            =   120
  42.          List            =   "FGSYSFMT.frx":0002
  43.          Sorted          =   -1  'True
  44.          TabIndex        =   3
  45.          Top             =   240
  46.          Width           =   3252
  47.       End
  48.    End
  49.    Begin VB.TextBox FormatDataText 
  50.       ForeColor       =   &H00FF0000&
  51.       Height          =   372
  52.       Left            =   3120
  53.       Locked          =   -1  'True
  54.       MultiLine       =   -1  'True
  55.       TabIndex        =   1
  56.       TabStop         =   0   'False
  57.       Top             =   1680
  58.       Visible         =   0   'False
  59.       Width           =   492
  60.    End
  61.    Begin VB.CommandButton Execute 
  62.       Cancel          =   -1  'True
  63.       Caption         =   "&OK"
  64.       Default         =   -1  'True
  65.       Height          =   372
  66.       Left            =   1560
  67.       TabIndex        =   0
  68.       Top             =   1680
  69.       Width           =   972
  70.    End
  71. End
  72. Attribute VB_Name = "FormGetSysFormats"
  73. Attribute VB_Creatable = False
  74. Attribute VB_Exposed = False
  75.  
  76.  
  77. Private Sub Execute_Click()
  78.   Unload FormGetSysFormats
  79. End Sub
  80.  
  81. Private Sub ExitDlg_Click()
  82.     Hide
  83. End Sub
  84.  
  85. Private Sub UpdateLogPointer()
  86.     LogEnd = LogEnd + 1
  87.     If LogEnd = MAXLOGNUM + 1 Then
  88.        LogEnd = 0
  89.     End If
  90.  
  91.     If LogTop = LogEnd Then
  92.        LogTop = LogTop + 1
  93.        If LogTop = MAXLOGNUM + 1 Then
  94.           LogTop = 0
  95.        End If
  96.     End If
  97. End Sub
  98.  
  99. Private Sub Form_Load()
  100. On Error GoTo LoadErrHandler
  101.    FunctionComp = True
  102.  
  103.    rc = DoEvents()              'If you use VisualBasic V2.0, call
  104.                                 'DoEvents function each time before
  105.                                 'starting DDE conversation.
  106.    FormatDataText.LinkTimeout = -1
  107.    FormatDataText.LinkTopic = "IBM327032|System"
  108.    FormatDataText.LinkMode = COLD
  109.    FormatDataText.LinkItem = "Formats"
  110.    FormatDataText.LinkRequest
  111.    FormatDataText.LinkMode = NONE
  112.    If FunctionComp = True Then
  113.    StartPos& = 1
  114.    Do While True
  115.       EndPos& = InStr(StartPos&, FormatDataText.Text, Chr$(9))
  116.       If EndPos& = 0 Then
  117.         temp& = LTrim$(RTrim$(Mid$(FormatDataText.Text, StartPos&)))
  118.         If temp& = 1 Then
  119.           FormatList.AddItem "CF_TEXT"
  120.         ElseIf temp& = 129 Then
  121.           FormatList.AddItem "CF_DSPTEXT"
  122.         Else
  123.           FormatList.AddItem temp&
  124.         End If
  125.         Exit Do
  126.       Else
  127.         temp& = LTrim$(RTrim$(Mid$(FormatDataText.Text, StartPos&, EndPos& - StartPos&)))
  128.          If temp& = 1 Then
  129.           FormatList.AddItem "CF_TEXT"
  130.         ElseIf temp& = 129 Then
  131.           FormatList.AddItem "CF_DSPTEXT"
  132.         Else
  133.           FormatList.AddItem temp&
  134.         End If
  135.       End If
  136.       StartPos& = EndPos& + 1
  137.    Loop
  138.       EndStatus$ = MSG_OK
  139.    Else
  140.       MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  141.       EndStatus$ = MSG_NG
  142.    End If
  143.    TempLogData$ = Time$ + ":Get System Formats : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
  144.    TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
  145.    TempLogData$ = TempLogData$ + MSG_TOPIC + """System""" + Chr$(13) + Chr$(10) + Chr$(9)
  146.    TempLogData$ = TempLogData$ + MSG_ITEM + """Formats""" + Chr$(13) + Chr$(10) + Chr$(9)
  147.    TempLogData$ = TempLogData$ + "Data =" + """" + FormatDataText.Text + """" + Chr$(13) + Chr$(10)
  148.    LogData$(LogEnd) = TempLogData$
  149.    UpdateLogPointer
  150.    Loged = True
  151.    Exit Sub
  152.  
  153. LoadErrHandler:
  154.    FunctionComp = False
  155.    Resume Next
  156.  
  157. End Sub
  158.  
  159.  
  160.