Хелпикс

Главная

Контакты

Случайная статья





menu_gr.cpp : Defines the entry point for the console application.



// menu_gr.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include "MENU_win.h"

#include <dos.h>

void vivodtext(int x,int y,char* s)

{

    hFont=CreateFontIndirect(&Lf);

    hOldFont=(HFONT)SelectObject(hDC,hFont);

    SetTextColor(hDC,RGB(0,0,0));

    SetBkColor(hDC,RGB(255,255,0));

    TextOut(hDC,x,y,(LPCSTR)s,strlen(s));

    SelectObject(hDC,hOldFont);

DeleteObject(hFont);

}

int _tmain(int argc, _TCHAR* argv[])

{

    hWnd=GetConsoleWindow();

    if(!hWnd)

{

   printf("Can't get hWnd of console!\n");

              getch();

   return -1;

}

    MoveWindow(hWnd,0,0,800,600,TRUE);

hDC=GetDC(hWnd);

if(!hDC)

{

   printf("Can't get device context!\n");

              getch();

   return -2;

}

GetClientRect(hWnd,&Rect);

    clearscreen();

char *S[]={"Input ","Output ","Record ","Exit "};

int m=0;

Menu M=menu_init(S,4,4,60,30,4);

do

{

m=menu_vert(&M);

switch(m)

{

case 0:

              vivodtext(100,200,"First punkt");

    getch();

    break;

case 1:vivodtext(100,240,"Second punkt");

    getch();

    break;

case 2:vivodtext(100,280,"Three punkt");

    getch();

}

}

while(m!=3);

menu_del(&M);

ReleaseDC(hWnd, hDC);   

    return 0;

}

 



  

© helpiks.su При использовании или копировании материалов прямая ссылка на сайт обязательна.