win32.c
changeset 1957 2a4aa85373c3
parent 1953 9b545c4af868
child 1991 f3d5e35731a2
equal deleted inserted replaced
1956:e4d095fd0891 1957:2a4aa85373c3
   445 			hinst,
   445 			hinst,
   446 			LoadIcon(hinst, MAKEINTRESOURCE(100)),
   446 			LoadIcon(hinst, MAKEINTRESOURCE(100)),
   447 			LoadCursor(NULL, IDC_ARROW),
   447 			LoadCursor(NULL, IDC_ARROW),
   448 			0,
   448 			0,
   449 			0,
   449 			0,
   450 			"TTD"
   450 			"OTTD"
   451 		};
   451 		};
   452 		registered = true;
   452 		registered = true;
   453 		if (!RegisterClass(&wnd))
   453 		if (!RegisterClass(&wnd))
   454 			error("RegisterClass failed");
   454 			error("RegisterClass failed");
   455 	}
   455 	}
   514 		y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2;
   514 		y = (GetSystemMetrics(SM_CYSCREEN) - h) / 2;
   515 
   515 
   516 		if (_wnd.main_wnd) {
   516 		if (_wnd.main_wnd) {
   517 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
   517 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
   518 		} else {
   518 		} else {
   519 			char Windowtitle[50] = "OpenTTD ";
   519 			char Windowtitle[50];
   520 
   520 
   521 			strncat(Windowtitle, _openttd_revision, lengthof(Windowtitle));
   521 			snprintf(Windowtitle, lengthof(Windowtitle), "OpenTTD %s", _openttd_revision);
   522 
   522 
   523 			_wnd.main_wnd = CreateWindow("TTD", Windowtitle, style, x, y, w, h, 0, 0, _inst, 0);
   523 			_wnd.main_wnd = CreateWindow("OTTD", Windowtitle, style, x, y, w, h, 0, 0, _inst, 0);
   524 			if (_wnd.main_wnd == NULL)
   524 			if (_wnd.main_wnd == NULL)
   525 				error("CreateWindow failed");
   525 				error("CreateWindow failed");
   526 		}
   526 		}
   527 	}
   527 	}
   528 	GameSizeChanged(); // invalidate all windows, force redraw
   528 	GameSizeChanged(); // invalidate all windows, force redraw
  1231 	static char buf[100];
  1231 	static char buf[100];
  1232 	char buff[100];
  1232 	char buff[100];
  1233 
  1233 
  1234 	if (_wininet.InternetOpen == NULL && !LoadLibraryList((void**)&_wininet, wininet_files)) return "can't load wininet.dll";
  1234 	if (_wininet.InternetOpen == NULL && !LoadLibraryList((void**)&_wininet, wininet_files)) return "can't load wininet.dll";
  1235 
  1235 
  1236 	inet = _wininet.InternetOpen("TTD", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
  1236 	inet = _wininet.InternetOpen("OTTD", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
  1237 	if (inet == NULL) { err = "internetopen failed"; goto error1; }
  1237 	if (inet == NULL) { err = "internetopen failed"; goto error1; }
  1238 
  1238 
  1239 	conn = _wininet.InternetConnect(inet, "openttd.com", INTERNET_DEFAULT_HTTP_PORT, "", "", INTERNET_SERVICE_HTTP, 0, 0);
  1239 	conn = _wininet.InternetConnect(inet, "openttd.com", INTERNET_DEFAULT_HTTP_PORT, "", "", INTERNET_SERVICE_HTTP, 0, 0);
  1240 	if (conn == NULL) { err = "internetconnect failed"; goto error2; }
  1240 	if (conn == NULL) { err = "internetconnect failed"; goto error2; }
  1241 
  1241