case CMD_CONNECT: if(ctrl_socket==INVALID_SOCKET) { // FARPROC lpfnMsgProc; int nRC; // lpfnMsgProc=MakeProcInstance((FARPROC)WS_HostMsgProc,hInst); nRC=DialogBox((HANDLE)hInst,(LPCTSTR)"DLG_HOST",hWnd,WS_InputMsgProc); // FreeProcInstance(lpfnMsgProc); if(nRC) { ctrl_socket=(SOCKET)DoConnect(szRemoteHost); } } else SendMessage(hTxtStatus,WM_SETTEXT,0,(LPARAM)"Already connected"); break; case CMD_LIST: if(DoDirList((SOCKET)ctrl_socket,"LIST")==FTP_COMPLETE) { wsprintf(szMsgBuf,"%s %s",szViewer,szTmpFile); WinExec(szMsgBuf,SW_SHOW); } break; case CMD_NLST: if(DoDirList((SOCKET)ctrl_socket,"NLST")==FTP_COMPLETE) { wsprintf(szMsgBuf,"%s %s",szViewer,szTmpFile); WinExec(szMsgBuf,SW_SHOW); } break; case CMD_HELP: command((SOCKET)ctrl_socket,"HELP"); break; case CMD_STATUS: {// FARPROC lpfnMsgProc; int nRC; // lpfnMsgProc = MakeProcInstance((FARPROC)WS_StatMsgProc, hInst); nRC=DialogBox((HANDLE)hInst, (LPCTSTR)"DLG_STATUS", hWnd, WS_StatMsgProc); // FreeProcInstance(lpfnMsgProc); } break; case CMD_PWD: DoPWD((SOCKET)ctrl_socket); break; case CMD_RMD: case CMD_MKD: if(StdInput(NULL,"Enter remote directory name:")) { if(wParam==CMD_RMD) DoRMD(ctrl_socket,szDlgEdit); else if(wParam==CMD_MKD) DoMKD(ctrl_socket,szDlgEdit); } break; case CMD_RETR: if(StdInput(NULL,"Enter remote file name:")) { wsprintf(szDlgPrompt,"RETR %s",szDlgEdit); RetrieveFile(ctrl_socket,szDlgPrompt,szDlgEdit,szDlgEdit,fType); } break; case CMD_STOR: if(StdInput(NULL,"Enter local file name:")) { wsprintf(szDlgPrompt,"STOR %s",szDlgEdit); SendFile(ctrl_socket,szDlgPrompt,szDlgEdit,fType); } break; case CMD_TYPE_I: fType=TYPE_I; break; case CMD_TYPE_A: fType=TYPE_A; break; case CMD_QUOTE: if(StdInput(NULL,"Enter command for remote host:")) DoQUOTE((SOCKET)ctrl_socket,szDlgEdit); break; case CMD_CWD: if(StdInput(NULL,"Enter remote directory name:")) DoCWD((SOCKET)ctrl_socket,szDlgEdit); break; case OPT_SETVIEWER: StdInput(szViewer,"Enter viewer executable name:"); break; case CMD_CLOSE: