This is a pretty straight forward procedure and I will explain it to you below. I first want to point out a few things wrong with the code. 1.) There is no way to get those logged messages. I compensated for that by making 3 changes which I will explain below after the windows stuff. I am planning on sometime for adding the capability of the messages being sent to the window in a list box or something similar in the future. If you like let me know and I can keep you updated. 2.) Although I tried to maintain the cross platform issue I don't have Unix so I am not sure if it still is. Let me know if you do have Unix and compiler after making the changes (Thanks :) Let's start then... *** Open your comm.c file and cut and paste this section between the *** START and STOP markers above your main() function: START=============================================== #ifdef CIRCLE_WINDOWS /* ** function prototype of main() */ int main(int argc, char **argv); /* ** Windows global variables */ HWND hWnd; /* Here for future use in expanded Windows capabilities */ HINSTANCE hInst; /* and used in InitWindow */ int CmdShow; /* " */ /* ** CircleMudProc to run under windows */ LRESULT CALLBACK _export CircleMudProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: /* Window is closing and we send a WM_DESTROY Message */ DestroyWindow(hwnd); break; case WM_QUERYENDSESSION: /* Windows wants to know if it can end and close us */ return ((long) TRUE); case WM_ENDSESSION: /* All apps agreed to being closed so this it! */ /* We don't even get a WM_DESTROY Message here */ if(wParam) circle_shutdown = 1; break; case WM_DESTROY: /* We are destroying the window and closing the app */ circle_shutdown = 1; PostQuitMessage(0); break; default: return (DefWindowProc(hwnd, msg, wParam, lParam)); } return (0L); } /* ** InitWindow */ void InitWindow(void) { /* ** Init the Window stuff here... */ WNDCLASS wcCircleMudClass; /* Define the window class for this application. */ wcCircleMudClass.lpszClassName = "CircleMud"; wcCircleMudClass.hInstance = hInst; wcCircleMudClass.lpfnWndProc = CircleMudProc; wcCircleMudClass.hCursor = LoadCursor(NULL, IDC_ARROW); wcCircleMudClass.hIcon = 0; wcCircleMudClass.lpszMenuName = (LPSTR) NULL; wcCircleMudClass.hbrBackground = GetStockObject(WHITE_BRUSH); wcCircleMudClass.style = CS_HREDRAW | CS_VREDRAW; wcCircleMudClass.cbClsExtra = 0; wcCircleMudClass.cbWndExtra = 0; /* Register the class */ if(RegisterClass(&wcCircleMudClass) == 0) { MessageBox(0, "Could not register Window", "CircleMud", MB_ICONHAND|MB_OK); exit(1); } /* Create Applications Main Window */ hWnd = CreateWindow( "CircleMud", "CircleMud 3.0 Win95/NT Server", WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, 0, 0, 200, 100, NULL, NULL, hInst, NULL ); ShowWindow(hWnd, CmdShow); } /* ** WinMain for Windows */ #pragma argsused int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpCmdLine, int nCmdShow) { int argc = 1; /* for the parsing and call of main. */ int i; char** argv; /* used in parsing and call of main. */ hInst = hInstance; CmdShow = nCmdShow; /* ** Parse the command line and feed it to the main ** function to take over */ if(strcmp(lpCmdLine, "")) { /* Find out the number of tokens in the string */ for(i = 0; i < strlen(lpCmdLine); i++) { if(lpCmdLine[i] == ' ') argc++; } argc++; /* the last token in the string won't have a trailing space. */ /* allocate memory */ argv = malloc(argc + 1); /* fill the array */ argv[0] = "circle.exe"; /* program file name */ argv[1] = strtok(lpCmdLine, " "); /* get the first token */ for(i = 2; i < argc; i++) argv[i] = strtok(NULL, " "); /* pull out any others */ /* finish the array off. */ argv[argc + 1] = '\0'; } else { /* allocate the memory */ argv = malloc(2); /* fill the array */ argv[0] = "circle.exe"; /* the progam file name */ argv[1] = '\0'; /* terminate the struct */ } /* ** Call the main function with the parsed command line parameters */ main(argc, argv); /* free the memory allocated for cmdline parameters */ free(argv); return 0; } #endif STOP================================================== Add this section above game_loop() START================================================= /* ** wait_for_connection ** Used for windows or defined when compiled for non-unix */ #ifdef CIRCLE_WINDOWS long wait_for_connection(int mother_desc, fd_set* input_set) { struct timeval wait; long err; MSG msg; wait.tv_sec = 0; wait.tv_usec = 10; do { if(circle_shutdown) return 0; FD_ZERO(input_set); FD_SET(mother_desc, input_set); err = select(mother_desc + 1, input_set, (fd_set *) 0, (fd_set *) 0, &wait); if(PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { if(msg.message == WM_QUIT) return 0; TranslateMessage(&msg); DispatchMessage(&msg); } } while(err == 0); return err; } #else #define wait_for_connection(md, is) select(md + 1, &is, (fd_set *) 0, (fd_set *) 0, NULL) #endif STOP=================================================== *** Add as the first thing in game_loop. #ifdef CIRCLE_WINDOWS MSG msg; #endif *** Add immediately after gettimeofday in the same function before the while *** statement: #ifdef CIRCLE_WINDOWS InitWindow(); #endif *** Add immediatly after the while statement #ifdef CIRCLE_WINDOWS /* ** Give Windows priority over circle mud... ** Why? I don't know. Move it if you want. */ if(PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) { if(msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } #endif *** About 5 lines below that change if (select(mother_desc, &input_set, (fd_set *) 0, (fd_set *) 0, NULL) < 0) { *** to if (wait_for_connection(mother_desc, &input_set) < 0) { *** Now you are done that takes care of the windows portion. If you *** want to make it so the log messages are stored in a file do this. *** In your conf.h file add a define. I used: #define LOG_TO_FILE *** Then in utils.c, add this above the log() function: #ifdef LOG_TO_FILE FILE* logfp; #endif *** And in the log() function change: fprintf(stderr, "%-19.19s :: %s\n", tmstr, str); *** to #ifdef LOG_TO_FILE fprintf(logfp, "%-19.19s :: %s\n", tmstr, str); #else fprintf(stderr, "%-19.19s :: %s\n", tmstr, str); #endif *** In comm.c, add this after your extern variables at the top of the file: #ifdef LOG_TO_FILE extern FILE *logfp; #endif *** Add something similar to this in your main function after the variables *** are declared: #ifdef LOG_TO_FILE logfp = fopen("circle.log", "a+"); if(logfp == NULL) exit(1); #endif *** Add this to the end of your main function: #ifdef LOG_TO_FILE fclose(logfp); #endif