Situation :

在某些情況下無法或不想使用 ShowMessage 來輸出訊息,其實還可以選用 OutPutDebugString 來輸出訊息。

Action :

調用 OutputDebugString 方法,如下

OutputDebugString(PChar('call outputdebugstgring to output message'));

記得要呼叫 PChar 處理要輸出的內容!

輸出的視窗在 Delphi -> View -> Debug Windows -> Event log

Result :

在 Event Log 視窗會出現想要輸出的訊息