随笔分类 -  Delphi-消息应用

摘要:unit Unit1; interface usesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, shellapi, StdCtrls; type TForm1 = class(TForm) Mem 阅读全文
posted @ 2016-02-25 18:39 findumars 阅读(1440) 评论(0) 推荐(0) 编辑
摘要:procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin ReleaseCapture; Perform(WM_SYSCOMMAND,$ 阅读全文
posted @ 2016-02-25 18:37 findumars 阅读(414) 评论(0) 推荐(0) 编辑
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private decl 阅读全文
posted @ 2016-02-25 18:34 findumars 阅读(274) 评论(0) 推荐(0) 编辑
摘要:procedure TForm1.pnl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin ReleaseCapture;SendMessage(pnl1.Handle, 阅读全文
posted @ 2016-02-25 18:22 findumars 阅读(834) 评论(0) 推荐(0) 编辑
摘要:1.MouseMove事件中加入: // ReleaseCapture;// Perform(WM_SYSCOMMAND, $F017 , 0); 2.MouseDown事件中加入: // POSTMESSAGE(Self.Handle,WM_LBUTTONUP,0,0);// POSTMESSAG 阅读全文
posted @ 2016-02-25 18:00 findumars 阅读(4824) 评论(0) 推荐(0) 编辑
摘要:在使用delphi创建模态窗体的时候最小化窗体会导致最小化的窗体不可见,再次点击主窗体才会显示。 在这个模态窗体中增加以下函数 procedure WmSysCommand(var msg: TMessage); message WM_SYSCOMMAND; procedure TForm1.WmS 阅读全文
posted @ 2016-02-05 22:57 findumars 阅读(669) 评论(0) 推荐(0) 编辑
摘要:http://blog.csdn.net/yanjiaye520/article/details/7942499 阅读全文
posted @ 2015-12-15 18:08 findumars 阅读(1784) 评论(0) 推荐(1) 编辑
摘要:unit Unit1;interfaceusesWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;typeTForm1 = class(TForm)private{ Private declaration... 阅读全文
posted @ 2015-12-02 06:30 findumars 阅读(610) 评论(0) 推荐(0) 编辑
摘要:先看效果图吧。最近做Web,发现网页三剑客总是会留下一些“最近打开项目”这样的痕迹在软件的界面上,心里总是觉得很不舒服,于是萌发了写一个清除器的念头。说动手就动手吧! DW、FW、Fl 的这些痕迹都是存在于注册表中的,简单原理就是删除注册表里的值就ok了,这些应该没有什么好说的,所以我就不说了。今天... 阅读全文
posted @ 2015-12-01 17:27 findumars 阅读(356) 评论(0) 推荐(0) 编辑
摘要:procedure imgListMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);private procedure WMNCHITTEST(var Msg: TWMNCHITTE... 阅读全文
posted @ 2015-11-26 22:32 findumars 阅读(564) 评论(0) 推荐(0) 编辑
摘要:[delphi]view plaincopyprint?procedureTfrmMain.btnSendClick(Sender:TObject);varhCalc,h1:Cardinal;beginWinExec('calc',SW_SHOWNORMAL);//运行计算器hCalc:=FindW... 阅读全文
posted @ 2015-11-26 21:56 findumars 阅读(391) 评论(0) 推荐(0) 编辑
摘要:unit MultInst;interfaceconst MI_QUERYWINDOWHANDLE = 1; MI_RESPONDWINDOWHANDLE = 2; MI_ERROR_NONE = 0; MI_ERROR_FAILSUBCLASS = 1; MI_E... 阅读全文
posted @ 2015-11-15 06:52 findumars 阅读(312) 评论(0) 推荐(0) 编辑
摘要:通过响应“wm_NCHitTest”消息来移动窗体。Windows发送“wM_NCHitTest”消息来确定鼠标操作是否发生在窗体的客户区,或边框的特殊区上(非客户区)。如果Windows发现用户单击了窗体标题,系统将移动窗体,单击了窗体边框,则系统将开始改变窗体大小。例程如下: //声明一自定义事 阅读全文
posted @ 2015-09-11 19:21 findumars 阅读(893) 评论(0) 推荐(0) 编辑
摘要:现在很多的应用程序都有这样一种功能,当用户选择最小化窗口时,窗口不是象平常那样最小化到任务栏上,而是“最小化”成一个任务栏图标。象FoxMail3.0 NetVampire3.0等都提供了这样的功能。实现这样的功能实际上并不复杂,在窗口最小化时,窗口会发出WM_SYSCOMMAND消息,你只要需要截... 阅读全文
posted @ 2015-08-21 17:14 findumars 阅读(2093) 评论(0) 推荐(0) 编辑
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;const TIMER_ID = 200;type TForm1 ... 阅读全文
posted @ 2015-08-21 17:05 findumars 阅读(1316) 评论(0) 推荐(0) 编辑
摘要:///////消息广播只能将消息传递到接收消息的主程序中,MDIChild窗体不能接收到广播消息;/////////unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, ... 阅读全文
posted @ 2015-08-21 16:58 findumars 阅读(3739) 评论(0) 推荐(0) 编辑
摘要:WM_SYSCOMMAND - 系统命令消息,当点击最大化按钮,最小化按钮,关闭按钮等。都会收到这个消息。常用于窗口关闭时提示用户处理。WPARAM - 具体的命令,例如 关闭 SC_CLOSELPARAM - 鼠标的位置LOWORD - 低16位 ,水平位置。HIWORD - 高16位 ,垂直位置... 阅读全文
posted @ 2015-08-18 21:33 findumars 阅读(1636) 评论(0) 推荐(0) 编辑
摘要:顺便还把单元格给变了:procedure TFGLGL.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var MousePos: TSmallP... 阅读全文
posted @ 2015-08-18 20:49 findumars 阅读(589) 评论(0) 推荐(0) 编辑
摘要:进程之间通讯的几种方法:在Windows程序中,各个进程之间常常需要交换数据,进行数据通讯。常用的方法有 使用内存映射文件 通过共享内存DLL共享内存 使用SendMessage向另一进程发送WM_COPYDATA消息比起前两种的复杂实现来,WM_COPYDATA消息无疑是一种经济实惠的一中... 阅读全文
posted @ 2014-12-21 14:15 findumars 阅读(3550) 评论(0) 推荐(0) 编辑
摘要:发送消息执行记事本的“另存为”菜单功能procedure TForm1.FormCreate(Sender: TObject);var hNotepad: Cardinal;begin hNotepad := FindWindow('Notepad', nil); if hNotepad > ... 阅读全文
posted @ 2014-12-21 13:47 findumars 阅读(524) 评论(0) 推荐(0) 编辑