Eğer bir mesaj penceresi içinde açılıyorsa
aşağıdaki şekilde kullanabilirsin
Kod: Tümünü seç
type
tMessajID = (idOK = 1,
idCancel = 2,
idAbort = 3,
idRetry = 4,
idIgnore = 5,
idYes = 6,
idNo = 7,
idClose = 8,
idHelp = 9);
....
type
tMesajIslem = (tMsg_Yok=0, tMsg_Var=1, tMsg_Vekle=2);
procedure TdlgTest.prc_WindowsMsgClick(pMsgBoxCaption:String; pBtnClickID:tMessajID; pMsgIslem:tMesajIslem);
var
sMsg: string;
len: integer;
begin
SetLength(sMsg, 127);
len := GetWindowText(Application.ActiveFormHandle, PChar(sMsg), 127);
if len = 0 then Exit;
SetLength(sMsg, len);
if pMsgBoxCaption <> '' then
if sMsg <> pMsgBoxCaption then exit;
if (tSwcMesajIslem = tMsg_Var) then
begin
if pBtnClickID = idOK then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_OK, 0);
if pBtnClickID = idCancel then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_CANCEL, 0);
if pBtnClickID = idAbort then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_ABORT, 0);
if pBtnClickID = idRetry then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_RETRY, 0);
if pBtnClickID = idIgnore then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_IGNORE, 0);
if pBtnClickID = idYes then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_YES, 0);
if pBtnClickID = idNo then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_NO, 0);
if pBtnClickID = idClose then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_CLOSE, 0);
if pBtnClickID = idHelp then SendMessage(Application.ActiveFormHandle, WM_COMMAND, ID_HELP, 0);
end;
end;
Ehil olmayanlara sabretmek ehil olanları parlatır.
Akıllı birisinden gelen cefa, bilgisizlerin vefasından iyidir.
Bilgiye ulaştı mı ayak, kanat olur
Biz insanı kıyafetiyle ağırlar bilgisiyle uğurlarız.
Mevlana