Project

General

Profile

Statistics
| Revision:

vdfsplat / AppSrc / cOCXReader.pkg @ 67

History | View | Annotate | Download (2.03 KB)

1
//TH-Header
2
//*****************************************************************************************
3
// Copyright (c)  2015 Antwise Solutions
4
// All rights reserved.
5
//
6
// $FileName    : .\VdfSplat\AppSrc\cOCXReader.pkg
7
// $ProjectName : VdfSplat DataFlex Debugger
8
// $Authors     : Wil van Antwerpen
9
// $Created     : 09.08.2015  14:47
10
// $Type        : GPL v2
11
//
12
// Contents:
13
//
14
//*****************************************************************************************
15
//TH-RevisionStart
16
//TH-RevisionEnd
17

    
18

    
19

    
20

    
21

    
22
Struct tOCX
23
  String sProgID
24
  String sDefaultName
25
  String sName
26
  String sToolboxBitmap
27
End_Struct
28

    
29
Class cOCXReader is a cRegistry
30
  
31
  Function ReadControlByProgID String sProgID Returns tOCX
32
    Boolean bOpened
33
    Boolean bExists
34
    String  sDefaultName
35
    String  sName
36
    String  sBitmap
37
    String  sKey
38
    tOCX   OCX
39
    
40
    Move "" To sDefaultName
41
    Set phRootKey      to HKEY_LOCAL_MACHINE
42
    Set pfAccessRights to Key_Read
43
    Move ("Software\Classes\CLSID\"+sProgID) To sKey
44
    Get KeyExists sKey to bExists
45
    If bExists Begin
46
      Get OpenKey sKey to bOpened
47
      If bOpened Begin
48
//          Get ValueExists of hoRegistry "(Default)" To bExists
49
        Get ValueExists "" to bExists
50
        If (bExists) Begin
51
          Get ReadString "" to sDefaultName
52
        End
53
        Send CloseKey
54
      End
55
      Get OpenKey (sKey+"\ProgID") to bOpened
56
      If bOpened Begin
57
        Get ValueExists "" to bExists
58
        If (bExists) Begin
59
          Get ReadString "" to sName
60
        End
61
        Send CloseKey
62
      End
63
      Get OpenKey (sKey+"\ToolboxBitmap32") to bOpened
64
      If bOpened Begin
65
        Get ValueExists "" to bExists
66
        If (bExists) Begin
67
          Get ReadString "" to sBitmap
68
        End
69
        Send CloseKey
70
      End
71
    End
72
    Move sProgID      To OCX.sProgID
73
    Move sDefaultName to OCX.sDefaultName
74
    Move sName        to OCX.sName
75
    Move sBitmap      to OCX.sToolboxBitmap
76
    Function_Return OCX
77
  End_Function
78

    
79
End_Class