简单的语法问题与API调用问题(50分)

  • 主题发起人 主题发起人 nzfboy
  • 开始时间 开始时间
N

nzfboy

Unregistered / Unconfirmed
GUEST, unregistred user!
1:假设mystr不为空。<br>var<br>&nbsp; Form1: TForm1;<br>&nbsp; mystr:array of char;<br>&nbsp; ...............<br>procedure &nbsp;a;<br>begin<br>&nbsp; &nbsp; &nbsp; &nbsp;try<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Screen.Cursor := crHourGlass;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for name := mystr[low(mystr)] to mystr[High(mystr)] do<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; showmessage(name);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; &nbsp; finally<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Screen.Cursor := crDefault;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>end;<br><br>procedure tform1.WMQUERYENDSESSION(......);<br>begin<br>&nbsp; &nbsp;a;<br>end;<br><br>[Error] AutoEject.pas(203): Undeclared identifier: 'CloseAllCD'<br>为什么原因?<br><br>2:DeviceChange事件为何在光驱弹出时系统无法捕获,但当再送回时,系统此时会捕获到送完、弹出两个事件。
 
procedure tform1.WMQUERYENDSESSION(......);<br>begin<br>&nbsp; &nbsp;a;<br>end;<br>这过程改为 procedure CloseAllCD;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; a;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;
 
WM_QUERYENDSESSION &nbsp;<br>nSource = (UINT) wParam; &nbsp; &nbsp;// source of end-session request <br>fLogOff = lParam &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// logoff flag <br>
 
在private 中定义 A过程<br>在主程序中procedure tform1.a<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br>即可以了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
739
import
I
后退
顶部