00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#include "precomp.h"
00022
#pragma hdrstop
00023
#pragma hdrstop
00024
00025 CHAR String[11] =
"detachedpr";
00026
00027
BOOL
00028 CallConsoleApi(
00029 IN WORD y
00030 )
00031 {
00032 CHAR_INFO
Buffer[10];
00033 COORD
BufferSize;
00034 COORD BufferCoord;
00035 SMALL_RECT WriteRegion;
00036
int i;
00037
BOOL Success;
00038
00039
BufferSize.X = 10;
00040
BufferSize.Y = 1;
00041 BufferCoord.X = 0;
00042 BufferCoord.Y = 0;
00043 WriteRegion.Left = 0;
00044 WriteRegion.Top = y;
00045 WriteRegion.Right = 14;
00046 WriteRegion.Bottom = y;
00047
for (i=0;i<10;i++) {
00048
Buffer[i].Char.AsciiChar =
String[i];
00049
Buffer[i].Attributes = y;
00050 }
00051 Success = WriteConsoleOutput(GetStdHandle(
STD_OUTPUT_HANDLE),
00052
Buffer,
00053
BufferSize,
00054 BufferCoord,
00055 &WriteRegion
00056 );
00057
return Success;
00058 }
00059
00060
DWORD
00061 main(
00062
int argc,
00063
char *argv[],
00064
char *envp[]
00065 )
00066 {
00067
DbgPrint(
"entering tdetach\n");
00068
if (
CallConsoleApi(5))
00069
DbgPrint(
"TDETACH: CallConsoleApi succeeded\n");
00070 }