diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-07-16 20:08:30 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-07-16 20:08:30 +0000 |
commit | 74e738f374f759723daf8920677158712d0ca5c1 (patch) | |
tree | 89a93d70f87e950e28d23466d3c84120ead0e770 /plugins/Actman30/question.pas | |
parent | e5c9c0077f7b50bbfe90201154c31c13e1a6fc63 (diff) |
- Actman 3 added (not adopted)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5391 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Actman30/question.pas')
-rw-r--r-- | plugins/Actman30/question.pas | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/plugins/Actman30/question.pas b/plugins/Actman30/question.pas new file mode 100644 index 0000000000..9e5f0d1b59 --- /dev/null +++ b/plugins/Actman30/question.pas @@ -0,0 +1,58 @@ +unit question;
+
+interface
+uses windows,messages;
+
+function ShowQuestion(ask:pWideChar):integer;
+
+implementation
+
+uses m_api;
+
+{$include i_const.inc}
+{$resource ask.res}
+
+const
+ imp_yes = 1;
+ imp_yesall = 2;
+ imp_no = 3;
+ imp_noall = 4;
+ imp_append = 5;
+
+function QuestionDlg(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+var
+ i:integer;
+begin
+ result:=0;
+ case hMessage of
+ WM_INITDIALOG: begin
+ TranslateDialogDefault(Dialog);
+ SetDlgItemTextW(Dialog, IDC_ASK,pWideChar(lParam));
+ result:=1;
+ end;
+ WM_COMMAND: begin
+ case loword(wParam) of
+ IDOK : i:=imp_yes;
+ IDCANCEL : i:=imp_no;
+ IDC_YESALL: i:=imp_yesall;
+ IDC_NOALL : i:=imp_noall;
+ IDC_APPEND: i:=imp_append;
+ else
+ i:=0;
+ end;
+ if i<>0 then
+ begin
+ EndDialog(Dialog,i);
+ result:=1;
+ end;
+ end;
+ end;
+end;
+
+function ShowQuestion(ask:pWideChar):integer;
+begin
+ result:=DialogBoxParam(hInstance,MAKEINTRESOURCE(IDD_ASK),0,
+ @QuestionDlg,TLPARAM(ask));
+end;
+
+end.
|