Floating toolbar - here's some code to do it

Hi all!

This article is almost identical to the one that I posted in comp.lang.pascal...
If you haven't tried Delphi from Borland you should definitely do so, it's worth it.

Even if you aren't currently into Delphi, you can easily transform the code in
this post to fit your needs. It's "almost" identical to the C code I stole it
from... Oops, why did I admit that? ;-)

Someone asked for some code to make a form with no title bar moveable, kind of like a
floating toolbar, for example FreeDock. Actually, for some of the stuff in here I
spied on the FreeDock sources...

This requires the use of some WinAPI functions. All WinAPI functions are however
available at a touch of a key (F1 - OnLine Help)...

Here's some code that does this (about 100 lines)...

To make this work like intended:

  EITHER grab the uuencoded stuff at the bottom of this post. The uuencoded part includes
  the unit, the project file, the resource file and the form file.

  OR start a new project, make the form's borderstyle bsNone, add a panel, set the border
  style of the panel to bsSingle, add another panel with some caption, add a button that
  says 'toggle title bar', cut out the below code and insert it were it should be, enable
  the panel's three event handlers (MouseDown, MouseMove, MouseUp), enable the button's
  event handler (Click). Hope I didn't forget anything... ;-) It's done faster in Delphi
  than it's written here... ;-)

Have fun, and while you're at it, go grab the two Delphi projects at my homepage
http://www.it.kth.se/~ao/...

-----------------------------------------------------------------------------
!  The Windoze program you want is at http://www.it.kth.se/~ao/yacpu20.zip  !
!                                                                           !
!          Anders Ohlsson - ao@sto.foa.se - http://www.it.kth.se/~ao        !
-----------------------------------------------------------------------------


