Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
24
Добавлен:
10.12.2013
Размер:
1 Кб
Скачать
program winhello;
const
    NULL_HANDLE = 0;
    CR = 13;

(***************************************************************
** The following two constants are defined by the windows API **
***************************************************************)
    MB_OKCANCEL = $00000001;
    MB_ICONEXCLAMATION = $00000030;

type
    MsgBoxRet = (IDNOMEM, IDOK, IDCANCEL, IDABORT, IDRETRY, IDIGNORE, IDYES, IDNO, IDCLOSE, IDHELP );
var
    csText, csCaption : cstring;
    RetVal : MsgBoxRet;

(* The following winapi function is exported from the windows dll 'user32.dll'
int MessageBoxA(
    HWND hWnd,  // handle of owner window
    LPCTSTR lpText,     // address of text in message box
    LPCTSTR lpCaption,  // address of title of message box  
    UINT uType  // style of message box
   );
*)

    function MessageBox(hWnd : word; var lpText, lpCaption : cstring; uint : word) : MsgBoxRet;
     external dll='user32.dll' name='MessageBoxA' stdcall;

begin
    csText := 'Hello world!!'+chr(CR)+'Press Cancel when done';
    csCaption := 'Irie Pascal Windows Hello World Program';
    repeat
    RetVal := MessageBox(NULL_HANDLE, csText, csCaption, MB_OKCANCEL + MB_ICONEXCLAMATION);
    until RetVal = IDCANCEL;
end.
Соседние файлы в папке samples