《用delphi开发共享软件》-15.2桌面提示器
打开一个配置文件:
操作TStringGrid
Procedure EmptyGrid(Var sg:TStringGrid);
Var i:Integer;
begin
for i:= to sg.RowCount - do
sg.Rows[i].clear;
sg.RowCount :=;
end; Procedure SetGridTitle(Var SG:TStringGrid; sTil:array of String);
Var i,l,h:integer;
begin
l:=Low(sTil);
h:=High(sTil);
if sg.ColCount<h-l+ then sg.ColCount:=h-l+;
for i:= to sg.ColCount - do
begin
sg.Cells[i,]:=sTil[l+i];
if i>h then Exit;
end;
end; Procedure SetGridNumber(Var SG:TStringGrid;
Col,bn,len:Integer;ch:Char);
Var i:integer;
begin
for i:= to sg.RowCount - do
begin
sg.Cells[Col,i]:=Format('%d',[bn+i-]);
sg.Cells[Col,i]:=Padl(sg.Cells[Col,i],ch,len);
end;
end;
操作TStringGrid
procedure TFrmPara.WriteParameters;
Var s:String;
begin
DelOneDevice(MYINI,'关机时间');
WriteGridToINI(MYINI,'关机时间',sgTime);
DelOneDevice(MYINI,'桌面图片');
WriteGridToINI(MYINI,'桌面图片',sgPic);
DelOneDevice(MYINI,'背景音乐');
WriteGridToINI(MYINI,'背景音乐',sgSong);
DelOneDevice(MYINI,'桌面提示');
WriteGridToINI(MYINI,'桌面提示',sgHint);
DelOneDevice(MYINI,'定时提示');
WriteGridToINI(MYINI,'定时提示',sgNote); WriteOnePara(MYINI,'SHUTDOWN','chkSrvShutDown',BoolStr(chkSrvShutDown.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkShutAfterATime',BoolStr(chkShutAfterATime.checked));
WriteOnePara(MYINI,'SHUTDOWN','Interval',inttostr(spInterval.value)); WriteOnePara(MYINI,'SHUTDOWN','chkClose',BoolStr(chkClose.checked));
WriteOnePara(MYINI,'SHUTDOWN','spClose',inttostr(spClose.value)); WriteOnePara(MYINI,'SHUTDOWN','AutoShutDown',BoolStr(chkAutoShutDown.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkShowDate',BoolStr(chkShowDate.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkPlayMusic',BoolStr(chkPlayMusic.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkStopMusic',BoolStr(chkStopMusic.checked)); WriteOnePara(MYINI,'SHUTDOWN','tbVol1',inttostr(tbVol1.Position));
WriteOnePara(MYINI,'SHUTDOWN','tbVol2',inttostr(tbVol2.Position)); WriteOnePara(MYINI,'SHUTDOWN','chkShowLine',BoolStr(chkShowLine.checked));
WriteOnepara(MYINI,'SHUTDOWN','Font',fonttostring(plHintFont.Font,True));
MyWriteColor(MYINI,'SHUTDOWN','FrameColor',plLineColor.font.Color); WriteOnePara(MYINI,'SHUTDOWN','chkClockOne',BoolStr(chkClockOne.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkClockHalf',BoolStr(chkClockHalf.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkHintWindow',BoolStr(chkHintWindow.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkWallPaper',BoolStr(chkWallPaper.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkHintMusic',BoolStr(chkHintMusic.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkHintMusicFade',BoolStr(chkHintMusicFade.checked));
WriteOnePara(MYINI,'SHUTDOWN','spHintMusicFade',inttostr(spHintMusicFade.value)); MyWriteColor(MYINI,'SHUTDOWN','BKCOLOR',MyBackColor);
WriteOnePara(MYINI,'SHUTDOWN','chkMusicDown',BoolStr(chkMusicDown.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkMusicStopRun',BoolStr(chkMusicStopRun.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkMusicStopPlay',BoolStr(chkMusicStopPlay.checked));
WriteOnePara(MYINI,'SHUTDOWN','chkMusicFade',BoolStr(chkMusicFade.checked));
WriteOnePara(MYINI,'SHUTDOWN','spMusicDown',inttostr(spMusicDown.value));
WriteOnePara(MYINI,'SHUTDOWN','spMusicStopRun',inttostr(spMusicStopRun.value));
WriteOnePara(MYINI,'SHUTDOWN','spMusicStopPlay',inttostr(spMusicStopPlay.value));
WriteOnePara(MYINI,'SHUTDOWN','spMusicFade',inttostr(spMusicFade.value)); end; procedure DelOneDevice(devFile:String;sType:String);
Var aIniFile:TIniFile;
begin
aIniFile:=TIniFile.Create(devFile);
try
aIniFile.EraseSection(sType);
finally
aIniFile.Free;
end;
end; procedure WriteGridToINI(sFile,Sect:String;sg:TStringGrid);
Var i:integer;
s:String;
begin
{$I-}
DelOneDevice(sFile,Sect);
for i:= to SG.RowCount- do
begin
StrgridToStr(S,SG,i);
WriteOnePara(sFile,Sect,'Row'+IntToStr(i),s);
end;
end; procedure StrGridToStr(Var S:String; Var SG:TStringGrid; Row:longint);
Var i:integer;
begin
S:='';
for i:= to SG.ColCount - do
S:=S+SG.Cells[i,Row]+'^^';
end; procedure WriteOnePara(sIniFile,Sct,Idt,Value:String);
Var aIniFile:TIniFile;
begin
aIniFile:=TIniFile.Create(sIniFile);
try
aIniFile.WriteString(Sct,Idt,Value);
finally
aIniFile.Free;
end;
end;
《用delphi开发共享软件》-15.2桌面提示器的更多相关文章
- 启动windows的服务--《用delphi开发共享软件》-15.2桌面提示器
在dos 下用命令启动一个服务:NET START "Windows Desktop Reminder" 一下为用delphi启动服务: Function RunProcess(s ...
- 字体和壁纸合并后再更改壁纸--《用delphi开发共享软件》-15.2桌面提示器
procedure TFrmPlay.mnDeskPicClick(Sender: TObject); Var s:String; i:Integer; begin //s:=Path+'SetPic ...
- 软件打开时间、窗体透明度、背景色---《用delphi开发共享软件》-15.1任务管理器
1.计算软件启动了多长时间:用定时器,每分钟触发一次: procedure TFrmMain.tmCheckLegalTimer(Sender: TObject);Var Minutes:LongIn ...
- 设置随机启动--《用delphi开发共享软件》-15.1任务管理器
在设置窗体中 chkAutoStart: TCheckBox; 在设置窗体中 chkAutoStart: TCheckBox; procedure TFrmSetup.FormCreate(Sende ...
- 实现窗体随着鼠标移动(控件)--《用delphi开发共享软件》-15.1任务管理器
private //窗体移动: OldPos,NewPos:TPoint; bMove:Boolean; procedure TForm1.FormMouseDown(Sender: TObject; ...
- DELPHI开发LINUX桌面程序
DELPHI开发LINUX桌面程序 DELPHI官方目前为止尚不能开发LINUX桌面程序. 但三方控件FmxLinux(商业控件)是可以的.网上有破解版本.
- (转载)Delphi开发经验谈
Delphi开发经验谈 开发环境-------- Delphi 7是一个很经典的版本,在Win2000/XP下推荐安装Delphi 7来开发软件,在Vista下推荐使用Delphi 2007开发软件. ...
- Windows Phone 8初学者开发—第15部分:在选中ListItem时播放声音
原文 Windows Phone 8初学者开发—第15部分:在选中ListItem时播放声音 第15部分:在选中ListItem时播放声音 原文地址: http://channel9.msdn.co ...
- Ubuntu 中用 delphi 开发 apache
经过近15年的沉默.delphi 10.2 终于重新开始支持linux 开发了. 今天说一下在ubuntu中开发apache的方法. 首先安装ubuntu 的delphi 开发环境,请参考以前的文章 ...
随机推荐
- 【CCL】连通区域提取
根据朋友给的一份原理写的 感觉还挺清楚 #include "cv.h" #include "highgui.h" #include <stdio.h> ...
- 解决jetty7.0.pre5启动时报ClassNotFoundException: javax.interceptor.InvocationContext异常的问题
一.背景介绍:最近项目在使用maven命令行运行jetty服务器时出现ClassNotFoundException: javax.interceptor.InvocationContext异常 二.环 ...
- 使用连发互联空间+SQLyog 设置我们的数据库链接
在我使用SQLyog(小海豚)管理我的数据库的时候,主机空间为连发互联的(自己做着玩,这个便宜),遇到一些坑,自己写一下记录一下,省的下次忘记了又浪费时间. 首先你要有连发互联的空间,可以淘宝购买,连 ...
- python基础——使用模块
python基础——使用模块 Python本身就内置了很多非常有用的模块,只要安装完毕,这些模块就可以立刻使用. 我们以内建的sys模块为例,编写一个hello的模块: #!/usr/bin/env ...
- IE11 的区别
http://msdn.microsoft.com/zh-tw/visualc/bg182625
- iOS 百度地图坐标标注
注:由于iOS9改用更安全的https,为了能够在iOS9中正常使用地图SDK,请在"Info.plist"中进行如下配置,否则影响SDK的使用. <key>NSApp ...
- iOS中的两种主要架构及其优缺点浅析
凡是程序的开发者,应该对程序的架构都不陌生.一个程序的架构的好坏对这个程序有着非常重要的作用.今天我们来看一下iOS开发中用要的两种主流的程序架构.这个过程中我们主要以例子的形式展开. 我们来看第一种 ...
- hdu 1290 切糕
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1290 思路: n条直线最多能将一个平面分成几个区域其递推公式即为:f(n)=f(n-1)+n:递推一下 ...
- C#学习笔记----C#中的闭包机制
http://www.cnblogs.com/jiejie_peng/p/3701070.html http://www.cnblogs.com/Ribbon/p/3611457.html “ 若匿名 ...
- 你可能不知道的java、python、JavaScript以及jquary循环语句的区别
一.概述 java循环语句分为四种形式,分别是 while, do/while, for, foreach: python中循环语句有两种,while,for: JavaScript中循环语句有四种, ...