Get the coordinates of a WM_NCHITTEST message?

前端 未结 3 1207
孤城傲影
孤城傲影 2020-12-18 00:45

How do I get the coordinates of a WM_NCHITTEST message in C# code?
I\'d love to get the fastest way, because performance is a requirement.

3条回答
  •  -上瘾入骨i
    2020-12-18 01:23

    I know this question was already answered and all but...

    Point p = new Point(m.LParam.ToInt32());
    

    System.Drawing.Point now has a constructor specifically designed to accept this exact value. Strictly speaking, I think this is probably the easiest way.

    To be perfectly honest, I have no idea if this constructor even existed when the other answers were posted.

    That all being said, this probably isn't any faster because takrl's answer is almost certainly what the aforementioned constructor does internally anyway.

提交回复
热议问题