游子日月长

笑渐不闻声渐悄,多情却被无情恼!

导航

随笔分类 -  Delphi

上一页 1 2 3 4 5 6 7 8 9 下一页

让一个非窗口组件(non-windowed component)可以接受来自Windows的消息
摘要:为什么要这样做?有时候我们需要一个非窗口组件(比如一个非继承自TWinContrl的组件)可以接受Windows消息。要接受消息就需要一个窗口句柄,但是非窗口组件却没有句柄。这篇文章将讲述怎么让一个没有句柄的组件如何通过一个隐藏的窗口接受消息这是怎么做到的?例如我的剪贴板查看组件就是一个不可视的组件 阅读全文

posted @ 2017-02-14 14:14 游子日月长 阅读(245) 评论(0) 推荐(0)

RunAsAdmin
摘要:program AdminCMD;{$APPTYPE CONSOLE}uses Windows, ShellApi, SysUtils;function RunAsAdmin(const iExeName, iParam: String): Boolean;var SEI: TShellExecut 阅读全文

posted @ 2017-02-14 13:27 游子日月长 阅读(397) 评论(0) 推荐(0)

Delphi Class of 类引用
摘要:Delphi Class of 类引用也就是类的类型,也可说是指向类的指针 Type TControlCls = Class of TControl;function CreateComponent(ControlCls: TControlCls): TControl;begin result:=C 阅读全文

posted @ 2017-02-14 09:15 游子日月长 阅读(664) 评论(0) 推荐(0)

Class-reference types 类引用类型--快要失传的技术
摘要:先摘一段原版的说明: A class-reference type, sometimes called a metaclass, is denoted by a construction of the formclass of type where type is any class type. T 阅读全文

posted @ 2017-02-13 17:15 游子日月长 阅读(152) 评论(0) 推荐(0)

Open Tools API :IDE Main Menus
摘要:http://www.davidghoyle.co.uk/WordPress/?p=777 http://www.davidghoyle.co.uk/WordPress/?page_id=1110 http://www.davidghoyle.co.uk/WordPress/?page_id=111 阅读全文

posted @ 2017-02-10 14:34 游子日月长 阅读(401) 评论(0) 推荐(0)

Delphi笔记-自定义提示窗口
摘要:unit pbHint; interface uses Windows, Controls, Forms, Graphics; type TPBHint=class(THintWindow) //要自定义提示窗口类,必须从THintWindow类继承 private FRegion:THandle; //保存当前提示窗口的区域句柄,用来设置窗口的形状 proc... 阅读全文

posted @ 2017-02-10 13:53 游子日月长 阅读(553) 评论(0) 推荐(0)

How to read very large text files fast
摘要:Question Does anyone know the fastest way to read large text files (10Mb) into a string.Readln is just too slow. Answer 1 You may try this: function R 阅读全文

posted @ 2017-02-09 15:44 游子日月长 阅读(207) 评论(0) 推荐(0)

封面图片任意旋转 任意旋转图像 处理速度快 自动中心位置寻找
摘要:unit UnitMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Math, StdCtrls, jpeg, ExtCtrls, ComCtrls; type TForm1 = class(TForm... 阅读全文

posted @ 2017-02-08 17:12 游子日月长 阅读(216) 评论(0) 推荐(0)

使图片任意转动的编程例子
摘要:unit unitImage; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, math; type TForm1 = class(TForm) Image1: TImage; ... 阅读全文

posted @ 2017-02-08 17:10 游子日月长 阅读(296) 评论(0) 推荐(0)

有3D效果的进度条
摘要:// The Unofficial Newsletter of Delphi Users - Issue #12 - February 23rd, 1996 unit Percnt3d; (* TPercnt3D by Lars Posthuma; December 26, 1995. Copyright 1995, Lars Posthuma. ... 阅读全文

posted @ 2017-02-08 17:06 游子日月长 阅读(329) 评论(0) 推荐(0)

注册COM
摘要:可以用代码在程序中实现COM的注册. 举例如下: (假设需要注册的文件为test.ocx)uses OLEctl,....varOCXHand: THandle;RegFunc: TDllRegisterServer;beginOCXHand:= LoadLibrary('c:\windows\sy 阅读全文

posted @ 2017-02-07 16:55 游子日月长 阅读(304) 评论(0) 推荐(0)

文件和Variant的转换
摘要:function FileToVariant(FileName: String): OleVariant; var AStream: TFileStream; MyBuffer: Pointer; begin AStream:=TFileStream.create(FileName,fmOpenRe 阅读全文

posted @ 2017-02-07 16:54 游子日月长 阅读(178) 评论(0) 推荐(0)

流和Variant的转换
摘要:procedure TForm2.VariantToStream (const v : olevariant; Stream : TMemoryStream); var p : pointer; begin Stream.Position := 0; Stream.Size := VarArrayH 阅读全文

posted @ 2017-02-07 16:53 游子日月长 阅读(162) 评论(0) 推荐(0)

bmp和Variant的转换
摘要:procedure TForm2.VariantToBMP(aValue : OleVariant;var aBmp:TBitmap); var Stream : TMemoryStream; begin try Stream := TMemoryStream.Create; VariantToSt 阅读全文

posted @ 2017-02-07 16:52 游子日月长 阅读(183) 评论(0) 推荐(0)

JPEG和Variant的转换
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,jpeg, ExtCtrls, StdCtrls,ActiveX, AxCtrls; type TF 阅读全文

posted @ 2017-02-07 16:52 游子日月长 阅读(150) 评论(0) 推荐(0)

获得Variant类型
摘要:function GetVariantType(const v: variant): string; begin case TVarData(v).vType of varEmpty: result := 'Empty'; varNull: result := 'Null'; varSmallInt 阅读全文

posted @ 2017-02-07 16:51 游子日月长 阅读(173) 评论(0) 推荐(0)

移去OleContainer的黑边框
摘要://禁止双击打开word编辑 olecontainer1.AutoActivate := aaManual; //禁止右键菜单 olecontainer1.AutoVerbMenu := False; //移去OleContainer的黑边框 OleContainer1.OleObject.AxBo 阅读全文

posted @ 2017-02-07 16:50 游子日月长 阅读(153) 评论(0) 推荐(0)

调整Mic音量
摘要:uses MMSystem; function GetLineInHandle(AudioType : integer) : integer;var i : integer; AudioCaps : TAuxCaps;begin result := 0; for i := 0 to auxGetNu 阅读全文

posted @ 2017-02-07 16:48 游子日月长 阅读(267) 评论(0) 推荐(0)

关闭声道
摘要:uses MMSystem; procedure SetMediaAudioOff(DeviceID : word);var SetParm : TMCI_SET_PARMS;begin SetParm.dwAudio := MCI_SET_AUDIO_ALL; mciSendCommand(Dev 阅读全文

posted @ 2017-02-07 16:47 游子日月长 阅读(123) 评论(0) 推荐(0)

检测声卡存在
摘要:如果你是做一些多媒体播放器之类的程序时,为了完善系统的容错性,就必须用到一些检测系统的功能,其中检测声卡是否存在就是一个问题,下列程序帮你忙,首先需要在uses部分加入mmsystem ,接着在窗体创建时检测声卡:procedure TForm1.FormCreate(Sender: Tobject 阅读全文

posted @ 2017-02-07 16:46 游子日月长 阅读(169) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 下一页