WCMD: cls command

Ann and Jason Edmeades us at the-edmeades.demon.co.uk
Sun Apr 28 16:00:54 CDT 2002


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);
 }


/***************************************************************************
*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wcmdcls.patch.3
Type: application/octet-stream
Size: 1006 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20020428/ccebe17e/wcmdcls.patch.obj


More information about the wine-patches mailing list