Moveing a window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tomomichi Amano

    #1

    Moveing a window

    (addition to my last question)
    I want to make it possible to move a window with out a titlebar USEING a
    mouse.

    Thanks in advcance

  • b. hotting

    #2
    Re: Moveing a window

    what about, use client area drag?
    track the mouse and move the window yourself.

    in vc6.0, Jeff Prosise had a clock app. (without a title bar) where he
    'fooled' windows by rerouting the OnNcHitTest message, don't know how to do
    that (yet) in c#, perhaps someone else?
    hope it helps.


    "Tomomichi Amano" <tomomichi_a@ho tmail.com> wrote in message
    news:ebcqK5RfDH A.2172@TK2MSFTN GP09.phx.gbl...[color=blue]
    > (addition to my last question)
    > I want to make it possible to move a window with out a titlebar USEING a
    > mouse.
    >
    > Thanks in advcance
    >[/color]


    Comment

    • Du Dang

      #3
      Re: Moveing a window

      Hey,

      Here wat i found on the google awhile back

      // Import
      using System.Runtime. InteropServices ;

      // place it Anywhere
      public const int WM_NCLBUTTONDOW N = 0xA1;
      public const int HTCAPTION = 0x2;
      [DllImportAttrib ute ("user32.dll ")]
      public static extern int SendMessage(Int Ptr hWnd, int Msg, int wParam, int
      lParam);
      [DllImportAttrib ute ("user32.dll ")]
      public static extern bool ReleaseCapture( );


      // create a OnMouseDown event [ex. a label etc.]
      ReleaseCapture( );
      SendMessage(Han dle, WM_NCLBUTTONDOW N, HTCAPTION, 0);

      hope that helps

      Du

      "Tomomichi Amano" <tomomichi_a@ho tmail.com> wrote in message
      news:ebcqK5RfDH A.2172@TK2MSFTN GP09.phx.gbl...[color=blue]
      > (addition to my last question)
      > I want to make it possible to move a window with out a titlebar USEING a
      > mouse.
      >
      > Thanks in advcance
      >[/color]


      Comment

      • gary hitch

        #4
        Re: Moveing a window

        try this using API - don't know if there is a .Net way for this:

        [DllImport("User 32.dll", EntryPoint="Sen dMessageA")]
        static extern Int32 SendMessage (IntPtr hWnd, Int32 wMsg, Int32 wParam, int
        lParam);

        [DllImport("User 32.dll")]
        static extern Int32 ReleaseCapture ();

        private const int HTCAPTION = 2;
        private const int WM_NCLBUTTONDOW N = 161;

        private void Form1_MouseDown (object sender,
        System.Windows. Forms.MouseEven tArgs e)
        {
        ReleaseCapture( );
        SendMessage ( this.Handle, WM_NCLBUTTONDOW N, HTCAPTION, 0 );
        }


        "Tomomichi Amano" <tomomichi_a@ho tmail.com> wrote in message
        news:ebcqK5RfDH A.2172@TK2MSFTN GP09.phx.gbl...[color=blue]
        > (addition to my last question)
        > I want to make it possible to move a window with out a titlebar USEING a
        > mouse.
        >
        > Thanks in advcance
        >[/color]


        Comment

        Working...