PROGRAM Surprise_Ice; ////////////////////////////////////////////////////////////////////// // #sign:Administrator: PC08: 14/03/2015 09:06:49 PM // Purpose: set a bug form without close // // #path>ples\E:\maxbox3\mXGit39991\maxbox3\examples\les\ // // Lines of Code #locs:115 ////////////////////////////////////////////////////////////////////// Const TEXTOUT = 'Hi PI Earth'; //############################################################################ // Archimedes Spiral Function Fun CODEsign //############################################################################ //TODO: Solve the Song and get the number Function IntToBase32X(Numb: Longint): String; begin Result:= ''; for It:= 0 to 4 do begin Insert(NUMBLETTS[(Numb And 31)+1], Result, 1); Numb:= Numb Shr 5; end; end; function CountPos(const subtxt: string; Text: string): Integer; begin if (Length(subtxt)= 0) Or (Length(Text)= 0) Or (Pos(subtxt,Text)= 0) then result:= 0 else result:= (Length(Text)- Length(StringReplace(Text,subtxt,'', [rfReplaceAll]))) div Length(subtxt); end; Procedure GetSongAndPlay; var mp3Stream: TFileStream; idHTTP: TIDHTTP; myURL, mp3song: string; begin mp3song:= 'heart.mp3'; myURL:= 'http://max.kleiner.com/download/heart.mp3'; if not FileExists(ExePath+mp3song) then begin mp3Stream:= TFileStream.create(ExePath+mp3song, fmCreate) idHTTP:= TIdHTTP.create(NIL) try idhttp.get1(myURL, mp3Stream) finally idHTTP.Free mp3Stream.Free; maxform1.color:= clnavy; end; end; closeMP3; //showmessage(mSecToTime(lengthMP3(mXpath+mp3song))); playMP3(ExePath+mp3song); end; procedure PlaySurpriseMedia; var wmp: Variant; //Maybe you'll be more comfortable with automation. //I believe it would provide most of the functionality as the interfaces provide. begin wmp:= CreateOleObject('WMPlayer.OCX'); //wmp.OpenPlayer(Exepath+'examples\maxbox.wav'); if ISInternet then begin wmp.URL:= 'http://max.kleiner.com/download/heart.mp3'; wmp.OpenPlayer(wmp.URL); end else wmp.OpenPlayer(Exepath+'examples\maxbox.wav'); //wmp.controls.play; end; procedure LoadBug_fromResName(Sender: TObject); var BitMap1: TBitMap; aform: TForm; begin //aform:= TForm.create(self); BitMap1:= TBitMap.Create; bitmap1.transparent:= true; //aform.SetBounds(0,0,300,250) //aform.borderstyle:= bsNone; //bsDialog; try //aform.Show; memo1.hide; BitMap1.LoadFromResourceName(HInstance,'Live'); maxform1.Canvas.Draw(160,160,BitMap1); BitMap1.LoadFromResourceName(HInstance,'Dead'); maxform1.Canvas.Draw(260,260,BitMap1); BitMap1.LoadFromResourceName(HInstance,'Fishes1'); maxform1.Canvas.Draw(400,150,BitMap1); maxform1.canvas.textout(10,100,getBigPI) //aform.Show; sleep(3300) memo1.show; finally BitMap1.Free; end; end; Begin //main writeln('IntToBase32 of 1000: '+IntToBase32X(1000)) PrintF('CountPos: %d',[CountPos('max','this is max of maXbox a max numbermax')]) //writeln(getFormRes('TMaxForm1')) Reverseplay(exepath+'examples\maxbox.wav') //GetSongAndPlay; PlaySurpriseMedia; LoadBug_fromResName(self) End. Ref: RegisterMethod('Constructor Create(AOwner: TComponent)'); RegisterConstructor(@TJvMail.Create, 'Create'); RegisterMethod('Procedure Free'); RegisterMethod(@TJvMail.Destroy, 'Free'); Doc: Der Microsoft-Fehlerberichterstattungsdienst unterstützt Microsoft und deren Partner beim Diagnostizieren von Problemen in der von Ihnen verwendeten Software und beim Bereitstellen von Lösungen. Nicht für alle Probleme können Lösungen bereitgestellt werden. Falls jedoch Lösungen verfügbar sind, werden sie in Form von schrittweisen Anleitungen zur Lösung des gemeldeten Problems oder in Form von zu installierenden Updates bereitgestellt. Um Probleme zu verhindern und die Zuverlässigkeit der Software zu erhöhen, sind einige Lösungen auch in Service Packs und zukünftigen Versionen der Software enthalten. Der Microsoft-Fehlerberichtbestattungsdienst unterstützt Microsoft und deren Partner beim ----app_template_loaded_code----