FILLATT.C
资源名称:MSDN_VC98.zip [点击查看]
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:10k
源码类别:
Windows编程
开发平台:
Visual C++
- /******************************************************************************
- * This is a part of the Microsoft Source Code Samples.
- * Copyright (C) 1993-1997 Microsoft Corporation.
- * All rights reserved.
- * This source code is only intended as a supplement to
- * Microsoft Development Tools and/or WinHelp documentation.
- * See these sources for detailed information regarding the
- * Microsoft samples programs.
- ******************************************************************************/
- #include <windows.h>
- #include <stdio.h>
- #include <string.h>
- #include "console.h"
- #pragma setlocale(".1252")
- /* number of colors in the color bar */
- #define MAXCOLORS 16
- /* horizontal size in characters of the sample text area */
- #define SAMPTEXTX 33
- /* veritcal size in characters of the sample text area */
- #define SAMPTEXTY 5
- /********************************************************************
- * FUNCTION: demoFillAtt(HANDLE hConOut) *
- * *
- * PURPOSE: demonstrate FillConsoleOutputAttribute and *
- * WriteConsoleOutputCharacter. Create a console version of *
- * the "ScreenSize..." menu item from the console system *
- * menu. Allow the user to select a foreground and *
- * background color, which will be immediately displayed in *
- * the sample text box *
- * *
- * INPUT: the console output handle to write to *
- ********************************************************************/
- void demoFillAtt(HANDLE hConOut)
- {
- COORD foregLoc = {5, 5}; /* foreground 'button' location */
- COORD backgLoc = {5, 7}; /* background 'button' location */
- COORD okLoc = {20, 5}; /* ok 'button' location */
- COORD colorbarLoc = {6, 10}; /* loc of first color in colorbar */
- COORD sampleLoc = {5, 13}; /* sample text location */
- COORD dwBufCoord; /* temp COORD structure */
- BOOL bSuccess;
- PCHAR szForeg = "