--- mstools/samples/ddeml/server/dialog.c 2018/08/09 18:20:38 1.1 +++ mstools/samples/ddeml/server/dialog.c 2018/08/09 18:21:27 1.1.1.2 @@ -8,33 +8,33 @@ * FUNCTION : DoDialog() * * * * PURPOSE : Generic dialog invocation routine. Handles procInstance * - * stuff, focus management and param passing. * + * stuff, focus management and param passing. * * RETURNS : result of dialog procedure. * * * ****************************************************************************/ INT FAR DoDialog( LPSTR lpTemplateName, -FARPROC lpDlgProc, -DWORD param, +DLGPROC lpDlgProc, +LPARAM param, BOOL fRememberFocus) { - WORD wRet; + INT iRet; HWND hwndFocus; WORD cRunawayT; cRunawayT = cRunaway; cRunaway = 0; // turn off runaway during dialogs. - + if (fRememberFocus) hwndFocus = GetFocus(); lpDlgProc = MakeProcInstance(lpDlgProc, hInst); - wRet = DialogBoxParam(hInst, lpTemplateName, hwndServer, lpDlgProc, param); + iRet = DialogBoxParam(hInst, lpTemplateName, hwndServer, lpDlgProc, param); FreeProcInstance(lpDlgProc); if (fRememberFocus) SetFocus(hwndFocus); cRunaway = cRunawayT; // restore runaway state. - return wRet; + return iRet; } @@ -62,15 +62,15 @@ BOOL APIENTRY About(hDlg, message, wPar HWND hDlg; /* window handle of the dialog box */ UINT message; /* type of message */ WPARAM wParam; /* message-specific information */ -LONG lParam; +LPARAM lParam; { switch (message) { case WM_INITDIALOG: /* message: initialize dialog box */ return (TRUE); case WM_COMMAND: /* message: received a command */ - if (GET_WM_COMMAND_ID(wParam, lParam) == IDOK /* "OK" box selected? */ - || GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL) { /* System menu close command? */ + if (LOWORD(wParam) == IDOK /* "OK" box selected? */ + || LOWORD(wParam) == IDCANCEL) { /* System menu close command? */ EndDialog(hDlg, TRUE); /* Exits the dialog box */ return (TRUE); } @@ -86,7 +86,7 @@ BOOL APIENTRY RenderDelayDlgProc( HWND hwnd, register UINT msg, register WPARAM wParam, -LONG lParam) +LPARAM lParam) { switch (msg){ case WM_INITDIALOG: @@ -97,10 +97,10 @@ LONG lParam) break; case WM_COMMAND: - switch (GET_WM_COMMAND_ID(wParam, lParam)) { + switch (LOWORD(wParam)) { case IDOK: RenderDelay = GetDlgItemInt(hwnd, IDEF_VALUE, NULL, FALSE); - // fall through + // fall through case IDCANCEL: EndDialog(hwnd, 0); break; @@ -120,10 +120,10 @@ BOOL APIENTRY SetTopicDlgProc( HWND hwnd, register UINT msg, register WPARAM wParam, -LONG lParam) +LPARAM lParam) { CHAR szT[MAX_TOPIC + 10]; - + switch (msg){ case WM_INITDIALOG: SetWindowText(hwnd, "Set Topic Dialog"); @@ -133,7 +133,7 @@ LONG lParam) break; case WM_COMMAND: - switch (GET_WM_COMMAND_ID(wParam, lParam)) { + switch (LOWORD(wParam)) { case IDOK: DdeFreeStringHandle(idInst, topicList[1].hszTopic); GetDlgItemText(hwnd, IDEF_VALUE, szTopic, MAX_TOPIC); @@ -142,7 +142,7 @@ LONG lParam) strcat(szT, " | "); strcat(szT, szTopic); SetWindowText(hwndServer, szT); - // fall through + // fall through case IDCANCEL: EndDialog(hwnd, 0); break; @@ -160,10 +160,10 @@ BOOL APIENTRY SetServerDlgProc( HWND hwnd, register UINT msg, register WPARAM wParam, -LONG lParam) +LPARAM lParam) { CHAR szT[MAX_TOPIC + 10]; - + switch (msg){ case WM_INITDIALOG: SetWindowText(hwnd, "Set Server Name Dialog"); @@ -173,7 +173,7 @@ LONG lParam) break; case WM_COMMAND: - switch (GET_WM_COMMAND_ID(wParam, lParam)) { + switch (LOWORD(wParam)) { case IDOK: GetDlgItemText(hwnd, IDEF_VALUE, szServer, MAX_TOPIC); DdeNameService(idInst, hszAppName, 0, DNS_UNREGISTER); @@ -184,7 +184,7 @@ LONG lParam) strcat(szT, " | "); strcat(szT, szTopic); SetWindowText(hwndServer, szT); - // fall through + // fall through case IDCANCEL: EndDialog(hwnd, 0); break; @@ -204,10 +204,10 @@ BOOL APIENTRY ContextDlgProc( HWND hwnd, register UINT msg, register WPARAM wParam, -LONG lParam) +LPARAM lParam) { BOOL fSuccess; - + switch (msg){ case WM_INITDIALOG: SetDlgItemInt(hwnd, IDEF_FLAGS, CCFilter.wFlags, FALSE); @@ -219,7 +219,7 @@ LONG lParam) break; case WM_COMMAND: - switch (GET_WM_COMMAND_ID(wParam, lParam)) { + switch (LOWORD(wParam)) { case IDOK: CCFilter.wFlags = GetDlgItemInt(hwnd, IDEF_FLAGS, &fSuccess, FALSE); if (!fSuccess) return(0); @@ -231,8 +231,8 @@ LONG lParam) if (!fSuccess) return(0); CCFilter.dwSecurity = (DWORD)GetDlgItemInt(hwnd, IDEF_SECURITY, &fSuccess, FALSE); if (!fSuccess) return(0); - - // fall through + + // fall through case IDCANCEL: EndDialog(hwnd, 0); break; @@ -244,3 +244,5 @@ LONG lParam) } return(FALSE); } + +