home *** CD-ROM | disk | FTP | other *** search
- #include "jam.h"
- #include "def.h"
- #include "keyname.h"
- #include "kbd.h"
- #include "me.h"
- #include <sys/types.h>
- #include "stdio.h"
-
- /* Code for startup banner/about dialog.
- * That about says it all.
- */
- static HWND s_hdlg = NULL;
- static FARPROC s_lpBannerDlgProc = NULL;
-
- /* This is the window proc for the startup dialog; it's pseudo
- * modal by virtue of me disabling the parent!
- */
- LRESULT WINAPI BannerDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- switch(msg)
- {
- case WM_COMMAND:
- if (wParam == ID_OK) /* what else could it be ? */
- {
- DestroyWindow(hdlg);
- FreeProcInstance(s_lpBannerDlgProc);
- EnableWindow(g_hWnd, TRUE);
- if (!IsIconic(g_hWnd))
- SetActiveWindow(g_hWnd);
- return(TRUE);
- }
- }
- return((LRESULT)FALSE);
- }
-
- /* This is called via the About choice in the system menu, about..
- * choice under Help in the window menu and on startup for first time
- * users. For that reason, it shouldn't be modal the regular way because it
- * would halt all activity of emacs on startup.
- */
- VOID MakeBanner()
- {
- int screen_cx, screen_cy;
- int hdlg_cx, hdlg_cy;
- RECT rect;
-
- s_lpBannerDlgProc = MakeProcInstance((FARPROC)BannerDlgProc, g_hInstance);
- s_hdlg = CreateDialog(g_hInstance, "BANNER", NULL, s_lpBannerDlgProc);
-
- screen_cx = GetSystemMetrics(SM_CXSCREEN);
- screen_cy = GetSystemMetrics(SM_CYSCREEN);
- GetWindowRect(s_hdlg, &rect);
- hdlg_cx = rect.right - rect.left;
- hdlg_cy = rect.bottom - rect.top;
-
- MoveWindow(s_hdlg, (screen_cx-hdlg_cx)/2, (screen_cy-hdlg_cy)/2,
- hdlg_cx, hdlg_cy, TRUE);
- ShowWindow(s_hdlg, SW_SHOW);
- UpdateWindow(s_hdlg);
- EnableWindow(g_hWnd, FALSE);
- }
-
-