DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Moving a borderless form on W2K

  1. #1
    Bruce Guest

    Moving a borderless form on W2K

    Hi guys...
    the following code (to move a borderless form, using any other control as the
    movebar)
    work ok on win9x... but on win2k , it doesn't work (no move, no error)..
    i've not tried nt4,
    somebody know what changes i gotta do to make it work on w2k ?

    Private Sub MoveArea_MouseDown(Button As Integer, Shift As Integer, x As Single,
    y As Single)
    Dim Ret&
    ReleaseCapture
    Ret& = SendMessage(Me.hWnd, &H112, &HF012, 0)
    End Sub

    --


    Atte.
    Ivan Barrera A.
    Telefónica Internet Empresas





  2. #2
    Don Bradner Guest

    Re: Moving a borderless form on W2K

    "Bruce" <Bruce@Ivn.Cl> wrote:

    >Hi guys...
    >the following code (to move a borderless form, using any other control as the
    >movebar)
    >work ok on win9x... but on win2k , it doesn't work (no move, no error)..
    >i've not tried nt4,
    >somebody know what changes i gotta do to make it work on w2k ?


    NT/Win2K is highly sensitive about integer values being passed when it expects
    longs. In this case change &H112 to &H112&, and &HF012 to &HF012& to
    explicitly make them longs.

    >Private Sub MoveArea_MouseDown(Button As Integer, Shift As Integer, x As Single,
    >y As Single)
    > Dim Ret&
    > ReleaseCapture
    > Ret& = SendMessage(Me.hWnd, &H112, &HF012, 0)
    >End Sub


    --
    Don Bradner
    don@arcatapet.com
    www.arcatapet.net

  3. #3
    Bruce Guest

    Re: Moving a borderless form on W2K

    Yeap. It was that..
    Thx


    "Don Bradner" <don@arcatapet.com> escribió en el mensaje
    news:ed4gotscbcptp2e9qobh1uuahs0fgktqon@4ax.com...
    > "Bruce" <Bruce@Ivn.Cl> wrote:
    >
    > >Hi guys...
    > >the following code (to move a borderless form, using any other control as the
    > >movebar)
    > >work ok on win9x... but on win2k , it doesn't work (no move, no error)..
    > >i've not tried nt4,
    > >somebody know what changes i gotta do to make it work on w2k ?

    >
    > NT/Win2K is highly sensitive about integer values being passed when it expects
    > longs. In this case change &H112 to &H112&, and &HF012 to &HF012& to
    > explicitly make them longs.
    >
    > >Private Sub MoveArea_MouseDown(Button As Integer, Shift As Integer, x As

    Single,
    > >y As Single)
    > > Dim Ret&
    > > ReleaseCapture
    > > Ret& = SendMessage(Me.hWnd, &H112, &HF012, 0)
    > >End Sub

    >
    > --
    > Don Bradner
    > don@arcatapet.com
    > www.arcatapet.net




  4. #4
    Dean Earley Guest

    Re: Moving a borderless form on W2K

    I tend to do it like this:

    Dim StartX As Long
    Dim StartY As Long

    Private Sub MoveArea_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    StartX = X
    StartY = Y
    End Sub

    Private Sub MoveArea_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then Me.Move Me.Left - (StartX - X), Me.Top - (StartY - Y)
    End Sub

    It also means you can validate the position before moving

    --
    Dean Earley (dean.earley@icode.co.uk)
    Assistant Developer

    iCode Systems
    "Bruce" <Bruce@Ivn.Cl> wrote in message news:3b88073c@news.devx.com...
    > Hi guys...
    > the following code (to move a borderless form, using any other control as the
    > movebar)
    > work ok on win9x... but on win2k , it doesn't work (no move, no error)..
    > i've not tried nt4,
    > somebody know what changes i gotta do to make it work on w2k ?
    >
    > Private Sub MoveArea_MouseDown(Button As Integer, Shift As Integer, x As Single,
    > y As Single)
    > Dim Ret&
    > ReleaseCapture
    > Ret& = SendMessage(Me.hWnd, &H112, &HF012, 0)
    > End Sub
    >
    > --
    >
    >
    > Atte.
    > Ivan Barrera A.
    > Telefónica Internet Empresas
    >
    >
    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center