Пример #1
0
        public static DialogResult ShowMessage(int hParent, string Prompt, string Title, string Caption1, string Caption2, string Caption3, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton DefaultButton, MessageBoxOptions options)
        {
            int hInst;
            int Thread;

            TopCount    = 0;
            ButtonCount = 0;

            strCaption1 = Caption1;
            strCaption2 = Caption2;
            strCaption3 = Caption3;

            if (Title == "")
            {
                Title = Application.ProductName;
            }

            CallBack_WinProc myWndProc = new CallBack_WinProc(WinProc);

            hInst  = GetWindowLong(hParent, GWL_HINSTANCE);
            Thread = GetCurrentThreadId();
            hHook  = SetWindowsHookEx(WH_CBT, myWndProc, hInst, Thread);

            return(MessageBox.Show(Prompt, Title, buttons, icon, DefaultButton, options));
        }
Пример #2
0
 static extern int SetWindowsHookEx(int idHook, CallBack_WinProc lpfn, int hmod, int dwThreadId);