WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Microsoft InkEdit COMCONTROL

 Keywords:  Ink Edit InkEdit COMCONTROL 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Author: IFICantBYTE
;;
;; Made the following to play around with the Microsoft ink control.
;; It doesn't do anything very useful as is, but could be the basis for something in a touch screen environment?
;; The text recognition is pretty impressive. Hope you find it helpful one day for something ....IFICantBYTE
;;
;;
;; Refer to : https://msdn.microsoft.com/en-us/library/ms823910.aspx
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#DefineSubRoutine DlgTest(Dlg_Handle, Dlg_Message, Dlg_ID, Dlg_EventInfo, Dlg_ChangeInfo)
   COM_CHANGE = 1 ; User specified identifier for "change" event.
   COM_CLICK  = 2  ; User specified identifier for "click" event.

   Switch Dlg_Message
      Case @deinit
         DialogProcOptions( Dlg_handle, @depbpush, 1 )
         ; Handle mouse click events.
         DialogObject(Dlg_Handle, "ComControl_1", @doaddevent, "Change", COM_CHANGE)
         DialogObject(Dlg_Handle, "ComControl_1", @doaddevent, "Click", COM_CLICK)
         ; Get an object reference to the com control.
         objCom = DialogObject(Dlg_Handle, "ComControl_1", @dogetobject)
         objCom.Text = "Use the mouse or draw some text directly on a touch screen in this window, then wait a couple of seconds for text recognition."
         objcom.MousePointer=2 ; 0=default dot, 1=Arrow, 2=Cross, 3=Ibeam, 4=SizeNE-SW, 5=SizeN-S, 6=SizeNW-SE, 7=SizeW-E, 8=Up, 9=Hourglass/WaitCircle, 10=NoDrop, 11=Arrow+Hourglass/WaitCircle, 12=Arrow+?, 13=Size, 14=PointingHand, 99=CustomIcon specified by MouseIcon property
         objcom.UseMouseForInput=@true
         blue = 250
         green = 200
         red = 200
         objcom.BackColor=blue*256*256+green*256+red
         objcom.Enabled=@true
         objcom.RecognitionTimeout=2000
         objcom.InkMode=2 ;0=disabled, 1=ink collected, 2=ink and single stroke gestures
         objcom.InkInsertMode=0  ;0=text, 1=ink
         objcom.Locked=@false
         objcom.SelFontName="Times"
         objcom.SelFontSize=20
         blue = 10
         green = 10
         red = 170
         objcom.SelColor=blue*256*256+green*256+red
         Break

      Case @decomevent
         ; Correct COM control and event?
         If Dlg_ID == "ComControl_1"
            If Dlg_EventInfo.identifier == COM_CHANGE
               Message("CHANGE","changes detected to text in ink area")
            ElseIf Dlg_EventInfo.identifier == COM_CLICK
               ; Message("CLICK","mouse click detected on ink area")
            EndIf
         EndIf
         Break

      Case @depbpush
         If Dlg_ID == "PushButton_OK"
            text = objCom.Text
            Message("Plain text returned",text)
            rtftext = objCom.TextRTF
            Message("RTF text returned",rtftext)
         EndIf
         If Dlg_ID == "PushButton_Cancel"
             ; Release Objects.
             Dlg_EventInfo = 0
             objCom = 0
             Return(-1)
         EndIf
         Break

   EndSwitch
   Return(-2)
#EndSubRoutine ; End of Dialog Callback.


MyDialogFormat=`WWWDLGED,6.2`

MyDialogCaption=`WIL Dialog 1`
MyDialogX=220
MyDialogY=072
MyDialogWidth=584
MyDialogHeight=359
MyDialogNumControls=003
MyDialogProcedure=`DlgTest`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`171,339,036,012,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`377,339,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`013,011,554,318,COMCONTROL,"ComControl_1",DEFAULT,"InkEd.InkEdit.1",DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog")

Article ID:   W18500
Filename: Microsoft InkEdit COMCONTROL.txt
File Created: 2015:05:30:09:43:32
Last Updated: 2015:05:30:09:43:32