-
Delphi 如何使程序不出现在任务栏上
Delphi 如何使程序不出现在任务栏上,常规情况下,运行的程序都会在任务栏有一个图标窗口,方便用户操作,不出现在任务栏上也可以,不过不太符合常规,有点隐藏程序的嫌疑,以下代码是实现此功能的:
procedure TForm1.FormCreate(Sender: TObject);
begin
with Application do
SetWindowLong(Handle,GWL_EXSTYLE,GetWindowLong(Handle,GWL_EXSTYLE) and not WS_EX_APPWINDOW or WS_EX_TOOLWINDOW);
SetWindowPos(Handle,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE);
end;
- 2023-03-26 04:55:03下载
- 积分:1
-
Delphi 实现图像热点功能
Delphi 实现图像热点功能,实现一张图片上不同形状区域的热点,定义椭圆形、四边形、三角形的区域变量的热点,相关代码如下:
var
thepoint:array [1..8] of tpoint;//存储多边形顶点坐标
count:integer;
pointnum:array [1..2] of integer;
begin
//四边形顶点坐标,首末点封闭
thepoint[1]:=point(135,99);
thepoint[2]:=point(105,183);
thepoint[3]:=point(129,201);
thepoint[4]:=point(188,92);
thepoint[5]:=point(135,99);
count:=5;//四边形顶点数目,首末点为一点
fourE_rgn:=CreatePolygonRgn(thepoint,count,WINDING);//生成四边形区域
elli_rgn:=CreateEllipticRgn(64,221,231,263);// 生成椭圆形区域
//第一个三角形顶点坐标
thepoint[1]:=point(118,67);
thepoint[2]:=point(32,28);
thepoint[3]:=point(17,90);
thepoint[4]:=point(118,67);
//第二个三角形顶点坐标
thepoint[5]:=point(155,44);
thepoint[6]:=point(202,91);
thepoint[7]:=point(277,44);
thepoint[8]:=point(155,44);
pointnum[1]:=4;//第一个三角形顶点数目
pointnum[2]:=4;//第二个三角形顶点数目
count:=2;//三角形数目
//生成由两个三角形构成的三角形区域
tri_rgn:=CreatePolyPolygonRgn(thepoint,pointnum,count,WINDING);
end;
- 2022-01-26 08:02:50下载
- 积分:1
-
Delphi 7.0 使用Quotedstr函数返回字符串的引证串
Delphi 7.0 使用Quotedstr函数返回字符串的引证串,为了演示方便,本程序于SQLSERVER数据库结合,在运行此程序之前,需要附加数据库。具体附加数据库的方法请参见说明书。
- 2023-03-07 09:55:03下载
- 积分:1
-
Delphi实现RGB色环的绘制源码 XE10.2+WIN764
Delphi实现RGB色环的绘制源码 XE10.2+WIN764,鼠标移动时提取颜色RGB的值,可以设置中心圆是否是透明的,RGB色环的代码绘制,传入图片的大小,扣出中心的黑色圆,输入图片与中心圆的半径。这个色环的颜色十分精细,过渡十分自然,本例子代码的参考价值还是挺大的。
- 2022-06-27 11:06:18下载
- 积分:1
-
Delphi 获取MonthCalendar中选择的日期
Delphi 获取MonthCalendar中选择的日期,其实就是完成一个时间、日期的选择功能,年份、月份、日期、时间都可自定义调整并选择,这个简单的例子,可演示Delphi中MonthCalendar的用法,生成一个日期时间选择器功能。下面是相关代码:
procedure TForm1.Button1Click(Sender: TObject);
var
Year,Month,Days: Word;
begin
DecodeDate(MonthCalendar1.Date,Year,Month,Days);
Edit1.Text:=IntToStr(Year);
Edit2.Text:=IntToStr(Month);
Edit3.Text:=IntToStr(Days);
end;
全部源码请下载本实例包。
- 2022-02-02 06:32:18下载
- 积分:1
-
Delphi控制电脑蜂鸣器或扬声器发声音
Delphi控制电脑蜂鸣器或扬声器发声音,有些称之为喇叭,不过测试发现,这个是优先机箱蜂鸣器发出声音,或没装蜂鸣器,则会从音箱中发声音,实现的代码很简单,以下代码即可实现:
procedure TForm1.Button1Click(Sender: TObject);
var
i,j : integer;
begin
for i := 1000 to 2000 do
begin
j := i;
windows.Beep(1000,3000);
end;
end;
- 2022-02-05 03:44:28下载
- 积分:1
-
Delphi API笔刷制作源码
Delphi API笔刷制作实例的源码,这个笔刷只不过比较简单,点击按钮后自动生成,而且是有规则的网格线,或许通过这个简单的笔刷,你可以学习到用Delphi制作笔刷的入门技巧,相关的代码如下:
procedure TForm1.Button1Click(Sender: TObject);
var
LogBrush:TLogBrush;
begin
LogBrush.lbStyle:=BS_HATCHED;
LogBrush.lbColor:=clRed;
LogBrush.lbHatch:=HS_DIAGCROSS;
Canvas.Brush.Handle := CreateBrushIndirect(LogBrush);
Canvas.FillRect(ClientRect);
end;
- 2022-03-30 01:57:49下载
- 积分:1
-
Delphi GetCurrentDirectory得到系统当前目录
得到系统当前目录,Delphi 得到系统当前目录,这里使用了内置的GetCurrentDirectory函数来实现,比较方便,也比较简单。获取到系统目录后,是通过窗口的标题栏显示目录路径信息,在演示截图上请看窗口的标题栏,显示有程序当前所在的路径。关于GetCurrentDirectory用法,请参见以下两行代码:
GetCurrentDirectory(255,dir);//获得当前目录
form1.Caption:=dir;
- 2022-07-07 13:11:54下载
- 积分:1
-
Delphi 变速齿轮# 让时间变快减慢
Delphi 变速齿轮# 让时间变快减慢,其实这个似乎是做不到的,只是模拟一下,代码及描述如下:
procedure Speed(count:word); stdcall;
const ExceptionUsed = $03; { 中断号也可以用其它的中断号}
var
IDT : array [0..5] of byte; { 保存中断描述符表}
lpOldGate : dword; {存放旧向量}
begin
asm
push ebx
sidt IDT {读入中断描述符表}
mov ebx, dword ptr [IDT+2]{IDT表基地址}
add ebx, 8*ExceptionUsed {计算中断在中断描述符表中的位置}
cli {关中断}
mov dx, word ptr [ebx+6] {取6,7字节 另外4字节用于门属性和选择子 }
shl edx, 16d {左移16位}
mov dx, word ptr [ebx] {取1,2字节 }
mov [lpOldGate], edx {保存旧的中断门}
mov eax, offset @@Ring0Code {修改向量,指向Ring0级代码段}
mov word ptr [ebx], ax {低16位,保存到1,2字}
shr eax, 16d
mov word ptr [ebx+6], ax {高16位,保存到6,7位}
int ExceptionUsed {发生中断}
mov ebx, dword ptr [IDT+2] {重新定位到中断描述符表中}
add ebx, 8*ExceptionUsed
mov edx, [lpOldGate]
mov word ptr [ebx], dx
- 2023-02-13 04:55:03下载
- 积分:1
-
Delphi7 计算汉字的笔划
Delphi7 计算汉字的笔划有几划,输入一个汉字,本程序将计算出这个字有多少笔划,最后将结果将输出一个整数。
- 2022-12-25 04:20:03下载
- 积分:1