WCMD: cls command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Attached is a patch which seems to emulate the wcmd cls command.

Changelog:
- Emulate the dos cmd 'cls' from within wcmd

Regards,
Jason
jason  @  the-edmeades.demon.co.uk

Index: builtins.c
===================================================================
RCS file: /home/wine/wine/programs/wcmd/builtins.c,v
retrieving revision 1.10
diff -u -u -r1.10 builtins.c
--- builtins.c	20 Apr 2002 20:54:38 -0000	1.10
+++ builtins.c	28 Apr 2002 21:00:34 -0000
@@ -57,8 +57,20 @@

 void WCMD_clear_screen () {

-  WCMD_output (nyi);
+  /* Emulate by filling the screen from the top left to bottom right with
+        spaces, then moving the cursor to the top left afterwards */
+  COORD topLeft;
+  long screenSize;
+  CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
+  HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);

+  GetConsoleScreenBufferInfo(hStdOut, &consoleInfo);
+  screenSize = consoleInfo.dwSize.X * (consoleInfo.dwSize.Y + 1);
+
+  topLeft.X = 0;
+  topLeft.Y = 0;
+  FillConsoleOutputCharacter(hStdOut, ' ', screenSize, topLeft,
&screenSize);
+  SetConsoleCursorPosition(hStdOut, topLeft);
 }


/***************************************************************************
*

Attachment: wcmdcls.patch.3
Description: Binary data


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux