home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk3 / penapi.tx_ / penapi.bin
Text File  |  1993-04-28  |  23KB  |  497 lines

  1. '====================================================================='
  2. '=    PENAPI.TXT      Windows for Pens - Visual Basic Declarations   ='
  3. '=                                                                   ='
  4. '=                    Version 2.0                                    ='
  5. '=                                                                   ='
  6. '=                    Copyright (c) 1992, Microsoft Corp.            ='
  7. '=                    All rights reserved.                           ='
  8. '=                                                                   ='
  9. '====================================================================='
  10.  
  11. '====================================================================='
  12. '=   Register Pen Applications                                       ='
  13. '====================================================================='
  14. Declare Function RegisterPenApps Lib "penwin.dll" (ByVal wFlags As Integer, ByVal fRegister As Integer) As Integer
  15. Declare Function IsPenAware Lib "penwin.dll" () As Integer
  16. Declare Function GetVersionPenWin Lib "penwin.dll" () As Integer
  17.  
  18. '====================================================================='
  19. '=   ALC CODES                                                       ='
  20. '====================================================================='
  21.     ' These constants are used when defining the
  22.     ' CharSet property of HEdits and BEdits
  23. Global Const ALC_ALL = &H43FF
  24. Global Const ALC_DEFAULT = &H0
  25. Global Const ALC_LCALPHA = &H1
  26. Global Const ALC_UCALPHA = &H2
  27. Global Const ALC_ALPHA = &H3
  28. Global Const ALC_NUMERIC = &H4
  29. Global Const ALC_ALPHANUMERIC = &H7
  30. Global Const ALC_PUNC = &H8
  31. Global Const ALC_MATH = &H10
  32. Global Const ALC_MONETARY = &H20
  33. Global Const ALC_OTHER = &H40
  34. Global Const ALC_WHITE = &H100
  35. Global Const ALC_NONPRINT = &H200
  36. Global Const ALC_GESTURE = &H4000
  37. Global Const ALC_USEBITMAP = &H8000
  38. Global Const ALC_DBCS = &H400
  39. Global Const ALC_HIRAGANA = &H100000
  40. Global Const ALC_KATAKANA = &H200000
  41. Global Const ALC_KANJI = &H40000
  42. Global Const ALC_OEM = &HFF80000
  43. Global Const ALC_RESERVED = &H43FF
  44. Global Const ALC_NONPRIORITY = &H0
  45. Global Const ALC_SYSMINIMUM = (ALC_ALPHANUMERIC Or ALC_WHITE Or ALC_GESTURE)
  46.  
  47. '====================================================================='
  48. '=   Point and Rectangle Structures                                  ='
  49. '====================================================================='
  50. Type POINTSHORT
  51.     x As Integer
  52.     y As Integer
  53. End Type
  54.  
  55. Type RECTSHORT
  56.     left As Integer
  57.     top As Integer
  58.     right As Integer
  59.     bottom As Integer
  60. End Type
  61.  
  62. '====================================================================='
  63. '=   On-Screen Keyboard Constants and Declarations                   ='
  64. '====================================================================='
  65. Type SKBINFO
  66.     hWnd As Integer         ' Handle to on-screen keyboard window
  67.     nPad As Integer         ' Current keypad view (full, basic or numeric)
  68.     fVisible As Integer     ' If TRUE, the on-screen keyboard is visible
  69.     fMinimized As Integer   ' If TRUE, the on-screen keyboard is minimized
  70.     rect As RECTSHORT       ' Screen coordinates of the restored keyboard rectangle
  71.     dwReserved As Long
  72. End Type
  73.  
  74. Declare Function ShowKeyboard Lib "penwin.dll" (ByVal hWnd As Integer, ByVal wCmd As Integer, lppoint As Any, lpSKBInfo As Any) As Integer
  75.  
  76. Global Const SKB_QUERY = &H0
  77. Global Const SKB_SHOW = &H1
  78. Global Const SKB_HIDE = &H2
  79. Global Const SKB_CENTER = &H10
  80. Global Const SKB_MOVE = &H20
  81. Global Const SKB_MINIMIZE = &H40
  82. Global Const SKB_FULL = &H100
  83. Global Const SKB_BASIC = &H200
  84. Global Const SKB_NUMPAD = &H400
  85.  
  86. Global Const SKN_POSCHANGED = &H1
  87. Global Const SKN_PADCHANGED = &H2
  88. Global Const SKN_MINCHANGED = &H4
  89. Global Const SKN_VISCHANGED = &H8
  90. Global Const SKN_TERMINATED = &HFFFF
  91.  
  92. '====================================================================='
  93. '=   Maniplating Pen Data                                            ='
  94. '====================================================================='
  95. Type PENDATAHEADER
  96.     wVersion As Integer         ' Pen Data format Version
  97.     cbSizeUsed As Integer       ' Size of Pen data memory block
  98.     cStrokes As Integer         ' Number of strokes
  99.     cPnt As Integer             ' Total number of points
  100.     cPntStrokeMax As Integer    ' Length of longest stroke in points
  101.     rectBound As RECTSHORT      ' Coordinates of bounding rectangle
  102.     wPndts As Integer           ' State of various PDTS_??? bits
  103.     nInkWidth As Integer        ' Ink Width
  104.     rgbInk As Long              ' Ink Color
  105. End Type
  106.  
  107. Global Const PDTS_LOMETRIC = &H0        ' Each logical unit is mapped to 0.01mm. Positive X to right; Positive Y down.
  108. Global Const PDTS_HIMETRIC = &H1        ' Logical mapped to 0.001mm. X+ to right; Y+ down
  109. Global Const PDTS_HIENGLISH = &H2       ' Logical mapped to 0.001 inch. X+ to right; y+ is down
  110. Global Const PDTS_SCALEMAX = &H3        ' Maximum scaling allowed
  111. Global Const PDTS_DISPLAY = &H4         ' Logical mapped to display pixel.  X+ to right; Y+ is down
  112. Global Const PDTS_ARBITRARY = &H5       ' Arbitrary scale, application dependent
  113. Global Const PDTS_SCALEMASK = &HF       ' Mask for bits of scale
  114. Global Const PDTS_STANDARDSCALE = PDTS_HIENGLISH
  115.  
  116. Global Const PDTS_NOPENINFO = &H100         ' No PENINFO structure
  117. Global Const PDTS_NOUPPOINTS = &H200        ' The data points on pen up have been removed
  118. Global Const PDTS_NOOEMDATA = &H400         ' No OEM data present
  119. Global Const PDTS_NOCOLINEAR = &H800
  120. Global Const PDTS_COMPRESSED = &H8000       ' The data is compressed
  121. Global Const PDTS_COMPRESSMETHOD = &HF0     ' Bits have been saved to encode which compression scheme was used
  122. Global Const PDTS_COMPRESS2NDDERIV = &H10   ' The second derivative betwen points is stored
  123.  
  124. Global Const PDTT_DEFAULT = &H0                 ' reallocates memory block to fit data.  Should be run before GlobalSize(hpendata) is taken
  125. Global Const PDTT_PENINFO = PDTS_NOPENINFO      ' removes PenInfo from the header
  126. Global Const PDTT_UPPOINTS = PDTS_NOUPPOINTS    ' Throws away all data from points collected when pen is not in contact with the tablet.
  127. Global Const PDTT_OEMDATA = PDTS_NOOEMDATA      ' Removes All OEM Data that is not x,y (such as presure and angle)
  128. Global Const PDTT_COLINEAR = PDTS_NOCOLINEAR    ' Removes successive idetical points and colinear points from pendata
  129. Global Const PDTT_COMPRESS = PDTS_COMPRESSED    ' Compresses data without loss of any information.
  130. Global Const PDTT_DECOMPRESS = &H4000           ' Decompresses Data.  Cannot be used in conjunction with other timing options.
  131. Global Const PDTT_ALL = (PDTT_PENINFO Or PDTT_UPPOINTS Or PDTT_OEMDATA Or PDTT_COLINEAR)
  132.  
  133. Global Const MAXOEMDATAWORDS = 6
  134.  
  135. Type STROKEINFO
  136.     cPnts As Integer        ' Count of points in stroke
  137.     cbPnts As Integer       ' Count of bytes used for stroke
  138.     wPdk As Integer         ' State of stroke
  139.     dwTick As Long          ' Time of stroke
  140. End Type
  141.  
  142. Type OEMPENINFO
  143.     wPdts As Integer
  144.     wValMax As Integer
  145.     wDistinct As Integer
  146. End Type
  147.  
  148. Type PENINFO
  149.     cxRawWidth As Integer           ' Max x & width of tablet in 0.01 of inch
  150.     cyRawHeight As Integer          ' Max y & height of tablet " " " "
  151.     wDistinctWidth As Integer       ' Num of distinct X values returned by tablet
  152.     wDistinctHieght As Integer      ' Num of distinct Y values returned by tablet
  153.     nSamplingRate As Integer        ' Samples/second
  154.     nSamplingDist As Integer        ' Minimum distance moved in either direction
  155.     lPdc As Long                    ' Pen Device capabilities
  156.     cbOemData As Integer            ' Width of OEM Packet
  157.     rgoempeninfo(1 To MAXOEMDATAWORDS) As OEMPENINFO
  158.     rgwReserved(1 To 8) As Integer
  159. End Type
  160.  
  161. Global Const PDT_NULL = 0
  162. Global Const PDT_PRESSURE = 1
  163. Global Const PDT_HEIGHT = 2
  164. Global Const PDT_ANGLEXY = 3
  165. Global Const PDT_ANGLEZ = 4
  166. Global Const PDT_BARRELROTATION = 5
  167. Global Const PDT_OEMSPECIFIC = 16
  168.  
  169. Global Const PDC_INTEGRATED = &H1
  170. Global Const PDC_PROXIMITY = &H2
  171. Global Const PDC_RANGE = &H4
  172. Global Const PDC_INVERT = &H8
  173. Global Const PDC_RELATIVE = &H10
  174. Global Const PDC_BARREL1 = &H20
  175. Global Const PDC_BARREL2 = &H40
  176. Global Const PDC_BARREL3 = &H80
  177.  
  178. Declare Function DuplicatePenData Lib "penwin.dll" (ByVal hPenData As Integer, ByVal gMemFlags As Integer) As Integer
  179. Declare Function CompactPenData Lib "penwin.dll" (ByVal hPenData As Integer, ByVal wTrimOptions As Integer) As Integer
  180. Declare Function BeginEnumStrokes Lib "penwin.dll" (ByVal hPenData As Integer) As Long
  181. Declare Function GetPenDataInfo Lib "penwin.dll" (ByVal hPenData As Integer, lppendataheader As PENDATAHEADER, lppeninfo As Any, ByVal dwReserve As Long) As Integer
  182. Declare Function GetPenDataStroke Lib "penwin.dll" (ByVal lppendata As Long, ByVal wStroke As Integer, lplpPoint As Any, lplpvOem As Any, lpsi As STROKEINFO) As Integer
  183. Declare Function GetPointsFromPenData Lib "penwin.dll" (ByVal hPenData As Integer, ByVal wStroke As Integer, ByVal wPnts As Integer, ByVal cPnts As Integer, lppoint As Any) As Integer
  184. Declare Function AddPointsPenData Lib "penwin.dll" (ByVal hPenData As Integer, lpPnt As Any, lpvOemData As Any, lpsiNew As Any) As Integer
  185.  
  186. '====================================================================='
  187. '=   Symbol Graph Structures                                         ='
  188. '====================================================================='
  189. Global Const MAXHOTSPOT = 8
  190.  
  191. '=== Symbol Character array =========================================='
  192. Type SYC
  193.     wStrokeFirst As Integer
  194.     wPntFirst As Integer
  195.     wStrokeLast As Integer
  196.     wPntLast As Integer
  197.     fLastSyc As Integer
  198. End Type
  199.  
  200. '=== Symbol Graph element ============================================'
  201. Type SYG
  202.     rgpntHotSpotsArray(1 To MAXHOTSPOT) As POINTSHORT
  203.     cHotSpot As Integer
  204.     nFirstBox As Integer
  205.     lRecogVal As Long
  206.     lpSye As Long
  207.     cSye As Integer
  208.     lpSyc As Long
  209.     cSyc As Integer
  210. End Type
  211.  
  212. '=== Symbol Element =================================================='
  213. Type SYE
  214.     Syv As Long
  215.     lRecogVal As Long
  216.     cl As Integer
  217.     iSyc As Integer
  218. End Type
  219.  
  220. '=== SYV values with special meanings to Windows For Pens
  221. Global Const SYV_NULL = &H0
  222. Global Const SYV_UNKNOWN = &H1
  223. Global Const SYV_EMPTY = &H3
  224. Global Const SYV_BEGINOR = &H10
  225. Global Const SYV_ENDOR = &H11
  226. Global Const SYV_OR = &H12
  227. Global Const SYV_SOFTNEWLINE = &H20
  228. Global Const SYV_SPACENULL = &H10000
  229.  
  230. '=== SYV values for gestures
  231. Global Const SYV_CLEAR = &H2FFD5
  232. Global Const SYV_EXTENDSELECT = &H2FFD8
  233. Global Const SYV_UNDO = &H2FFD9
  234. Global Const SYV_COPY = &H2FFDA
  235. Global Const SYV_CUT = &H2FFDB
  236. Global Const SYV_PASTE = &H2FFDC
  237. Global Const SYV_CLEARWORD = &H2FFDD
  238. Global Const SYV_USER = &H2FFDE
  239. Global Const SYV_CORRECT = &H2FFDF
  240. Global Const SYV_BACKSPACE = &H20008
  241. Global Const SYV_TAB = &H20009
  242. Global Const SYV_RETURN = &H2000D
  243. Global Const SYV_SPACE = &H20020
  244.  
  245. '=== Application Specific gestures circle a-z and circle A-Z
  246. Global Const SYV_APPGESTUREMASK = &H20000
  247. Global Const SYV_CIRCLEUPA = &H224B6
  248. Global Const SYV_CIRCLEUPZ = &H224CF
  249. Global Const SYV_CIRCLELOA = &H224D0
  250. Global Const SYV_CIRCLELOZ = &H224E9
  251.  
  252. '=== SYV for Shapes (if recognizer installed)
  253. Global Const SYV_SHAPELINE = &H40001
  254. Global Const SYV_SHAPEELLIPSE = &H40002
  255. Global Const SYV_SHAPERECT = &H40003
  256. Global Const SYV_SHAPEMIN = SYV_SHAPELINE
  257. Global Const SYV_SHAPEMAX = SYV_SHAPERECT
  258.  
  259. '=== To detect if SYV is a particular type, let SyvHi=(syv\&H10000)
  260. '=== Compare SyvHi with below
  261. Global Const SYVHI_SPECIAL = 0
  262. Global Const SYVHI_ANSI = 1
  263. Global Const SYVHI_GESTURE = 2
  264. Global Const SYVHI_KANJI = 3
  265. Global Const SYVHI_SHAPE = 4
  266. Global Const SYVHI_UNICODE = 5
  267. Global Const SYVHI_VKEY = 6
  268.  
  269. '====================================================================='
  270. '=   RcResult Structures                                             ='
  271. '====================================================================='
  272. Type RCRESULT
  273.     SYGraph As SYG
  274.     wResultsType As Integer
  275.     cSyv As Integer
  276.     lpsyv As Long
  277.     hSyv As Integer
  278.     nBaseLine As Integer
  279.     nMidLine As Integer
  280.     hPenData As Integer
  281.     rectboundink As RECTSHORT
  282.     pntEnd As POINTSHORT
  283.     lprc As Long
  284. End Type
  285.  
  286. Global Const RCRT_DEFAULT = &H0
  287. Global Const RCRT_UNIDENTIFIED = &H1
  288. Global Const RCRT_GESTURE = &H2
  289. Global Const RCRT_NOSYMBOLMATCH = &H3
  290. Global Const RCRT_PRIVATE = &H4000
  291. Global Const RCRT_NORECOG = &H8000
  292. Global Const RCRT_ALREADYPROCESSED = &H8
  293. Global Const RCRT_GESTURETRANSLATED = &H10
  294. Global Const RCRT_GESTURETOKEYS = &H20
  295.  
  296. Declare Function GetSymbolMaxLength Lib "penwin.dll" (lpsyg As Any) As Integer
  297. Declare Function GetSymbolCount Lib "penwin.dll" (lpsyg As Any) As Integer
  298. Declare Function SymbolToCharacter Lib "penwin.dll" (lpsyv As Any, ByVal cSyv As Any, ByVal lpstr As String, lpnCnvt As Any)
  299.  
  300. '====================================================================='
  301. '=   RC (Recognition Context) Definitions                            ='
  302. '====================================================================='
  303. Global Const CL_NULL = 0
  304. Global Const CL_MINIMUM = 1
  305. Global Const CL_MAXIMUM = 100
  306. Global Const INKWIDTH_MINIMUM = 0
  307. Global Const INKWIDTH_MAXIMUM = 15
  308. Global Const ENUM_MINIMUM = 1
  309. Global Const ENUM_MAXIMUM = 4096
  310. Global Const MAXDICTIONARIES = 16
  311.  
  312. Type GUIDE
  313.     xOrigin As Integer
  314.     yOrigin As Integer
  315.     cxBox As Integer
  316.     cyBox As Integer
  317.     cxBase  As Integer
  318.     cyBase As Integer
  319.     cHorzBox  As Integer
  320.     cVertBox  As Integer
  321.     cyMid As Integer
  322. End Type
  323.  
  324. Global Const cbRcLanguageMax = 44
  325. Global Const cbRcUserMax = 32
  326. Global Const cbRcrgbfAlcMax = 32
  327. Global Const cwRcReservedMax = 8
  328.  
  329. Type RC
  330.     hRec As Integer
  331.     hWnd As Integer
  332.     wEventRef As Integer
  333.     wRcPreferences As Integer
  334.     lRcOptions As Long
  335.     lpfnYield As Long
  336.     lpUser As String * cbRcUserMax
  337.     wCountry As Integer
  338.     wIntlPreferences As Integer
  339.     lpLanguage As String * cbRcLanguageMax
  340.     rglpdf(1 To MAXDICTIONARIES) As Long
  341.     wTryDictinary As Integer
  342.     clErrorLevel As Integer
  343.     alc As Long
  344.     alcPriority As Long
  345.     rgbfAlc As String * cbRcrgbfAlcMax
  346.     wResultMode As Integer
  347.     wTimeOut As Integer
  348.     lPcm As Long
  349.     rectBound As RECTSHORT
  350.     rectExclude As RECTSHORT
  351.     guid As GUIDE
  352.     wRcOrient As Integer
  353.     wRcDirect As Integer
  354.     nInkWidth As Integer
  355.     rgbInk As Long
  356.     dwAppParam As Long
  357.     dwDictParam As Long
  358.     dwRecognizer As Long
  359.     rgwReserved(1 To cwRcReservedMax) As Integer
  360. End Type
  361.  
  362. Declare Function InitRc Lib "penwin.dll" (ByVal hWnd As Integer, lpSrc As RC) As Integer
  363. Declare Function InstallRecognizer Lib "penwin.dll" (ByVal lpszRecogName As String) As Integer
  364. Declare Function UnInstallRecognizer Lib "penwin.dll" (ByVal hRec As Integer) As Integer
  365. Declare Function GetGlobalRC Lib "penwin.dll" (lprc As Any, ByVal lpDefRecog As String, ByVal lpDefRecog As String, ByVal cbDefDictMax As Integer) As Integer
  366. Declare Function SetGlobalRC Lib "penwin.dll" (lprc As Any, ByVal lpDefRecog As String, ByVal lpDefDict As String) As Integer
  367.  
  368. Global Const GGRC_OK = 0
  369. Global Const GGRC_DICTBUFTOOSMALL = 1
  370. Global Const GGRC_PARAMERROR = 2
  371. Global Const SGRC_OK = &H0
  372. Global Const SGRC_USER = &H1
  373. Global Const SGRC_PARAMERROR = &H2
  374. Global Const SGRC_RC = &H4
  375. Global Const SGRC_RECOGNIZER = &H8
  376. Global Const SGRC_DICTIONARY = &H10
  377. Global Const SGRC_INIFILE = &H20
  378.  
  379. '====================================================================='
  380. '=   Training And Correcting                                         ='
  381. '====================================================================='
  382. Declare Function TrainInk Lib "penwin.dll" (lprc As RC, ByVal hPenData As Integer, lpsyv As Any) As Integer
  383. Declare Function TrainContext Lib "penwin.dll" (lprcResult As RC, lpSye As Any, ByVal cSye As Integer, lpSyc As Any, ByVal cSyc As Integer) As Integer
  384. Declare Function CorrectWriting Lib "penwin.dll" (ByVal hWnd As Integer, ByVal lpstr As String, ByVal cBuf As Integer, lprc As RC, ByVal dwCwrFlags As Any, ByVal dwReserved As Any) As Integer
  385.  
  386. Global Const CWR_STRIPCR = &H1
  387. Global Const CWR_STRIPLF = &H2
  388. Global Const CWR_STRIPTAB = &H4
  389. Global Const CWR_SINGLELINEEDIT = &H7
  390. Global Const CWR_TITLE = &H10
  391.  
  392. '====================================================================='
  393. '=   Other Windows For Pens API's                                    ='
  394. '====================================================================='
  395. Declare Function BoundingRectFromPoints Lib "penwin.dll" (lpPnt As Any, ByVal cPnt, lprectBound As RECTSHORT) As Integer
  396. Declare Function TPtoDP Lib "penwin.dll" (lpPnts As Any, ByVal cPnts As Integer) As Integer
  397. Declare Function DPtoTP Lib "penwin.dll" (lpPnts As Any, ByVal cPnts As Integer) As Integer
  398. Declare Function DrawPenData Lib "penwin.dll" (ByVal hDC As Integer, lpRect As RECTSHORT, ByVal hPenData As Integer) As Integer
  399. Declare Function MetricScalePenData Lib "penwin.dll" (ByVal hPenData As Integer, ByVal wPdts) As Integer
  400. Declare Function OffsetPenData Lib "penwin.dll" (ByVal hPenData As Integer, ByVal dx As Integer, ByVal dy As Integer) As Integer
  401. Declare Function RecognizePenData Lib "penwin.dll" (lprc As RC, ByVal hPenData As Integer) As Integer
  402. Declare Function CreatePenData Lib "penwin.dll" (lppenifo As PENINFO, ByVal cbOemData As Integer, ByVal wPdtScal As Integer, ByVal gMemFlags As Integer) As Integer
  403. Declare Function ExecuteGesture Lib "penwin.dll" (ByVal hWnd As Integer, ByVal Syv As Long, lprcResult As RC)
  404.  
  405. '=== Message Routines Constants ======================================'
  406. Global Const WM_PENWINFIRST = &H380                'Main Offset for Pen messages
  407. Global Const WM_RCRESULT = WM_PENWINFIRST + 1
  408. Global Const WM_HOOKRCRESULT = WM_PENWINFIRST + 2
  409. Global Const WM_GLOBALRCCHANGE = WM_PENWINFIRST + 3
  410. Global Const WM_SKB = WM_PENWINFIRST + 4
  411. Global Const WM_HEDITCTL = WM_PENWINFIRST + 5      'Configures HEdits and BEdits
  412.  
  413. '== The constants below are used as wParam with WM_HEDITCTL message
  414. Global Const HE_GETRC = 3
  415. Global Const HE_SETRC = 4
  416. Global Const HE_GETINFLATE = 5
  417. Global Const HE_SETINFLATE = 6
  418. Global Const HE_GETUNDERLINE = 7
  419. Global Const HE_SETUNDERLINE = 8
  420. Global Const HE_GETINKHANDLE = 9
  421. Global Const HE_SETINKMODE = 10
  422. Global Const HE_STOPINKMODE = 11
  423. Global Const HE_GETRCRESULTCODE = 12
  424. Global Const HE_DEFAULTFONT = 13
  425. Global Const HE_CHARPOSITION = 14
  426. Global Const HE_CHAROFFSET = 15
  427. Global Const HE_GETRCRESULT = 22
  428.  
  429. '====================================================================='
  430. '=   END WINDOWS FOR PENS API                                        ='
  431. '====================================================================='
  432.  
  433. '====================================================================='
  434. '=  PENCNTRL.VBX Constants and Function Declarations                 ='
  435. '====================================================================='
  436.  
  437. '==  Property Settings  =============================================='
  438. ' AutoSize Property: On-Screen Keyboard Button and Ink On Bitmap controls
  439. Global Const PEN_AUTOSIZE_NONE = 0         ' No AutoSizing occurs
  440. Global Const PEN_AUTOSIZE_SIZEPICTURE = 1  ' Stretch Picture to fit Window
  441. Global Const PEN_AUTOSIZE_SIZEWINDOW = 2   ' Size Window to fit Picture
  442. Global Const PEN_AUTOSIZE_TILE = 3         ' Tile Picture: Valid for InkOnBitmap only
  443.  
  444. ' BorderStyle Property: BEdit, HEdit, and Ink On Bitmap controls
  445. Global Const PEN_BORDERSTYLE_NONE = 0      ' No Border
  446. Global Const PEN_BORDERSTYLE_SINGLE = 1    ' Single Line Border
  447. Global Const PEN_BORDERSTYLE_UNDERLINE = 2 ' Underline: Valid for HEdit only
  448.  
  449. ' CombStyle Property: BEdit control only
  450. Global Const PEN_COMBSTYLE_COMB = 0        ' Comb Style
  451. Global Const PEN_COMBSTYLE_BOX = 1         ' Box Style
  452.  
  453. ' InkDataMode Property: BEdit, HEdit, and Ink On Bitmap controls
  454. Global Const PEN_INKDATAMODE_REPLACE = 0   ' Existing Ink is replaced when new Ink is assigned to InkDataString
  455. Global Const PEN_INKDATAMODE_MERGE = 1     ' Existing Ink is merged with the new Ink assigned to InkDataString
  456.  
  457. ' InkDataMode Property: Ink On Bitmap control only
  458. Global Const PEN_INKINGMODE_DISABLED = 0   ' Inking and Erasing are disabled
  459. Global Const PEN_INKINGMODE_INKONLY = 1    ' Pen will Ink only; barrel button is disabled
  460. Global Const PEN_INKINGMODE_ERASEONLY = 2  ' Pen will Erase only; barrel button is disabled
  461. Global Const PEN_INKINGMODE_INKANDERASE = 3  ' Pen will Ink; pressing barrel button allows pen to Erase
  462.  
  463. ' InkWidth Property: BEdit, HEdit, and Ink On Bitmap controls
  464. Global Const PEN_INKWIDTH_DEFAULT = -1     ' Use system default Ink Width
  465. Global Const PEN_INKWIDTH_MIN = 0          ' Minimum Valid size; no Ink is displayed
  466. Global Const PEN_INKWIDTH_MAX = 15         ' Maximum Valid Ink Width (in Pixels)
  467.  
  468. ' ScrollBars Property: BEdit and HEdit controls
  469. Global Const PEN_SCROLLBARS_NONE = 0        ' No ScrollBars
  470. Global Const PEN_SCROLLBARS_HORIZONTAL = 1  ' Horizontal ScrollBar: Valid for HEdit only
  471. Global Const PEN_SCROLLBARS_VERTICAL = 2    ' Vertical ScrollBar
  472. Global Const PEN_SCROLLBARS_BOTH = 3        ' Both ScrollBars: Valid for HEdit only
  473.  
  474. '==  Trappable Error Strings  ========================================'
  475. Global Const PENERR_INKWIDTH = 32001        ' InkWidth must be in range 0-15 or -1 for default
  476. Global Const PENERR_NEGCELLWIDTH = 32002    ' CellWidth must be greater than 0
  477. Global Const PENERR_CELLWIDTH = 32003       ' CellWidth must be greater than or equal to CombSpacing*2
  478. Global Const PENERR_NEGCELLHEIGHT = 32004   ' CellHeight must be greater than 0
  479. Global Const PENERR_CELLHEIGHT = 32005      ' CellHeight must be greater than or equal to CombBaseLine
  480. Global Const PENERR_COMBSPACING = 32006     ' CombSpacing out of range (0 - CellWidth/2)
  481. Global Const PENERR_COMBBASELINE = 32007    ' CombBaseLine out of range (0 - CellHeight)
  482. Global Const PENERR_BIGCOMBBASELINE = 32008 ' CombBaseLine must be greater than or equal to CombHeight and CombEndHeight
  483. Global Const PENERR_COMBHEIGHT = 32009      ' CombHeight out of range (0 - CombBaseLine)
  484. Global Const PENERR_COMBENDHEIGHT = 32010   ' CombEndHeight our of range (0 - CombBaseLine)
  485. Global Const PENERR_INFLATE = 32011         ' Inflate value must be greater than or equal to 0
  486. Global Const PENERR_INVALIDPICTURE = 32012  ' Picture format not supported
  487. Global Const PENERR_DISPLAYFAILED = 32013   ' Unable to display bitmap
  488. Global Const PENERR_AUTOSIZEHW = 32014      ' Cannot change Height or Width while AutoSize equals 2
  489. Global Const PENERR_MERGEFAILED = 32015     ' Unable to merge ink data
  490. Global Const PENERR_INVALIDINKDATA = 32016  ' Invalid InkDataString format
  491.  
  492. '==  Functions Declarations  ========================================='
  493. Declare Sub VBTypeToCPointer Lib "pencntrl.vbx" (lpSrc As Any, ByVal lpDest As Long, ByVal cb As Integer)
  494. Declare Sub CPointerToVBType Lib "pencntrl.vbx" (ByVal lpSrc As Long, lpDest As Any, ByVal cb As Integer)
  495. '====================================================================='
  496.  
  497.