Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.5 KiB

  1. /*MPD::
  2. * Copyright (c) 1996 1997, 1998 Philips CE I&C
  3. *
  4. * Project : Real-i
  5. * module prefix: IMTD
  6. * creation date: Nov, 1996
  7. * author : M.J. Verberne
  8. * description :
  9. *MPE::*/
  10. #include <windows.h>
  11. #include <io.h>
  12. #include <stdio.h>
  13. #include <fcntl.h>
  14. #include "enre.h"
  15. /* ----- CONSTANTS----------------------------------------------------------- */
  16. /* ----- TYPES -------------------------------------------------------------- */
  17. /* ----- GLOBAL VARIABLES --------------------------------------------------- */
  18. /* ----- STATIC VARIABLES --------------------------------------------------- */
  19. /* ----- STATIC FUNCTION DECLARATIONS --------------------------------------- */
  20. /* ----- EXTERNAL FUNCTIONS ------------------------------------------------- */
  21. /******************************************************************************/
  22. void ENRE_init(void)
  23. /******************************************************************************/
  24. {
  25. int hCrt;
  26. FILE *hf;
  27. int i;
  28. COORD size;
  29. HWND hWnd;
  30. char title[256];
  31. int width, height;
  32. AllocConsole();
  33. SetConsoleTitle("Debugging Output");
  34. size = GetLargestConsoleWindowSize(GetStdHandle(STD_OUTPUT_HANDLE));
  35. size.Y = 65356 / size.X;
  36. SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), size);
  37. GetConsoleTitle(title, 256);
  38. hWnd=FindWindow(NULL, title);
  39. // width = GetSystemMetrics(SM_CXFULLSCREEN);
  40. // height =GetSystemMetrics(SM_CYFULLSCREEN)- 480;
  41. width = GetSystemMetrics(SM_CXFULLSCREEN) /2;
  42. height =GetSystemMetrics(SM_CYFULLSCREEN) / 2;
  43. // SetWindowPos(hWnd, HWND_TOP, 0, 480, width, height, 0);
  44. SetWindowPos(hWnd, HWND_TOP, 0, 0, width, height, SWP_NOMOVE | SWP_FRAMECHANGED);
  45. if ( hCrt = _open_osfhandle(
  46. (LONG_PTR) GetStdHandle(STD_OUTPUT_HANDLE),
  47. _O_TEXT ) )
  48. {
  49. if ( hf = _fdopen( hCrt, "w" ) )
  50. {
  51. *stdout = *hf;
  52. }
  53. }
  54. if ( hCrt = _open_osfhandle(
  55. (LONG_PTR) GetStdHandle(STD_ERROR_HANDLE),
  56. _O_TEXT ) )
  57. {
  58. if ( hf = _fdopen( hCrt, "w" ) )
  59. {
  60. *stderr = *hf;
  61. i = setvbuf( stderr, NULL, _IONBF, 0 );
  62. }
  63. }
  64. if ( hCrt = _open_osfhandle(
  65. (LONG_PTR) GetStdHandle(STD_INPUT_HANDLE),
  66. _O_TEXT ) )
  67. {
  68. if ( hf = _fdopen( hCrt, "r" ) )
  69. {
  70. *stdin = *hf;
  71. i = setvbuf( stdin, NULL, _IONBF, 0 );
  72. }
  73. }
  74. }
  75. /******************************************************************************/
  76. void ENRE_exit(void)
  77. /******************************************************************************/
  78. {
  79. FreeConsole();
  80. }