计算机二级DELPHI控件:在RichEdit中的串查找计算机二级考试
文章作者 100test 发表时间 2009:04:30 03:54:19
来源 100Test.Com百考试题网
2009年下半年全国计算机等级考试你准备好了没?考计算机等级考试的朋友,2009年下半年全国计算机等级考试时间是2009年9月19日至23日。更多优质资料尽在百考试题论坛 百考试题在线题库
使用时与一般的WinAPI相差不多, 以下有一个包装过的函式.
(* MsgBox(提示文字, 标题, ID_Flat) 讯息视窗
(* ============================================
(* 第叁个引数的设定与本函数传回值, 请参阅 WinAPI 中对
(* MessageBox 的说明
(*
(* Delphi 1.0
(* ----------
(* 本函数传入值为 Object Pascal 式的字串, 如果需
(* 要传入 PChar 请直接呼叫 Application.MessageBox
(*
(* Delphi 2.0
(* ----------
(* 以 PChar(LongStr) 即可传入 Application.MessageBox
(* 不一定需要 call 本函数, 只是为了前後版本相容而保留
(* 本函数
(* -------------------------------------------------- *)
function MsgBox(const sText, sCaption: string. wFlag: word): integer.
{$ifdef Windows}
{$define __ShortString}
{$endif}
{$ifdef Win32}
{$ifopt H-}
{$define __ShortString}
{$endif}
{$endif}
{$ifdef __ShortString}
var
szText, szCaption: array[0..254] of char.
{$endif}
begin
{$ifdef __ShortString}
StrPCopy(szText, sText). (* 转换成 Null-Term. 型的字串 *)
StrPCopy(szCaption, sCaption).
Result := Application.MessageBox(szText, szCaption, wFlag).
{$else}
Result := Application.MessageBox(PChar(sText),
PChar(sCaption),
wFlag).
{$endif}
end. { MsgBox }