home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- ** **
- ** Kermit for Microsoft Windows **
- ** ---------------------------- **
- ** KERMMISC.C **
- ** **
- ** This module contains miscellaneous routines for the applications. **
- ** **
- *******************************************************************************/
-
- // INCLUDES -------------------------------------------------------------------
-
- #include "kermit.h"
-
- //-----------------------------------------------------------------------------
- int GoDialogBox(HANDLE hInstance, LPSTR lpTemplateName,
- HWND hWndParent, FARPROC lpProc)
-
- // Description of what function does.
-
- // Param(s): x...............Description.
-
- // Returns: Result description.
-
- {
- int nResult;
- FARPROC lpDialog;
-
- lpDialog = MakeProcInstance(lpProc, hInstance);
- nResult = DialogBox(hInstance, lpTemplateName, hWndParent, lpDialog);
- FreeProcInstance(lpDialog);
-
- return(nResult);
- }
-
- //-----------------------------------------------------------------------------
- VOID EnableCommCommands(WORD wEnable)
-
- // Description of what function does.
-
- // Param(s): x...............Description.
-
- // Returns: Result description.
-
- {
- EnableMenuItem(hAppMenu, IDM_BREAK,wEnable);
- }
-
- //-----------------------------------------------------------------------------
- VOID EnableConfigCommands(WORD wEnable)
-
- // Description of what function does.
-
- // Param(s): x...............Description.
-
- // Returns: Result description.
-
- {
- EnableMenuItem(hAppMenu, 4, wEnable | MF_BYPOSITION);
- DrawMenuBar(hAppWnd);
- }
-
- //-----------------------------------------------------------------------------
- VOID SetKermitCommands(LPSTR lpMenuName, WORD wEnable)
-
- // Description of what function does.
-
- // Param(s): x...............Description.
-
- // Returns: Result description.
-
- {
- WORD wMenuSize, i;
- HMENU hSubMenu;
-
- ChangeMenu(hAppMenu, 3, "&Kermit", LoadMenu(hAppInst, lpMenuName),
- MF_POPUP | MF_CHANGE | MF_BYPOSITION);
-
- EnableMenuItem(hAppMenu, 3, wEnable | MF_BYPOSITION);
- DrawMenuBar(hAppWnd);
- }
-
- //-----------------------------------------------------------------------------
- int KermitFmtMsgBox(WORD wType, PSTR pszFmt, ...)
-
- // Description of what function does.
-
- // Param(s): x...............Description.
-
- // Returns: Result description.
-
- {
- char sWork[128];
- va_list pArg;
- int nLen;
-
- va_start(pArg, pszFmt);
- nLen = vsprintf(sWork, pszFmt, pArg);
- va_end(pArg);
-
- return(MessageBox(hAppWnd, sWork, szAppName, wType));
- }
-