Results 1 to 3 of 3

Thread: [repost] Show window content while dragging

  1. #1

    Thread Starter
    Addicted Member Sibby's Avatar
    Join Date
    Feb 2001
    Location
    Milwaukee, WI *The United States of America*
    Posts
    144

    [repost] Show window content while dragging

    (let's try the API guru forum)

    I want to enulate the same thing you see when moving a form with the "Show window content while dragging" option turned on....but instead through code. Right now I'm using code based on an image with a MASK color for custom forms. So in that I'm using the RELEASECAPTURE & SENDMESSAGE API in the pictures MouseDown event to move the form. However, when I do that I get the window outline when moving. (looks bad).

    So I tried the simple approach (see code below) and that yeilded a NASTY "trailing" effect on my image. (It's fun to mess the hell out of your screen , but that's not really what the app is for)However when I go back to the original approach and turn on "Show window content while dragging" it looks spectacular! I just don't want the user to have to turn this on in order to get a good looking app. Windows can do it, I want to too...

    Any ideas?

    VB Code:
    1. Dim pX As Single, pY As Single
    2.  
    3. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    4.     pX = X
    5.     pY = Y
    6. End Sub
    7.  
    8. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    9.     If Button = 1 Then
    10.         Move Left - (pX - X), Top - (pY - Y)
    11.     End If
    12. End Sub
    If you can think it....you can code it....

  2. #2

    Thread Starter
    Addicted Member Sibby's Avatar
    Join Date
    Feb 2001
    Location
    Milwaukee, WI *The United States of America*
    Posts
    144
    *bump*

    anyone?
    If you can think it....you can code it....

  3. #3
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    In your form's MouseMove you're going to do something like this...


    VB Code:
    1. If Button = 1 Then 'obviously don't do anything if no button is down
    2. ReleaseCapture(Me.Hwnd)
    3. Call SendMessage(Me.Hwnd, WM_SYSCOMMAND, 0, 0)
    4. End If

    I don't have VB here but this is almost exactly what you need.
    Please rate my post.

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