Announcement

Collapse
No announcement yet.

Subclassing an OCX

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Subclassing an OCX

    Hi all,

    I was wondering if someone can tell me how to subclass an
    OCX created with the JACOM dll..???

    Specifically, I have added a Flash movie on a form using JA
    and I now want to be able to move the form by clicking on the
    Flash movie and dragging...

    TIA
    Torben


    ------------------

  • #2
    Please try asking in the 3rd-Party Forum...

    Thanks!


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Torben,

      JAZZAGE has several callback functions you could use to have greater
      control on what is going on.

      Example:
      Code:
             CALL JACreateControl(hCTL&, "Content", _
                                  jX&, jY&, jW&, jH&, _
                                  "ProgID:Shell.Explorer.2;JARTKEY:Elwz6A-99AC5-951AG-6CE52-9", _
                                  1, pWebContent???)
      
             IF pWebContent??? THEN
                CALL JASetControlResizeStyle(pWebContent???, %JAHANDLE_PUNK, %JARESIZESTYLE_X2RIGHT OR %JARESIZESTYLE_Y2BOTTOM)
                CALL JASubscribeEvents(pWebContent???, [b]CODEPTR(JAContentCallBack)[/b], 1)
             END IF
      For further details ask Philippe Monteil at:
      [email protected]


      ------------------
      Patrice Terrier
      mailto[email protected][email protected]</A>
      Patrice Terrier
      www.zapsolution.com
      www.objreader.com
      Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

      Comment


      • #4
        Torben,

        I would suggest to set a hook on the OCX parent window
        and monitor the WM_SETCURSOR messages it receives...

        Philippe



        ------------------

        Comment


        • #5
          Thanks for your replys.

          I have managed to solve my problem with the following code:

          Code:
          CallBack Function DlgProc
             Select Case CbMsg
                Case %WM_INITDIALOG
                   RetMouseHook = SetWindowsHookEx(%WH_MOUSE, CodePtr(MouseHook), 0, GetCurrentThreadId)
                Case %WM_DESTROY: UnhookWindowsHookEx RetMouseHook
             End Select
          End Function
          
          
          Function MouseHook(ByVal iCode As Integer, ByVal wParam As Long, ByVal lParam As Long) As Dword
          
             Static LButtonDown as long
          	
             If iCode = %HC_ACTION Then
                Select Case wParam
                   Case %WM_LBUTTONDOWN
                      LButtonDown = %True
                   Case %WM_LBUTTONUP
                      LButtonDown = %False
                   Case %WM_MOUSEMOVE
                      if LButtonDown = %True then
                         SendMessage hDlg, %WM_NCLBUTTONDOWN, %HTCAPTION, BYVAL %NULL
                      end if
                End Select
             End If
             Function = CallNextHookEx(RetMouseHook, iCode, wParam, lParam)
          
          End Function
          [This message has been edited by Torben Marcussen (edited April 21, 2001).]

          Comment

          Working...
          X