Focus lost...

This is a discussion on Focus lost... within the Windows Programming forums, part of the Platform Specific Boards category; I have a list view control with some text in it. What I would like to do is by pressing ...

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Arrow Focus lost...

    I have a list view control with some text in it. What I would like to do is by pressing a button it will copy the marked line using:
    Code:
    SendMessage(GetFocus(), WM_COPY, 0, 0);
    But when I press the copy button, the list view control loses it's focus... what can I do?



    Thank you.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    You can copy the string to a buffer when the listview loses focus, and reset the buffer when it's read.

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    You mean detect a focus on the list-view, and copy it's value to a buffer...?
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,651
    Looking at the WM_COPY and TreeView control reference, I don't see anthing that indicates that TreeView controls support WM_COPY.

    You will probably have to perform your own clipboard operations.

    gg

  5. #5
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    codeplus, what do you think about idea of copying the marked line from the list-view to a buffer, and then copy it to the cliip board.

    I've searched the msdn, and I was unable to find a way to get the marked (focused) line, and copy that bauffer to the clip board.

    It will be great if you could point me to the right direction, it looks like you know msdn pretty well.


    thanks.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  6. #6
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Also here...

  7. #7
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    thanks
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing focus in an MFC Application
    By rangalo in forum Windows Programming
    Replies: 2
    Last Post: 06-20-2005, 06:21 AM
  2. catching keys when lost focus
    By geek@02 in forum Windows Programming
    Replies: 2
    Last Post: 06-15-2004, 01:47 AM
  3. Focus Messages?
    By PsychoBrat in forum Windows Programming
    Replies: 5
    Last Post: 12-30-2003, 06:14 AM
  4. Focus & Always-On-Top :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 06-13-2002, 05:44 PM
  5. Handles invalid when no focus?
    By Fordy in forum Windows Programming
    Replies: 6
    Last Post: 03-15-2002, 07:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21