计算机二级Delphi辅导:在RichEdit中的串查找
来源:优易学  2011-6-5 17:08:31   【优易学:中国教育考试门户网】   资料下载   IT书店
  使用时与一般的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 }

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训