Results 1 to 4 of 4

Thread: LVM_CREATEDRAGIMAGE truncating half the item

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    LVM_CREATEDRAGIMAGE truncating half the item

    This is what I get for trying to do a simple drag drop instead of my normal complicated nightmare lol...

    Trying to create a drag image for plain text in a checkbox list, and this is the result:

    Name:  coldragimg.jpg
Views: 158
Size:  16.8 KB

    I was just using Edanmo's tried and true code for this,
    Code:
                                Dim tPoint As oleexp.POINT
                               m_lIL = SendMessage(hLVC, LVM_CREATEDRAGIMAGE, lvcCurSel, tPoint)
    
                               ' Start the image dragging
                               ImageList_BeginDrag m_lIL, 0, 10, 10
                               ImageList_DragEnter 0, 0, 0
    
                               ' Start the timer
                               If m_lColDragTmrProc = 0& Then m_lColDragTmrProc = scb_SetCallbackAddr(4, 20, , , True)
                               m_lTimer = SetTimer(0, 0, 1, m_lColDragTmrProc)
    It's just a standard API created ListView... nothing too crazy. Not sure why it's cutting the image off? I did try grabbing the image from the main ListView... that shows the icon and no text at all. I remember this working in the past though...

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: LVM_CREATEDRAGIMAGE truncating half the item

    Out of curiosity, if LV style is default (no checkboxes), does it work as expected?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,651

    Re: LVM_CREATEDRAGIMAGE truncating half the item

    It's cutting off about 4-5 pixels still without checkboxes; half the first letter (and the entire thing has a black background, not just the part after the text, but the letters are white so still visible). Suppose it's not a big deal since I've got the insert mark bar working and it's for internal re-ordering only, and it's just plain text, but still annoying.
    Last edited by fafalone; Oct 14th, 2020 at 04:18 PM.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: LVM_CREATEDRAGIMAGE truncating half the item

    Code:
    ImageList_BeginDrag m_lIL, 0, 10, 10
    Have you played with the last 2 parameters above? Per MSDN:
    The x,y coordinates of the location of the drag position relative to the upper-left corner of the image
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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