Click to See Complete Forum and Search --> : Back in the old days we didn't have these problems...
V(ery) Basic
May 12th, 2001, 12:58 PM
And I was not referring to laws on paedophilia, but instead of skinning forms for computer owners who have their Windows Operation System set to drag an outline rectangle instead of the whole form.
When I now proceed to drag my little skinned thing which one could only call a 'thing' its size increases and it becomes a rectangle, confusing the poor brain-dead incompetent blundering harlequin who will inevitably end up using this: Me. Okay, and perhaps some others.
However WinAmp has perfected the art of dragging normally (no little dotty rectangle is displayed)
And if you or any of the technical genii at NullSoft could inform me, o petty me, o meagre, pitiful me, as to how this can be achieved, I would be greatly ... chuffed.
So there.
Thank you for your time.
Time is money.
Money is knowledge.
Knowledge is power.
Thank you for your power.
Wait a minute...
I'd like to use some of these smilies...
;) :o :mad: :rolleyes: :confused: :eek: :cool: ;) :mad: :o :) :( :confused: :confused: :rolleyes: :mad: :D ;) :p :p :cool: :cool: :eek: :eek:
Thank you.
Aaron Young
May 12th, 2001, 05:23 PM
This is because they don't use the system default window moment (via the Caption bar), instead they reposition the form themselves, i.e.
In a Form: (set the Caption to Nothing and ControlBox to False, then add a picturebox to the form to use as your manual Caption bar.)Option Explicit
Private lInitX As Single, lInitY As Single
Private Sub Form_Resize()
picCaptionBar.Move 0, 0, ScaleWidth
End Sub
Private Sub picCaptionBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
lInitX = X 'Store the Offset Coords
lInitY = Y
End If
End Sub
Private Sub picCaptionBar_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
'Reposition the Form using the Offset Values from the Current Coords
Move Left + (X - lInitX), Top + (Y - lInitY)
End If
End Sub
V(ery) Basic
May 13th, 2001, 03:00 AM
Sorry since I clearly took too many liberties in my explanation, Aaron; I will write my letter with a more logical approach:
I have a skinned form.
I use the APIs:
Call SendMessage(frmMain.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&)
Call ReleaseCapture
To move the form about since it doesn't have a title bar.
HOWEVER, Windows (ME) still thinks it should give my form one of those dotted-outlined-rectangles which are a result of not checking the 'Show Window Contents When Dragging' box in Control Panel.
WinAmp, however, moves as if the aforementioned checkbox HAD been clicked.
How do I do that?
Aaron Young
May 13th, 2001, 12:12 PM
Well, if you don't use the API's and use my example, you can achieve what you want, most likely WinAmp does something very similar.
V(ery) Basic
May 14th, 2001, 01:17 PM
:rolleyes:
Oooooooooooh.
No need to take that tone with me, young man.
The youth of today has no manners. Programmers not been seen nor heard but merely inferred from the existance of computer programs.
:eek:
I am sure WinAmp does do something very similar, but WinAmp is made in C++ which can actually do something like that at a speed which is reasonable. I, however, have to deal with the wild, lashing Proteus that is Visual Basic. And therefore I was wondering if there was perhaps another way.
A third way?
(I'll take silence as a no)
Aaron Young
May 14th, 2001, 04:18 PM
Sorry if I offended you, no Tone was intended, I thought we had merely crossed wires and was trying to clarify.
If you have tried the solution offered and it wasn't good enough for what you want that's fine, my misunderstanding.
V(ery) Basic
May 15th, 2001, 02:02 PM
Thank you very much Mr Young ;)
I did try it, but I found that there was a bit of a delay (probably due too my poor little hamster tiring while it was running the computer) , but thank you for answering which is more than the other 18285 members could do.
swingsetacid
Jun 13th, 2001, 01:03 PM
actually, i used that both the API and non-API techniques a while ago on a project(i hate the annoying dotted-dragger as well) and i didn't experience any delay w/o API unless i had multiple forms displayed, and it was much simpler and efficient. So, I went the hard route and didn't show modally. It worked well. Oh, and I think the big problem with your post, V(ery), is that it took too long to read. Next time take a big breath before posting, and just spit out your question. Saves time for all us forum browsers. Thanks.
letxa2000
Jun 18th, 2001, 05:12 PM
... Or just don't use weirdly shaped windows.
I hate it when programs think they need to get funky and make windows that aren't rectangles. I usually throw such programs out without further testing.
crispin
Jun 19th, 2001, 07:36 AM
don't know if this might give you a pointer in the right direction:
http://groups.google.com/groups?q=drag+window+not+outline&start=20&hl=en&safe=off&rnum=30&ic=1&selm=36488d47.0%40tsnews.clarion.com
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.