MickDoherty
Fri Sep 05 13:17:01 CDT 2008
Why are my messages appearing in this MS hosted Web based newsreader, but not
through the newsgroup readers (Outlook Express, Windows Live Mail)?
This appears to have happened several times in the last week or so!
--
http://dotnetrix.co.uk/nothing.html
"Mick Doherty" wrote:
> Hi Ankit,
>
> That looks very much like the first example on my Forms tips page, which is
> just a quick hack.
> You'll need to override WndProc() and look for the message you sent, which
> will actually be recieved when the mouse button is released.
>
> --8<----------------------
>
> protected override void WndProc(ref Message m)
> {
> base.WndProc(ref m);
>
> if (m.Msg == WM_NCLBUTTONDOWN)
> {
> //This will actually occur at MouseUp
> Point pt = this.PointToClient(Cursor.Position);
> MouseEventArgs mev = new MouseEventArgs(MouseButtons.Left,
> 0, pt.X, pt.Y, 0);
> OnNonClientMouseUp(this, mev);
> }
> }
>
> private void OnNonClientMouseUp(object sender, MouseEventArgs e)
> {
> //Your Non-ClientRectangle MouseUp code goes here
> MessageBox.Show(e.Location.ToString());
> }
>
> --8<----------------------
>
> It's a little more work, but you'd be better off using the last example on
> the same page.
>
>
http://dotnetrix.co.uk/form.htm
>
> --
> Mick Doherty
>
http://dotnetrix.co.uk/nothing.htm
>
> <aagarwal8@gmail.com> wrote in message
> news:8b8985f8-d9aa-42cb-9c80-a304474e5583@a3g2000prm.googlegroups.com...
> >
> > hi,
> >
> > Currently i am using the following code to move my borderless form,
> > where i have my own titlebar using a panel.
> >
> > private const int WM_NCLBUTTONDOWN = 0xA1;
> > private const int HTCAPTION = 0x2;
> >
> > [DllImport("user32.dll")]
> > public static extern bool ReleaseCapture();
> > [DllImport("user32.dll")]
> > public static extern int SendMessage(IntPtr hWnd, int Msg, int
> > wParam, int lParam);
> >
> > private void panel1_MouseDown(object sender, MouseEventArgs e)
> > {
> > if (e.Button == MouseButtons.Left)
> > {
> > ReleaseCapture();
> > SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
> > }
> > }
> >
> > This code picks up the Windows setting of whether to show the window
> > contents while dragging or not.
> >
> > However, i want to always hide the contents of my window while
> > dragging. Is there a way to achieve this?
> >
> > Also, with this code when i try to hook the MouseUp event of my
> > panel1, i am not able to do so. After i perform a mouse click, the
> > control doesnt transfer to the event handler.
> >
> > Solution to either of the problems will be of great help
> >
> > Regards,
> > Ankit!
>
>