是什么(WM_NCLBUTTONDOWN)呢? [英] What does ( WM_NCLBUTTONDOWN ) do?

查看:903
本文介绍了是什么(WM_NCLBUTTONDOWN)呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究如何使圆形状的形式在Visual Basic 6的例子中,我停在code:
公共常量WM_NCLBUTTONDOWN =安培; HA1
我只知道这是一个信息为const传递的窗口...

i was studying the example of how to make round-shape form in Visual Basic 6, and i stopped at the code : Public Const WM_NCLBUTTONDOWN = &HA1 I only know that this is a message to the windows passed as Const ...

我想知道的是:


  • 是什么&放大器; HA1

  • what is &HA1 ?

什么常量WM_NCLBUTTONDOWN吗?它送什么消息到Windows?

what does Const WM_NCLBUTTONDOWN do ? what message does it send to Windows ?

别的了。

请,谢谢

推荐答案

您与该Windows发送到一个窗口,告诉你的code的一些有趣的事情发生了邮件的工作。你会发现这个不变的形式的WndProc()方法时,运行Windows时发送消息的方法。

You are working with messages that Windows sends to a window to tell your code that something interesting happened. You'll find this constant used in the WndProc() method of a form, the method that runs when Windows sends a message.

该WM_NCLBUTTONDOWN消息的消息之一。 WM =窗口消息。 NC =非客户,这不是客户区,边框和标题栏窗口的一部分。 L =左键,你可以计算出的buttonDown。

The WM_NCLBUTTONDOWN message is one of those messages. WM = Window Message. NC = Non Client, the part of the window that's not the client area, the borders and the title bar. L = Left button, you can figure out BUTTONDOWN.

这些消息在Windows SDK文件中声明。你必须是你的机器上,该文件的版本VS2008位于C:\\ Program Files文件\\微软的SDK \\ WINDOWS \\ v6.0A \\包含\\ WINUSER.H。用文本编辑器或VS,看看里面是什么打开它。搜索消息标识符来找到这一行:

These messages are declared in a Windows SDK file. You'll have it on your machine, the VS2008 version of that file is located in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\WinUser.h. Open it with a text editor or VS to see what's inside. Search for the message identifier to find this line:

 #define WM_NCLBUTTONDOWN                0x00A1

在Windows SDK是用C编写的程序一起工作。 #定义等同于常量在VB.NET。在 0X preFIX是指在C语言中十六进制,就像和放大器; H确实在VB.NET。 Windows计算器有助于转换十六进制值转换为十进制和背部,使用View +程序员。你会看到,与放大器的原因; H是在VB.NET程序中使用,这些常量十六进制开始了在核心声明。但私人常量WM_NCLBUTTONDOWN = 161 将工作一样好(10×16 + 1)。

The Windows SDK was written to work with C programs. #define is equivalent to Const in VB.NET. The 0x prefix means 'hexadecimal' in the C language, just like &H does in VB.NET. The Windows calculator is helpful to convert hexadecimal values to decimal and back, use View + Programmer. You'll see the reason that &H is used in a VB.NET program, these constants started out in hexadecimal in the core declaration. But Private Const WM_NCLBUTTONDOWN = 161 will work just as well (10 x 16 + 1).

所以内的WndProc(),你会使用一个选择案例或者如果语句来检测消息。而当用户点击窗口标题栏上的鼠标左键,你可以做一些特别的东西。如果你忽视它,然后 MyBase.WndProc(M)运行和正常的事情发生了:在Windows启动一模式循环,让用户移动窗口。它实际上是非常的罕见的,你要停止或改变这种行为,用户是pretty喜欢自的所有的在Windows窗口的操作的方式,默认行为。唯一的消息,其行为你通常要自定义为WM_NCHITTEST。非常有用的给一个无国界的窗口边框般的行为。但是,这是另一个故事了。

So within WndProc() you'd use a Select Case or If statement to detect the message. And you can do something special when the user clicks the left mouse button on the window title bar. If you ignore it then MyBase.WndProc(m) runs and the normal thing happens: Windows starts a modal loop that lets the user move the window. It is actually very rare that you want to stop or alter that behavior, users are pretty fond of that default behavior since all windows in Windows behave that way. The only message whose behavior you'd typically want to customize is WM_NCHITTEST. Very useful to give a borderless window border-like behavior. But that's another story.

这篇关于是什么(WM_NCLBUTTONDOWN)呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆