作者在 2010-09-28 01:48:41 发布以下内容
#include <stdarg.h> //包含va_list
#include <stdio.h> //包含vsprintf()
#include <string.h>
#include <windows.h>
#define OUTSCREEN printf
typedef BOOL (WINAPI *PROCSETCONSOLEDISPLAYMODE)(HANDLE,DWORD,LPDWORD);
PROCSETCONSOLEDISPLAYMODE SetConsoleDisplayMode;
int main()
{
DWORD dwNewMode=1;
DWORD dwOldMode=0;
HMODULE hKernel32 = GetModuleHandle("kernel32");//获取模块的句柄
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);//获取控制台的句柄(标准输出的句柄 )
if (!hKernel32)
return 0;
SetConsoleDisplayMode = (PROCSETCONSOLEDISPLAYMODE)//从kernel32动态链接库中取到GetConsoleDisplayMode这个函数
GetProcAddress(hKernel32,"SetConsoleDisplayMode");
if (!SetConsoleDisplayMode)
return 0;
SetConsoleDisplayMode(hOut,dwNewMode,&dwOldMode);//设置控制台显示方式,dwNewMode为1表示最大化,原来的显示方式放到dwOldMode
printf("Full Screen!\n");
return 0;
}
#include <stdio.h> //包含vsprintf()
#include <string.h>
#include <windows.h>
#define OUTSCREEN printf
typedef BOOL (WINAPI *PROCSETCONSOLEDISPLAYMODE)(HANDLE,DWORD,LPDWORD);
PROCSETCONSOLEDISPLAYMODE SetConsoleDisplayMode;
int main()
{
DWORD dwNewMode=1;
DWORD dwOldMode=0;
HMODULE hKernel32 = GetModuleHandle("kernel32");//获取模块的句柄
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);//获取控制台的句柄(标准输出的句柄 )
if (!hKernel32)
return 0;
SetConsoleDisplayMode = (PROCSETCONSOLEDISPLAYMODE)//从kernel32动态链接库中取到GetConsoleDisplayMode这个函数
GetProcAddress(hKernel32,"SetConsoleDisplayMode");
if (!SetConsoleDisplayMode)
return 0;
SetConsoleDisplayMode(hOut,dwNewMode,&dwOldMode);//设置控制台显示方式,dwNewMode为1表示最大化,原来的显示方式放到dwOldMode
printf("Full Screen!\n");
return 0;
}