locked
How to get a existing inkoverlay object? RRS feed

  • Question

  •     I am programming with ink. My program supports inkoverlay in order to handwrte on client document. I found that after one inkoverlay object was created , set a hWnd  and enabled, new inkoverlay object would not be enabled in the same hWnd and return 0x80280010. So I hope to know whether there is a way to find existing inkoverlay object from hWnd.
       Thank you. I am appreciated
       Best Regards

       

    Tuesday, February 6, 2007 2:55 AM

Answers

  • If the 3rd party component does not explicitly expose a public property that references the InkOverlay attached to its hWnd, then there is no way to get to it from your code.

    Thanks, Stefan Wick

    Thursday, February 8, 2007 2:07 AM

All replies

  • Hi,

    just to clarify: you can actually have more than one InkOverlay attached and enabled on the same hWnd - as long as their input rectangles do not overlap. For example you can create two InkOverlays, call SetWindowInputRectangle() on them with different, non-overlapping rectangles, attach them to the same hWnd and enable them - it will work.

    So I think your question is: how can one find out if for a given hWnd there already is an InkOverlay with an input rectangle that would overlap with a new InkOverlay instance? The answer to this question is that there is no direct way to lookup an InkOverlay from hWnd (and keep in mind: there could be multiple InkOverlays per hWnd), but you could keep track of it yourself in your app code. You could build up a table or map whenever you attach/enable an InkOverlay to an hWnd and then use that later for lookup. Would that work for your scenario?

    Thanks, Stefan Wick

    Wednesday, February 7, 2007 1:06 PM
  •  Thank you at first. but  some modules in my application are brought from third party and I have no their source code. So I am thinking of whether there is other way to find their inkoverlay object. Do you know more?

     thanks

    Thursday, February 8, 2007 1:49 AM
  • If the 3rd party component does not explicitly expose a public property that references the InkOverlay attached to its hWnd, then there is no way to get to it from your code.

    Thanks, Stefan Wick

    Thursday, February 8, 2007 2:07 AM
  • i have an application that uses multiple InkOverlay objects attached to the same Control object because i'm trying to have multiple layers of ink on the same control (ie: the user can toggle what layers of ink they want to see). It acts buggy when more than one InkOverlay is added because I was unaware multiple InkOverlays could not overlap.

    To accomplish the layering I described, would you suggest keeping track of multiple Strokes collections which can be added and removed from one InkOverlay object?

    Friday, June 8, 2007 6:30 PM
  • Hi marklar kotm,

     

    I would recommend using different ink objects that you swap in and out of a single InkOverlay that is attached to your hWnd. The AutoClaims sample that comes with the SDK demonstrates how to do this with an InkPicture control. The concept is the same for InkOverlay (regardless of managed or native code).

     

    Thanks,

    Stefan Wick

    Sunday, June 10, 2007 10:25 PM