home *** CD-ROM | disk | FTP | other *** search
- /*-------------------------- Parallax Standard C_File ----------------------------
- C_File: utdlg.c
-
- Purpose: This file contains source code for handling some dialog
- functions for the Eroica unit test program.
-
-
- --------------------------------------------------------------------------------
- Copyright (c)1996 Parallax Software , All rights reserved.
- ------------------------------------------------------------------------------*/
-
- #include "dde_test.h"
- #include "utdlg.h"
-
- /* ========================================= Parallax C Function ==================
-
- @Name: InitApplication
- @Desc:
-
- ============================================================================== */
-
- BOOL InitApplication (HANDLE hInstance)
- {
- WNDCLASS wc;
-
- wc.style = 0 ;
- wc.lpfnWndProc = (WNDPROC)MainWndProc;
-
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(hInstance, "MAINICON");
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- /* wc.hbrBackground = COLOR_APPWORKSPACE + 1; */
- wc.hbrBackground = GetStockObject(WHITE_BRUSH);
- wc.lpszMenuName = szMainMenu;
- wc.lpszClassName = szMainClass;
-
- if (!RegisterClass(&wc)) return FALSE;
-
- wc.style = 0;
- wc.lpfnWndProc = (WNDPROC)StatusBarWndProc;
-
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(hInstance, "MAINICON");
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = szStatusBarClass;
-
- if (!RegisterClass(&wc)) return FALSE;
-
- wc.style = 0;
- wc.lpfnWndProc = (WNDPROC)StatusBarTextWndProc;
-
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(hInstance, "MAINICON");
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = GetStockObject(LTGRAY_BRUSH);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = szStatusBarTextClass;
-
- if (!RegisterClass(&wc)) return FALSE;
-
-
- return TRUE;
- } /* InitApplication() */
-
- /* ========================================= Parallax C Function ==================
-
- @Name: InitInstance
- @Desc:
-
- ============================================================================== */
-
- BOOL InitInstance (HANDLE hInstance, int nCmdShow)
- {
- ghInst = hInstance;
-
- ghWndMain = CreateWindow(szMainClass,
- "DDE API Test",
- WS_OVERLAPPEDWINDOW | WS_BORDER | WS_SYSMENU,
- 0, 0, 500, 500,
- NULL, NULL, hInstance, NULL);
-
- if (!ghWndMain) return (FALSE);
-
- ghListBox = CreateWindow("listbox", NULL,
- WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER | WS_VSCROLL | LBS_NOINTEGRALHEIGHT,
- 0, 0, 248, 500,
- ghWndMain, NULL, ghInst, NULL);
-
- if (!ghListBox)
- {
- MessageBox(ghWndMain, "Unable to Create Window", "Error", MB_OK);
- } /* if (!ghListBox) */
-
- ghListBox2 = CreateWindow("listbox", NULL,
- WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER | WS_VSCROLL | LBS_NOINTEGRALHEIGHT,
- 252, 250, 248, 500,
- ghWndMain, NULL, ghInst, NULL);
-
- if (!ghListBox2)
- {
- MessageBox(ghWndMain, "Unable to Create Window", "Error", MB_OK);
- } /* if (!ghListBox2) */
-
- ShowWindow(ghWndMain, nCmdShow);
- UpdateWindow(ghWndMain);
-
- return (TRUE);
- } /* InitInstance() */
-
- /* ========================================= Parallax C Function ==================
-
- @Name: About
- @Desc:
-
- ============================================================================== */
-
- BOOL FAR PASCAL About (HWND hDlg, unsigned msg, WORD wParam, LONG lParam)
- {
- if (lParam) ;
-
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- return (TRUE); /* tells dialog manager to set the focus */
- } /* case WM_INITDIALOG */
-
- case WM_COMMAND:
- {
- if (wParam == IDOK || wParam == IDCANCEL)
- {
- EndDialog(hDlg, TRUE);
- return (TRUE);
- } /* if (wParam == IDOK || wParam == IDCANCEL) */
-
- break;
- } /* case WM_COMMAND */
- } /* switch (msg) */
-
- return (FALSE); /* Didn't process a message */
- } /* About() */
-
- /* UTDLG.C */
- /* end of file */
-
-