Maximization of Win32API Console - C Language Description

xiaoxiao2021-03-06  43

Principle: First get the Handle of the Console window, then control it to maximize the compilation environment: VC 7 platform: Win2000 above #define _win32_winnt 0x0500 / * To define the Windows version, Win2000 is 5.0 * / # include # INCLUDE

/ * The function of this program is to maximize current console window, but can only run at 2000 / xp / 2003 * // * GetConsoleWindow: The GetConsoleWindow function retrieves the window handle used by the console associated with the calling process Client:. Included in Windows XP and Windows 2000 Professional. Server: Included in Windows Server 2003 and Windows 2000 Server. Header: Declared In WinCon.h; Include Windows.h. Library: USE KERNEL32.LIB. * /

Void main () {hwnd hconsole; hconsole = getConsoleWindow (); / * Get the current Console window handle, then you can make your favorite operation * / if (hconsole == null) {Printf ("Error./n "); / * Unsuccessful * /} else {showwindow (hconsole, sw_showmaximized); / * Maximum window * / / / * Description, Maximization is also a Full Screen, see: ms-help: //ms.vscc. 2003 / ms.msdnqtr.2003feb.2052 / dllproc / base / getConsoleDisplayMode.htm * /}

PRINTF ("press entry to amount ... / n"); getchar ();

转载请注明原文地址:https://www.9cbs.com/read-56944.html

New Post(0)