WIN.CPP
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*----------------------------GRAPH----------------------------------*/
  2. /*     NAME:UNREAL TIME BAR          */
  3. /*----------------------------GRAPH----------------------------------*/
  4. #include<graphics.h>
  5. #include<conio.h>
  6. #include<dos.h>
  7. void DrawWin(int WINX,int WINY,int WINWIDE,int WINHIGHT) //draw main frame of program
  8. {
  9. setcolor(WHITE);
  10. moveto(WINX+WINWIDE,WINY);
  11. lineto(WINX,WINY);
  12. lineto(WINX,WINY+WINHIGHT);
  13. moveto(WINX+WINWIDE-1,WINY+1);
  14. lineto(WINX+1,WINY+1);
  15. lineto(WINX+1,WINY+WINHIGHT-1);
  16. setcolor(DARKGRAY);
  17. moveto(WINX+1,WINY+WINHIGHT);
  18. lineto(WINX+WINWIDE,WINY);
  19. moveto(WINX+2,WINY+WINHIGHT-1);
  20. lineto(WINX+WINWIDE-1,WINY+WINHIGHT-1);
  21. lineto(WINX+WINWIDE-1,WINY+1);
  22. setfillstyle(SOLID_FILL,LIGHTGRAY);
  23. bar(WINX+2,WINY+2,WINX+WINWIDE-2,WINY+WINHIGHT-2);
  24. setcolor(DARKGRAY);
  25. moveto(WINX+WINWIDE-10,WINY+60);
  26. lineto(WINX+10,WINY+60);
  27. lineto(WINX+10,WINY+WINHIGHT-20);
  28. setcolor(WHITE);
  29. lineto(WINX+WINWIDE-10,WINY+WINHIGHT-20);
  30. lineto(WINX+WINWIDE-10,WINY+60);
  31. }
  32. void main()
  33. {
  34.   int driver=DETECT,mode;
  35.   int NUM;
  36.   registerbgidriver(EGAVGA_driver);
  37.   initgraph(&driver,&mode,"");
  38.   DrawWin(200,250,250,100);
  39.   setcolor(BLUE);
  40.   outtextxy(210,320," Press any key to EXIT... ... ");
  41.   getch();
  42.   closegraph();
  43. }