--- mstools/samples/ole/clidemo/dialog.c 2018/08/09 18:21:51 1.1.1.2 +++ mstools/samples/ole/clidemo/dialog.c 2018/08/09 18:24:00 1.1.1.3 @@ -10,8 +10,8 @@ #include //* WINDOWS #include //* OLE -#include "global.h" //* global -#include "demorc.h" //* String table constants +#include "global.h" //* global +#include "demorc.h" //* String table constants #include "register.h" //* Class registration library #include "utility.h" #include "dialog.h" @@ -28,7 +28,7 @@ HWND hwndProp = NULL; HWND hRetry; /*************************************************************************** - * OfnInit() + * OfnInit() * Initializes the standard file dialog OFN structure. **************************************************************************/ @@ -44,12 +44,12 @@ VOID FAR OfnInit( / OFN.hInstance = hInst; OFN.nMaxCustFilter = CBFILTERMAX; OFN.nMaxFile = CBPATHMAX; - OFN.lCustData = NULL; + OFN.lCustData = 0; OFN.lpfnHook = NULL; OFN.lpTemplateName = NULL; OFN.lpstrFileTitle = NULL; - //* Construct the filter string - //* for the Open and Save dialogs + //* Construct the filter string + //* for the Open and Save dialogs lpstr = (LPSTR)szFilterSpec; lstrcat(lpstr, " (*."); lstrcat(lpstr, szDefExtension); @@ -66,7 +66,7 @@ VOID FAR OfnInit( / } /*************************************************************************** - * OfnGetName() + * OfnGetName() * * Calls the standard file dialogs to get a file name **************************************************************************/ @@ -85,7 +85,7 @@ BOOL FAR OfnGetName( / OFN.Flags = OFN_HIDEREADONLY; switch (msg) //* message - { + { case IDM_OPEN: //* open file Normalize(szFileName); OFN.lpstrDefExt = (LPSTR)szDefExtension; @@ -107,7 +107,7 @@ BOOL FAR OfnGetName( / OFN.Flags |= OFN_PATHMUSTEXIST; return GetSaveFileName((LPOPENFILENAME)&OFN); break; - + case IDM_INSERTFILE: //* insert file OFN.lpstrDefExt = NULL; OFN.lpstrFile = (LPSTR)szFileName; @@ -129,7 +129,7 @@ BOOL FAR OfnGetName( / /*************************************************************************** * OfnGetNewLinkName() - Sets up the "Change Link..." dialog box * - * returns LPSTR - fully qualified filename + * returns LPSTR - fully qualified filename **************************************************************************/ LPSTR FAR OfnGetNewLinkName( //* ENTRY: @@ -137,16 +137,16 @@ LPSTR FAR OfnGetNewLinkName( / LPSTR lpstrData //* link data ){ //* LOCAL: LPSTR lpReturn = NULL; //* return string - LPSTR lpstrFile = NULL; //* non-qualified file name + LPSTR lpstrFile = NULL; //* non-qualified file name LPSTR lpstrPath = NULL; //* pathname LPSTR lpstrTemp = NULL; //* work string CHAR szDocFile[CBPATHMAX];//* document name CHAR szDocPath[CBPATHMAX];//* document path name - CHAR szServerFilter[CBPATHMAX]; + CHAR szServerFilter[CBPATHMAX]; CHAR szCaption[CBMESSAGEMAX]; - //* Figure out the link's path - //* name and file name + //* Figure out the link's path + //* name and file name lpstrTemp = lpstrData; while (*lpstrTemp++); lpstrPath = lpstrFile = lpstrTemp; @@ -157,14 +157,14 @@ LPSTR FAR OfnGetNewLinkName( / //* Copy the document name lstrcpy(szDocFile, lpstrFile); *(lpstrFile - 1) = 0; - //* Copy the path name + //* Copy the path name lstrcpy(szDocPath, ((lpstrPath != lpstrFile) ? lpstrPath : "")); if (lpstrPath != lpstrFile) //* Restore the backslash *(lpstrFile - 1) = '\\'; - while (*lpstrFile != '.' && *lpstrFile)//* Get the extension + while (*lpstrFile != '.' && *lpstrFile)//* Get the extension lpstrFile++; - //* Make a filter that respects - //* the link's class name + //* Make a filter that respects + //* the link's class name OFN.hwndOwner = hwnd; OFN.nFilterIndex = RegMakeFilterSpec(lpstrData, lpstrFile, szServerFilter); OFN.lpstrDefExt = NULL; @@ -177,7 +177,7 @@ LPSTR FAR OfnGetNewLinkName( / OFN.Flags = OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; //* If we get a file... */ - if (GetOpenFileName((LPOPENFILENAME)&OFN)) + if (GetOpenFileName((LPOPENFILENAME)&OFN)) { if (!(lpReturn = GlobalLock(GlobalAlloc(LHND, CBPATHMAX)))) goto Error; @@ -193,11 +193,11 @@ LPSTR FAR OfnGetNewLinkName( / Error: //* ERROR Tag return NULL; //* ERROR return - + } /*************************************************************************** - * Normalize() + * Normalize() * Removes the path specification from the file name. * * Note: It isn't possible to get ":" as input because @@ -210,7 +210,7 @@ VOID Normalize( / LPSTR lpstrBackslash = NULL;//* back slash LPSTR lpstrTemp = lpstrFile;//* file name - while (*lpstrTemp) + while (*lpstrTemp) { if (*lpstrTemp == '\\') lpstrBackslash = lpstrTemp; @@ -223,7 +223,7 @@ VOID Normalize( / } /*************************************************************************** - * AddExtension() + * AddExtension() * * Adds the extension corresponding to the filter dropdown. **************************************************************************/ @@ -232,22 +232,22 @@ VOID AddExtension( / LPOPENFILENAME lpOFN //* open file structure ){ - if (lpOFN->nFileExtension == (WORD)lstrlen(lpOFN->lpstrFile) - && lpOFN->nFilterIndex) + if (lpOFN->nFileExtension == (WORD)lstrlen(lpOFN->lpstrFile) + && lpOFN->nFilterIndex) { LPSTR lpstrFilter = (LPSTR)lpOFN->lpstrFilter; - while (*lpstrFilter && --lpOFN->nFilterIndex) + while (*lpstrFilter && --lpOFN->nFilterIndex) { while (*lpstrFilter++) ; while (*lpstrFilter++) ; } - //* If we got to the filter, - if (*lpstrFilter) //* retrieve the extension + //* If we got to the filter, + if (*lpstrFilter) //* retrieve the extension { while (*lpstrFilter++) ; lpstrFilter++; - //* Copy the extension + //* Copy the extension if (lpstrFilter[1] != '*') lstrcat(lpOFN->lpstrFile, lpstrFilter); } @@ -264,16 +264,16 @@ VOID AddExtension( / BOOL APIENTRY fnInsertNew( //* ENTRY: HWND hDlg, //* standard dialog box paramters - UINT msg, - WPARAM wParam, + UINT msg, + WPARAM wParam, LPARAM lParam //* (LPSTR) class name ){ //* LOCAL: - HWND hwndList; //* handle to listbox + HWND hwndList; //* handle to listbox static LPSTR lpClassName; //* classname for return value - + hwndList = GetDlgItem(hDlg, IDD_LISTBOX); - switch (msg) + switch (msg) { case WM_INITDIALOG: if (!RegGetClassNames(hwndList)) @@ -289,7 +289,7 @@ BOOL APIENTRY fnInsertNew( / WORD wID = LOWORD(wParam); WORD wCmd = HIWORD(wParam); - switch (wID) + switch (wID) { case IDD_LISTBOX: if (wCmd != LBN_DBLCLK) @@ -306,7 +306,7 @@ BOOL APIENTRY fnInsertNew( / break; } } - return FALSE; + return FALSE; } @@ -316,14 +316,14 @@ BOOL APIENTRY fnInsertNew( / * Manage the link properties dialog box. **************************************************************************/ -VOID FAR LinkProperties() +VOID FAR LinkProperties() { //* LOCAL DialogBox ( - hInst, - MAKEINTRESOURCE(DTPROP), - hwndFrame, - (DLGPROC)fnProperties + hInst, + MAKEINTRESOURCE(DTPROP), + hwndFrame, + (DLGPROC)fnProperties ); } @@ -332,7 +332,7 @@ VOID FAR LinkProperties() * fnProperties() * * Dialog procedure for link properties. The Links dialog allows the user to - * change the link options, edit/play the object, cancel the link as + * change the link options, edit/play the object, cancel the link as * well change links. * * returns BOOL - TRUE if processed, FALSE otherwise @@ -340,18 +340,18 @@ VOID FAR LinkProperties() BOOL APIENTRY fnProperties( //* ENTRY: HWND hDlg, //* standard dialog box parameters - UINT msg, - WPARAM wParam, + UINT msg, + WPARAM wParam, LPARAM lParam //* (HWND) child window with focus ){ //* LOCAL: static APPITEMPTR *pLinks; //* pointer to links (associated windows) static INT nLinks; //* number of links - static HWND hwndList; //* handle to listbox window + static HWND hwndList; //* handle to listbox window static BOOL fTry; - switch (msg) + switch (msg) { - case WM_INITDIALOG: + case WM_INITDIALOG: hwndProp = hDlg; hwndList = GetDlgItem(hDlg, IDD_LINKNAME); if (!(InitLinkDlg(hDlg, &nLinks, hwndList, &pLinks))) @@ -359,11 +359,11 @@ BOOL APIENTRY fnProperties( / UpdateLinkButtons(hDlg,nLinks,hwndList,pLinks); break; - case WM_COMMAND: + case WM_COMMAND: { WORD wID = LOWORD(wParam); - switch (wID) + switch (wID) { case IDD_CHANGE: //* change links BLOCK_BUSY(fTry); @@ -389,13 +389,13 @@ BOOL APIENTRY fnProperties( / if (!SendMessage(GetDlgItem(hDlg,wParam),BM_GETCHECK, 0, 0L)) { CheckRadioButton(hDlg, IDD_AUTO ,IDD_MANUAL ,wParam); - ChangeUpdateOptions(hDlg,nLinks,hwndList,pLinks, + ChangeUpdateOptions(hDlg,nLinks,hwndList,pLinks, (wParam == IDD_AUTO ? oleupdate_always : oleupdate_oncall)); UpdateLinkButtons(hDlg,nLinks,hwndList,pLinks); } return TRUE; - case IDD_LINKNAME: + case IDD_LINKNAME: if (HIWORD(wParam) == LBN_SELCHANGE) UpdateLinkButtons(hDlg,nLinks,hwndList,pLinks); return TRUE; @@ -404,16 +404,16 @@ BOOL APIENTRY fnProperties( / BLOCK_BUSY(fTry); UndoObjects(); END_PROP_DLG(hDlg,pLinks); - return TRUE; + return TRUE; case IDOK: BLOCK_BUSY(fTry); DelUndoObjects(FALSE); END_PROP_DLG(hDlg,pLinks); - return TRUE; - } + return TRUE; + } } - } + } return FALSE; } @@ -428,7 +428,7 @@ static BOOL InitLinkDlg ( / HWND hDlg, //* dialog box handle INT *nLinks, //* pointer to number of links HWND hwndList, //* listbox handle - APPITEMPTR **pLinks //* list of window handles of links + APPITEMPTR **pLinks //* list of window handles of links ){ //* LOCAL APPITEMPTR pItem; //* application item pointer LPSTR lpstrData = NULL; //* pointer to link data @@ -439,24 +439,24 @@ static BOOL InitLinkDlg ( / APPITEMPTR pTop; //* pointer to the top object if (!(*pLinks = (APPITEMPTR *)LocalLock(LocalAlloc(LHND,sizeof(APPITEMPTR)*10)))) - { - ErrorMessage(E_FAILED_TO_ALLOC); - return NULL; - } + { + ErrorMessage(E_FAILED_TO_ALLOC); + return 0; + } *nLinks = 0; //* set tabs SendMessage(hwndList,WM_SETREDRAW,FALSE,0L); //* enumerate child windows for (pTop = pItem = GetTopItem(); pItem; pItem = GetNextItem(pItem)) { - if (pItem->otObject == OT_LINK && pItem->fVisible) + if (pItem->otObject == OT_LINK && pItem->fVisible) { - *(*pLinks + *nLinks) = pItem; + *(*pLinks + *nLinks) = pItem; if (!((*nLinks += 1)%10)) { //* add blocks of ten hWork = LocalHandle((LPSTR)(*pLinks)); LocalUnlock(hWork); - if (!(hWork = LocalReAlloc(hWork,(*nLinks+10)*sizeof(APPITEMPTR),NULL))) + if (!(hWork = LocalReAlloc(hWork,(*nLinks+10)*sizeof(APPITEMPTR),0))) { ErrorMessage(E_FAILED_TO_ALLOC); return FALSE; //* ERROR return @@ -478,12 +478,12 @@ static BOOL InitLinkDlg ( / if (fSelect) SendMessage(hwndList, LB_SETSEL, 1, 0L); - + SendMessage(hwndList,WM_SETREDRAW,TRUE,0L); - UpdateWindow(hwndList); + UpdateWindow(hwndList); return TRUE; //* SUCCESS return - + } /**************************************************************************** @@ -500,11 +500,11 @@ static VOID MakeListBoxString( / CHAR szType[CBMESSAGEMAX];//* holds update option string LPSTR lpTemp; //* working string pointer INT i; //* index - + //* get classname RegGetClassId(lpBoxData, lpLinkData); lstrcat(lpBoxData, " - "); //* ads tab - + while (*lpLinkData++); //* skip to document name lpTemp = lpLinkData; @@ -516,7 +516,7 @@ static VOID MakeListBoxString( / } lstrcat(lpBoxData, lpLinkData); lstrcat(lpBoxData, " - "); - + while (*lpLinkData++); //* copy item data lstrcat(lpBoxData, lpLinkData); lstrcat(lpBoxData, " - "); @@ -553,7 +553,7 @@ static VOID UpdateLinkButtons( / iStatic = iAuto = iManual = 0; - for (i = 0; i < nLinks; i++) //* enum selected links + for (i = 0; i < nLinks; i++) //* enum selected links { if (SendMessage(hwndList, LB_GETSEL, i, 0L)) { @@ -562,8 +562,8 @@ static VOID UpdateLinkButtons( / iStatic++; else { - switch(pItem->uoObject) - { //* count number of manual and + switch(pItem->uoObject) + { //* count number of manual and case oleupdate_always: //* automatic links selected iAuto++; break; @@ -592,23 +592,23 @@ static VOID UpdateLinkButtons( / EnableWindow(GetDlgItem(hDlg, IDD_MANUAL),FALSE); } else - { + { EnableWindow(GetDlgItem(hDlg, IDD_UPDATE), TRUE ); EnableWindow(GetDlgItem(hDlg, IDD_FREEZE), TRUE ); if (iAuto && iManual || !(iAuto || iManual)) - { //* Set update buttons + { //* Set update buttons CheckDlgButton(hDlg, IDD_AUTO, FALSE); EnableWindow(GetDlgItem(hDlg, IDD_AUTO),FALSE); CheckDlgButton(hDlg, IDD_MANUAL, FALSE); EnableWindow(GetDlgItem(hDlg, IDD_MANUAL),FALSE); } - else + else { EnableWindow(GetDlgItem(hDlg, IDD_MANUAL), TRUE); EnableWindow(GetDlgItem(hDlg, IDD_AUTO), TRUE); if (iAuto) - { + { CheckDlgButton(hDlg, IDD_AUTO, TRUE); CheckDlgButton(hDlg, IDD_MANUAL, FALSE); } @@ -618,7 +618,7 @@ static VOID UpdateLinkButtons( / CheckDlgButton(hDlg, IDD_MANUAL, TRUE); } } - } + } EnableWindow(GetDlgItem(hDlg, IDD_CHANGE),fChangeLink && aCurName); @@ -645,10 +645,10 @@ static BOOL ChangeLinks( / APPITEMPTR pItem; //* application item LPSTR lpNewDoc = NULL; //* new document ATOM aOldDoc; //* atom of old doc. name - ATOM aCurDoc = NULL; //* atom of change-to doc. name + ATOM aCurDoc = 0; //* atom of change-to doc. name BOOL fMessage = FALSE; //* error message flag LPSTR lpLinkData; //* pointer to link data - + lpLinkData = NULL; //* This loop finds all selected links for (i = 0; i < nLinks; i++) //* and updates them @@ -671,7 +671,7 @@ static BOOL ChangeLinks( / SendMessage(hwndList,WM_SETREDRAW,FALSE,0L); } - ObjSaveUndo(pItem); + ObjSaveUndo(pItem); ObjChangeLinkData(pItem,lpNewDoc); pItem->aLinkName = aCurDoc; lpLinkData = pItem->lpLinkData; @@ -680,7 +680,7 @@ static BOOL ChangeLinks( / pItem->lpLinkData = NULL; } - } + } /************************************************************************* * now deal with non-selected links and look for a match... @@ -694,7 +694,7 @@ static BOOL ChangeLinks( / pItem = *(pLinks+i); if (pItem->otObject == OT_STATIC) continue; - + if (!ObjGetData(pItem,NULL)) continue; @@ -706,9 +706,9 @@ static BOOL ChangeLinks( / CHAR szRename[2*CBMESSAGEMAX]; CHAR szOldDoc[CBMESSAGEMAX]; LPSTR pOldDoc; - + GetAtomName(aOldDoc,szOldDoc,CBMESSAGEMAX); - pOldDoc =(LPSTR)UnqualifyPath(szOldDoc); + pOldDoc =(LPSTR)UnqualifyPath(szOldDoc); LoadString(hInst, IDS_RENAME, szRename, 2*CBMESSAGEMAX); wsprintf( szMessage, @@ -718,20 +718,20 @@ static BOOL ChangeLinks( / pOldDoc ); - if (MessageBox(hDlg, szMessage, - szAppName, MB_YESNO | MB_ICONEXCLAMATION) == IDNO) + if (MessageBox(hDlg, szMessage, + szAppName, MB_YESNO | MB_ICONEXCLAMATION) == IDNO) break; fMessage = TRUE; } - ObjSaveUndo(pItem); + ObjSaveUndo(pItem); ObjChangeLinkData(pItem,lpNewDoc); CHANGE_LISTBOX_STRING(hwndList, i, pItem, pItem->lpLinkData); - + pItem->aLinkName = aCurDoc; } } - } + } if(lpNewDoc) { @@ -740,8 +740,12 @@ static BOOL ChangeLinks( / GlobalFree(hWork); } +#if 0 +// This is bogus -- this memory is owned by OLECLI32.DLL, not this app, +// so it should not be freed here. if (lpLinkData) FreeLinkData(lpLinkData); +#endif SendMessage(hwndList,WM_SETREDRAW,TRUE,0L); InvalidateRect(hwndList,NULL,TRUE); @@ -758,7 +762,7 @@ static BOOL ChangeLinks( / /**************************************************************************** * DisplayUpdate() * - * Get the most up to date rendering information and show it. + * Get the most up to date rendering information and show it. ***************************************************************************/ static VOID DisplayUpdate( //* ENTRY: @@ -769,9 +773,9 @@ static VOID DisplayUpdate( / ){ //* LOCAL: INT i; //* index APPITEMPTR pItem; //* temporary item pointer - - for (i = 0; i < nLinks; i++) + + for (i = 0; i < nLinks; i++) if (SendMessage(hwndList, LB_GETSEL, i, 0L)) { pItem = *(pLinks+i); @@ -792,13 +796,13 @@ static VOID DisplayUpdate( / ***************************************************************************/ static VOID UndoObjects() -{ +{ APPITEMPTR pItem; //* application item pointer //* enum objects for (pItem = GetTopItem(); pItem; pItem = GetNextItem(pItem)) - if (pItem->lpObjectUndo) + if (pItem->lpObjectUndo) ObjUndo(pItem); - + WaitForAllObjects(); } @@ -815,10 +819,10 @@ static VOID DelUndoObjects( / ){ //* LOCAL: APPITEMPTR pItem; //* application item pointer BOOL fPrompted = FALSE; //* prompted user? - + for (pItem = GetTopItem(); pItem; pItem = GetNextItem(pItem)) { - if (pItem->lpObjectUndo) + if (pItem->lpObjectUndo) { if (fPrompt && !fPrompted) //* prompt user in activation case { @@ -826,10 +830,10 @@ static VOID DelUndoObjects( / LoadString(hInst, IDS_SAVE_CHANGES, szPrompt, CBMESSAGEMAX); - if (MessageBox(hwndFrame, szPrompt, + if (MessageBox(hwndFrame, szPrompt, szAppName, MB_YESNO | MB_ICONEXCLAMATION) == IDNO) { - UndoObjects(); + UndoObjects(); return; //* user canceled operation } fPrompted = TRUE; @@ -857,7 +861,7 @@ static VOID CancelLinks( / CHAR pLinkData[OBJECT_LINK_MAX];//* holder of link data SendMessage(hwndList,WM_SETREDRAW,FALSE,0L); - for (i = 0; i < nLinks; i++) + for (i = 0; i < nLinks; i++) if (SendMessage(hwndList, LB_GETSEL, i, 0L)) { pItem = *(pLinks+i); @@ -874,7 +878,7 @@ static VOID CancelLinks( / UpdateWindow(hwndList); } - + /**************************************************************************** * ChangeUpdateOptions() @@ -894,7 +898,7 @@ static VOID ChangeUpdateOptions( / CHAR pLinkData[OBJECT_LINK_MAX]; SendMessage(hwndList,WM_SETREDRAW,FALSE,0L); - + for (i = 0; i < nLinks; i++) //* enum selected objects { if (SendMessage(hwndList, LB_GETSEL, i, 0L)) @@ -922,15 +926,15 @@ static VOID ChangeUpdateOptions( / * * Deal with letting the user know that the program has inadvertently come * across an invalid link. - * - * Global fPropBoxActive - flag to determine whether or not the link dialog + * + * Global fPropBoxActive - flag to determine whether or not the link dialog * box is active. If it is not active we give the * user an opportunity to enter the links property * dialog directly from here. ***************************************************************************/ VOID FAR InvalidLink() -{ +{ if (!hwndProp) DialogBox(hInst, "InvalidLink", hwndFrame, (DLGPROC)fnInvalidLink); @@ -945,21 +949,21 @@ VOID FAR InvalidLink() * About box dialog box procedure. ***************************************************************************/ -BOOL APIENTRY fnInvalidLink( //* ENTRY: +BOOL APIENTRY fnInvalidLink( //* ENTRY: HWND hDlg, //* standard windows dialog box - UINT message, - WPARAM wParam, - LPARAM lParam + UINT message, + WPARAM wParam, + LPARAM lParam ){ - switch (message) + switch (message) { case WM_INITDIALOG: return (TRUE); case WM_COMMAND: if (LOWORD(wParam) == IDD_CHANGE) - LinkProperties(); + LinkProperties(); EndDialog(hDlg, TRUE); return (TRUE); } @@ -973,8 +977,8 @@ BOOL APIENTRY fnInvalidLink( //* * Show the About Box dialog. ***************************************************************************/ -VOID FAR AboutBox() -{ +VOID FAR AboutBox() +{ DialogBox(hInst, "AboutBox", hwndFrame, (DLGPROC)fnAbout); @@ -986,14 +990,14 @@ VOID FAR AboutBox() * About box dialog box procedure. ***************************************************************************/ -BOOL APIENTRY fnAbout( //* ENTRY: +BOOL APIENTRY fnAbout( //* ENTRY: HWND hDlg, //* standard windows dialog box - UINT message, - WPARAM wParam, - LPARAM lParam + UINT message, + WPARAM wParam, + LPARAM lParam ){ - switch (message) + switch (message) { case WM_INITDIALOG: return (TRUE); @@ -1001,8 +1005,8 @@ BOOL APIENTRY fnAbout( // case WM_COMMAND: { WORD wID = LOWORD(wParam); - - if (wID == IDOK || wID == IDCANCEL) + + if (wID == IDOK || wID == IDCANCEL) { EndDialog(hDlg, TRUE); return (TRUE); @@ -1015,7 +1019,7 @@ BOOL APIENTRY fnAbout( // } - + /*************************************************************************** * RetryMessage() * @@ -1027,7 +1031,7 @@ BOOL APIENTRY fnAbout( // VOID FAR RetryMessage ( //* ENTRY: APPITEMPTR paItem, //* application item pointer LONG lParam -){ +){ RETRYPTR pRetry; LONG objectType; HANDLE hData; @@ -1037,7 +1041,7 @@ VOID FAR RetryMessage ( / if (IsWindow(hwndProp)) hwnd = hwndProp; else if (IsWindow(hwndFrame)) - hwnd = hwndFrame; + hwnd = hwndFrame; else return; //* should not happen //* get the busy servers name @@ -1053,11 +1057,11 @@ VOID FAR RetryMessage ( / RegGetClassId(szServerName, GlobalLock(hData)); paItem->aServer = AddAtom(szServerName); GlobalUnlock( hData ); - } + } } else GetAtomName(paItem->aServer,szServerName,KEYNAMESIZE); - + } hData = LocalAlloc(LHND,sizeof(RETRYSTRUCT)); @@ -1080,29 +1084,29 @@ VOID FAR RetryMessage ( / /**************************************************************************** * fnRetry() * - * Retry message box nothing to tricky; however, when a server becomes + * Retry message box nothing to tricky; however, when a server becomes * unbusy a message is posted to automatically get rid of this dialog. * I send a no. ***************************************************************************/ BOOL APIENTRY fnRetry( //* ENTRY HWND hDlg, //* standard dialog entry - UINT message, - WPARAM wParam, + UINT message, + WPARAM wParam, LPARAM lParam ){ static RETRYPTR pRetry; - switch (message) + switch (message) { case WM_COMMAND: { WORD wID = LOWORD(wParam); - switch (wParam) + switch (wParam) { case IDD_SWITCH: - DefWindowProc( hDlg, WM_SYSCOMMAND, SC_TASKLIST, NULL); + DefWindowProc( hDlg, WM_SYSCOMMAND, SC_TASKLIST, 0); break; case IDCANCEL: @@ -1121,10 +1125,10 @@ BOOL APIENTRY fnRetry( // { CHAR szBuffer[CBMESSAGEMAX]; CHAR szText[2*CBMESSAGEMAX]; - + pRetry = (RETRYPTR)lParam; hRetry = hDlg; - + LoadString(hInst, IDS_RETRY_TEXT1, szBuffer, CBMESSAGEMAX); wsprintf(szText, szBuffer, pRetry->lpserver); SetWindowText (GetDlgItem(hDlg, IDD_RETRY_TEXT1), szText); @@ -1132,12 +1136,12 @@ BOOL APIENTRY fnRetry( // LoadString(hInst, IDS_RETRY_TEXT2, szBuffer, CBMESSAGEMAX); wsprintf(szText, szBuffer, pRetry->lpserver); SetWindowText (GetDlgItem(hDlg, IDD_RETRY_TEXT2), szText); - + EnableWindow (GetDlgItem(hDlg, IDCANCEL), pRetry->bCancel); - return TRUE; + return TRUE; } - + default: break; }