Код:
//+------------------------------------------------------------------+ #property aftar "sabluk" #property scilka "http://ru.youtube.com/watch?v=euCN1SzrJ60" #import "user32.dll" int PostMessageA (int hWnd, int Msg, int wParam, int lParam); #import #define WM_COMMAND 0x0111 int hwnd; color Colors[]={ LightSeaGreen,DarkViolet,FireBrick,MediumVioletRed,MediumSeaGreen,Chocolate,Crimson,SteelBlue, Goldenrod,MediumSpringGreen,LawnGreen,CadetBlue,DarkOrchid,YellowGreen,LimeGreen,OrangeRed, DarkOrange,Orange,Gold,Yellow,Chartreuse,Lime,SpringGreen,Aqua, DeepSkyBlue,Blue,Magenta,Red,Gray,SlateGray,Peru,BlueViolet, LightSlateGray,DeepPink,MediumTurquoise,DodgerBlue,Turquoise,RoyalBlue,SlateBlue,DarkKhaki, IndianRed,MediumOrchid,GreenYellow,MediumAquamarine,DarkSeaGreen,Tomato,RosyBrown,Orchid, MediumPurple,PaleVioletRed,Coral,CornflowerBlue,DarkGray,SandyBrown,MediumSlateBlue,Tan, DarkSalmon,BurlyWood,HotPink,Salmon,Violet,LightCoral,SkyBlue,LightSalmon, Plum,Khaki,Khaki,Plum, LightSalmon,SkyBlue,LightCoral,Violet,Salmon,HotPink,BurlyWood,DarkSalmon, Tan,MediumSlateBlue,SandyBrown,DarkGray,CornflowerBlue,Coral,PaleVioletRed,MediumPurple, Orchid,RosyBrown,Tomato,DarkSeaGreen,MediumAquamarine,GreenYellow,MediumOrchid,IndianRed, DarkKhaki,SlateBlue,RoyalBlue,Turquoise,DodgerBlue,MediumTurquoise,DeepPink,LightSlateGray, BlueViolet,Peru,SlateGray,Gray,Red,Magenta,Blue,DeepSkyBlue, Aqua,SpringGreen,Lime,Chartreuse,Yellow,Gold,Orange,DarkOrange, OrangeRed,LimeGreen,YellowGreen,DarkOrchid,CadetBlue,LawnGreen,MediumSpringGreen,Goldenrod, SteelBlue,Crimson,Chocolate,MediumSeaGreen,MediumVioletRed,FireBrick,DarkViolet,LightSeaGreen}; //+------------------------------------------------------------------+ int init() { int x=24; for(int num=0; num<64; num++) {SNOW(num,x,MathRand()/30); x+=24;} x=24; for(num=0; num<64; num++) {THREE(num,x,MathRand()/30); x+=24;} x=24; for(num=0; num<64; num++) {USD(num,x,MathRand()/30); x+=24;} x=40; for(num=0; num<38; num++) {STAR(num,x,10,0); x+=40;} int y=40; for(num=38; num<66; num++) {STAR(num,10,y,1); y+=40;} x=40; for(num=66; num<104; num++) {STAR(num,x,10,3); x+=40;} y=40; for(num=104; num<132; num++) {STAR(num,10,y,2); y+=40;} for(num=0; num<132; num++) ObjectSet("STAR"+num,OBJPROP_COLOR,Colors[num]); hwnd=WindowHandle(Symbol(),NULL); PostMessageA(hwnd,WM_COMMAND,33324,0); Sleep(5000); for(num=135; num<147; num++) MOVE(1,num); while(true) { MOVE(1,231); MOVE(0,232); MOVE(1,233); MOVE(0,234); MOVE(1,235); MOVE(0,236); MOVE(1,237); MOVE(0,238); } return(0); } //+------------------------------------------------------------------+ void SNOW(int num, int x, int y) { string Name="SNOW"+num; if(ObjectCreate(Name,OBJ_LABEL,0,0,0)) { ObjectSet(Name,OBJPROP_XDISTANCE,x); ObjectSet(Name,OBJPROP_YDISTANCE,y); ObjectSet(Name,OBJPROP_CORNER,0); } ObjectSetText(Name,CharToStr(218),10+MathRand()/2340,"Wingdings 2",White); } //+------------------------------------------------------------------+ void THREE(int num, int x, int y) { string Name="THREE"+num; if(ObjectCreate(Name,OBJ_LABEL,0,0,0)) { ObjectSet(Name,OBJPROP_XDISTANCE,x); ObjectSet(Name,OBJPROP_YDISTANCE,y); ObjectSet(Name,OBJPROP_CORNER,0); } ObjectSetText(Name,CharToStr(249),10+MathRand()/2340,"Wingdings 2",White); } //+------------------------------------------------------------------+ void USD(int num, int x, int y) { string Name="USD"+num; if(ObjectCreate(Name,OBJ_LABEL,0,0,0)) { ObjectSet(Name,OBJPROP_XDISTANCE,x); ObjectSet(Name,OBJPROP_YDISTANCE,y); ObjectSet(Name,OBJPROP_CORNER,0); } ObjectSetText(Name,"$",10+MathRand()/2340,"Arial",ForestGreen); } //+------------------------------------------------------------------+ void STAR(int num, int x, int y, int cor) { string Name="STAR"+num; if(ObjectCreate(Name,OBJ_LABEL,0,0,0)) { ObjectSet(Name,OBJPROP_XDISTANCE,x); ObjectSet(Name,OBJPROP_YDISTANCE,y); ObjectSet(Name,OBJPROP_CORNER,cor); } ObjectSetText(Name,CharToStr(133),30,"Webdings",White); } //+------------------------------------------------------------------+ void MOVE(bool loop, int char) { for(int shift=0; shift<132; shift++) { ObjectSetText("STAR"+shift,CharToStr(char),30,"Wingdings 2"); if(loop) for(int num=131; num>=0; num--) { if(num-shift>=0) ObjectSet("STAR"+num,OBJPROP_COLOR,Colors[num-shift]); else ObjectSet("STAR"+num,OBJPROP_COLOR,Colors[num-shift+132]); } else for(num=0; num<132; num++) { if(num+shift<132) ObjectSet("STAR"+num,OBJPROP_COLOR,Colors[num+shift]); else ObjectSet("STAR"+num,OBJPROP_COLOR,Colors[num+shift-132]); } for(num=0; num<64; num++) { string Name="SNOW"+num; int font=ObjectGet(Name,OBJPROP_FONTSIZE); int y=ObjectGet(Name,OBJPROP_YDISTANCE); if(y>1200) { ObjectSet(Name,OBJPROP_YDISTANCE,1); ObjectSet(Name,OBJPROP_FONTSIZE,10+MathRand()/2340); } else ObjectSet(Name,OBJPROP_YDISTANCE,y+font/10); } for(num=0; num<64; num++) { Name="THREE"+num; font=ObjectGet(Name,OBJPROP_FONTSIZE); y=ObjectGet(Name,OBJPROP_YDISTANCE); if(y>1200) { ObjectSet(Name,OBJPROP_YDISTANCE,1); ObjectSet(Name,OBJPROP_FONTSIZE,10+MathRand()/2340); } else ObjectSet(Name,OBJPROP_YDISTANCE,y+font/10); } for(num=0; num<64; num++) { Name="USD"+num; font=ObjectGet(Name,OBJPROP_FONTSIZE); y=ObjectGet(Name,OBJPROP_YDISTANCE); if(y>1200) { ObjectSet(Name,OBJPROP_YDISTANCE,1); ObjectSet(Name,OBJPROP_FONTSIZE,10+MathRand()/2340); } else ObjectSet(Name,OBJPROP_YDISTANCE,y+font/10); } PostMessageA(hwnd,WM_COMMAND,33324,0); Sleep(50); } }
Отредактировано sabluk (2008-12-31 08:44:34)