C++Builder设置完BorderStyle的值为none,以后如何实现窗口的移动和拉伸
在.h 文件中声明变量private: void __fastcall WndProc(TMessage &Msg);// User declarations;
在.cpp中实现下面的函数
void __fastcall TForm1::WndProc(Messages::TMessage& Message) {
TForm::WndProc(Message); // Inherited implementation
if (Message.Msg == WM_NCHITTEST) {
TWMNCHitTest& oMsg = reinterpret_cast<TWMNCHitTest&>(Message);
TPoint oPoint(oMsg.XPos, oMsg.YPos); // Screen coordinates
oPoint = ScreenToClient(oPoint); // Now in form-local coordinates
// It's in the title bar (caption) if it's in a rectangle at the top of the form
if ((oPoint.x > 0 && oPoint.x < ClientWidth-300) &&
(oPoint.y >0 && oPoint.y < 100))
{
oMsg.Result = HTCAPTION;
} else{
// 分解当前鼠标的坐标
int nPosX = LOWORD(Message.LParam);
int nPosY = HIWORD(Message.LParam);
if(nPosX >= Left + Width - 2 && nPosY >= Top + Height - 2)
{
// 鼠标位置在窗体的右下角附近
Message.Result = HTBOTTOMRIGHT;
return;
}
else if(nPosX >= Left + Width -2)
{
// 鼠标位置在窗体右侧
Message. Result = HTRIGHT;
return;
}
else if(nPosY >= Top + Height - 2)
{
// 鼠标位置在窗体下方
// 本文转自 C++Builder研究 - http://www.ccrun.com/article.asp?i=990&d=70jx1b
Message.Result = HTBOTTOM;
return;
}
}
}
}
C++Builder设置完BorderStyle的值为none,以后如何实现窗口的移动和拉伸的更多相关文章
- Struts拦截器设置完的值为什么在页面取不到
Struts拦截器设置完的值为什么在页面取不到. ActionContext ac = (ActionContext) invocation.getInvocationContext(); ac.pu ...
- mysql设置timpstamp的默认值为 '0000-00-00 00:00:00' 时报错
问题:mysql设置timpstamp的默认值为 '0000-00-00 00:00:00' 时报错: ERROR 1067 (42000): Invalid default value for 'u ...
- 设置UITableView的separatorInset值为UIEdgeInsetsZero,分隔线不最左端显示的问题
一.问题描述 UITableView分割线要显示到最左端 查看UITableView的属性,发现设置separatorInset的值可以自定义分割线的位置. @property (nonatomic) ...
- 设置easyui input默认值
/*设置input 焦点*/ $(function () { //集体调用 $(".formTextBoxes input").each(function () { $(this) ...
- 定义设置颜色的RGB值的宏
//定义设置颜色的RGB值的宏 #define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha ...
- SharePoint 设置Lookup 字段的值
如何设置Lookup字段的值, 首先我们同样需要了解SPFieldLookupValueCollection和SPFieldLookupValue, 这2个类的原理和之前所讲解到SPFieldUser ...
- JQuery获取与设置HTML元素的值value
JQuery获取与设置HTML元素的值value 作者:简明现代魔法图书馆 发布时间:2011-07-07 10:16:13 20481 次阅读 服务器君一共花费了13.221 ms进行了6次数据库查 ...
- Redis设置内存最大占用值
Redis设置内存最大占用值: Redis设置占用物理机最大的内存 #占用最大20G maxmemory 20480mb Redis设置内存装不下了,有限删除即将过期的 当前已用内存超过maxmemo ...
- 二货Mysql中设置字段的默认值问题
Mysql设置字段的默认值的确很落伍 1.不支持函数 2.只支持固定常量. 经常用到的日期类型,因为不支持getdate或者now函数,所以只能设置timestamp类型 而且还必须在默认值那个地方写 ...
随机推荐
- JavaScript DOM编程艺术读书笔记(四)
第十章 实现动画效果 var repeat = "moveElement('"+elementID+"',"+final_x+","+fin ...
- hive中分号问题
分号是sql的结束符,在hql中亦如此,但是hive对分号的识别没有那么智能,如下: select concat(';','aa') from lhc limit 1; FAILED: Parse E ...
- ubuntu apt 安装
1. ./autogen.sh: libtoolize: not found sudo apt-get install aptitude sudo aptitude install libtool 2 ...
- VScode常用几个前端插件live HTML previewer和debugger for chrome的配置
之前一直都是用sublime Text和chrome配合来写前端的页面,自从知道了有liveReload这个神奇的插件之后感觉爽翻了啊.好吧跑远了........ 话说最近微软搞了个VScode,听说 ...
- Socket accept failed
启动tomcat显示如下错误: java.net.SocketException: select failed at java.net.PlainSocketImpl.socketAccept(Nat ...
- 原生js arguments 用法
http://note.youdao.com/noteshare?id=fcd201e872e1ede16ce0057a1909f613
- C# 文件操作 把文件读取到字节数组
string zipfile = "c:\\a.zip"; //方法1 FileStream fs = new FileStream(zipfile, FileMode.Open) ...
- HR开发 操作信息类型数据
1.通过函数操作. . DATA: ZRETURN TYPE BAPIRETURN1, ZPAKEY TYPE BAPIPAKEY. GET PERNR. LOOP AT P0001 WHERE .. ...
- convas demo1
1 getContext 语法 Canvas.getContext(contextID) 参数 参数 contextID 指定了您想要在画布上绘制的类型.当前唯一的合法值是 "2d" ...
- redirect和forward
1.重定向 <mvc:view-controller path="/" view-name="redirect:/admin/index"/>即如果 ...