CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    327

    how can I let the user copy from but not paste anything to the SDI child area

    How can I let the user copy information from the SDI child area but
    not paste anything to the SDI child area? Currently, the user can not
    copy nor paste anything from or to the SDI child area. It's somehow
    locked!

    Any response any one can give me will be greatly appreciated.


  2. #2
    Join Date
    Apr 1999
    Posts
    53

    Re: how can I let the user copy from but not paste anything to the SDI child area

    Dear Danielle,

    To let the user copy from your view window, you need to keep track of what is in the window, and the screen coordinates of everything that a user might be able to select. This will depend on whether you have text or graphics. This is usually done by keeping track of the "bounding rectangle" of the objects you are displaying.

    Next, you need to be able to trap the coordinates of the window area the user has selected (usually via mouse down and mouse up events).

    (Or, for text, get the area of the window selected and figure out which characters from your file fall into that area -- not always easy to do!)

    Once you have this information, you can copy whatever was selected to the clipboard. This is usually in CF_TEXT or CF_BITMAP format.

    To prevent pasting, you don't have to do anything. Pasting won't work unless you implement code to intercept a paste action and handle it.

    You could also maybe try making your view window into a big edit box area or RTF control of some sort.

    I hope this gives you a strategy,
    Wes Rogers


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured