program sizeScherz; uses windows; CONST TITLE = 'BOESETATEN.DE sizeScherz 2.00 [© Philipp Winterberg]'; // borderSize : Fensterrahmen für 5 Sekunden breiter // captionSize : Fenstertitel für 5 Sekunden größer // fontSize : Schriftart (Caption/Icon/Menü) für 5 Sekunden größer // menuSize : Menüzeile für 5 Sekunden größer // scrollSize : Scrollbalken für 5 Sekunden größer {$R *.RES} var i, myHeight, myWidth, mySize: integer; tempSize: TNonClientMetrics; procedure fontSize; var oldWidth, oldHeight: integer; procedure iconFont; var tempSize: TIconmetrics; begin tempSize.cbSize:= sizeof(tempSize); SystemParametersInfo(SPI_GETICONMETRICS, sizeof(tempSize), @tempSize, 0); mySize:= 23 + random(42)*2; inc(tempSize.lfFont.lfHeight, mySize); SystemParametersInfo(SPI_SETICONMETRICS, sizeof(tempSize), @tempSize, SPIF_UPDATEINIFILE or SPIF_SENDWININICHANGE); sleep(5000 + random(3000)); dec(tempSize.lfFont.lfHeight, mySize); SystemParametersInfo(SPI_SETICONMETRICS, sizeof(tempSize), @tempSize, SPIF_UPDATEINIFILE or SPIF_SENDWININICHANGE); end; begin tempSize.cbSize:= sizeof(tempSize); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); mySize:= 23 + random(42)*2; i:= random(3) + 1; case i of 1: begin oldWidth:= tempSize.iCaptionWidth; oldHeight:= tempSize.iCaptionHeight; inc(tempSize.lfCaptionFont.lfHeight, mySize); end; 2: begin oldWidth:= tempSize.iMenuWidth; oldHeight:= tempSize.iMenuHeight; inc(tempSize.lfMenuFont.lfHeight, mySize); end; 3: iconFont; end; SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); sleep(5000 + random(3000)); case i of 1: begin tempSize.iCaptionWidth:= oldWidth; tempSize.iCaptionHeight:= oldHeight; dec(tempSize.lfCaptionFont.lfHeight, mySize); end; 2: begin tempSize.iMenuWidth:= oldWidth; tempSize.iMenuHeight:= oldHeight; dec(tempSize.lfMenuFont.lfHeight, mySize); end; end; SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); end; procedure menuSize; begin tempSize.cbSize:= sizeof(tempSize); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); myWidth:= 23 + random(42)*2; myHeight:= 23 + random(42)*2; mySize:= 23 + random(42)*2; i:= random(3) + 2; if i = 4 then begin inc(tempSize.iMenuWidth, mySize); inc(tempSize.iMenuHeight, mySize); end; if i = 3 then inc(tempSize.iMenuWidth, myWidth); if i in [2, 3] then inc(tempSize.iMenuHeight, myHeight); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); sleep(5000 + random(3000)); if i = 4 then begin dec(tempSize.iMenuWidth, mySize); dec(tempSize.iMenuHeight, mySize); end; if i = 3 then dec(tempSize.iMenuWidth, myWidth); if i in [2, 3] then dec(tempSize.iMenuHeight, myHeight); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); end; procedure captionSize; begin tempSize.cbSize:= sizeof(tempSize); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); myWidth:= 23 + random(42)*2; myHeight:= 23 + random(42)*2; mySize:= 23 + random(42)*2; i:= random(4) + 1; if i = 4 then begin inc(tempSize.iCaptionWidth, mySize); inc(tempSize.iCaptionHeight, mySize); end; if i in [1, 3] then inc(tempSize.iCaptionWidth, myWidth); if i in [2, 3] then inc(tempSize.iCaptionHeight, myHeight); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); sleep(5000 + random(3000)); if i = 4 then begin dec(tempSize.iCaptionWidth, mySize); dec(tempSize.iCaptionHeight, mySize); end; if i in [1, 3] then dec(tempSize.iCaptionWidth, myWidth); if i in [2, 3] then dec(tempSize.iCaptionHeight, myHeight); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); end; procedure borderSize; begin tempSize.cbSize:= sizeof(tempSize); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); myWidth:= 23 + random(42)*2; inc(tempSize.iBorderWidth, myWidth); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); sleep(5000 + random(3000)); dec(tempSize.iBorderWidth, myWidth); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); end; procedure scrollSize; begin tempSize.cbSize:= sizeof(tempSize); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); myWidth:= 23 + random(42)*2; myHeight:= 23 + random(42)*2; mySize:= 23 + random(42)*2; i:= random(4) + 1; if i = 4 then begin inc(tempSize.iScrollWidth, mySize); inc(tempSize.iScrollHeight, mySize); end; if i in [1, 3] then inc(tempSize.iScrollWidth, myWidth); if i in [2, 3] then inc(tempSize.iScrollHeight, myHeight); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); sleep(5000 + random(3000)); if i = 4 then begin dec(tempSize.iScrollWidth, mySize); dec(tempSize.iScrollHeight, mySize); end; if i in [1, 3] then dec(tempSize.iScrollWidth, myWidth); if i in [2, 3] then dec(tempSize.iScrollHeight, myHeight); SystemParametersInfo(SPI_SETNONCLIENTMETRICS, sizeof(tempSize), @tempSize, 0); end; procedure doScherz; var freQ, Scherz: char; inCrease: longint; Zufall: boolean; begin if length(paramstr(1)) > 1 then Scherz:= paramstr(1)[2] else Scherz:= '9'; if length(paramstr(1)) > 1 then Zufall:= paramstr(1)[2] = '9' else Zufall:= true; if length(paramstr(2)) > 1 then freQ:= paramstr(1)[2] else freQ:= '9'; inCrease:= 1000*60*23; repeat case freQ of '1': sleep(1000*60*60); '2': sleep(1000*60*30); '3': sleep(1000*60*15); '4': sleep(1000*60*05); '5': sleep(1000*60*02); '6': sleep(1000*60); '7': sleep(1000*30); '8': sleep(1000*15); '9': sleep(1000*5); '0': begin sleep(inCrease); if inCrease > 10000 then inCrease:= inCrease div 2 end; else sleep(1000*10); end; sleep(1000*random(3)); if Zufall then else case Scherz of '1': borderSize; '2': captionSize; '3': fontSize; '4': menuSize; '5': scrollSize; else borderSize; end until 1=2; end; // Support Section // -------------------------------------------------------------------------- procedure monitorDistortion; var verbindung : hdc; i: integer; begin verbindung := GetDc(0); for i:= 1 to 10 do begin BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, notsrccopy); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, notsrcerase); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, srcpaint); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, notsrccopy); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, notsrcerase); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, srcpaint); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0 , 0, notsrccopy); BitBlt(verbindung, 0, 0, getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN), verbindung, 0, 0, dstinvert); end; ReleaseDc(0, verbindung); end; // Main Section // -------------------------------------------------------------------------- var actionTimeFrame: longint; begin try SystemParametersInfo(SPI_SCREENSAVERRUNNING, integer(true), Nil, 0); // taskManagerDisable captionSize; randomize; actionTimeFrame:= GetTickCount + 23000; while actionTimeFrame > getTickCount do case random(4) + 1 of 1: borderSize; 2: captionSize; 3: fontSize; 4: menuSize; 5: scrollSize; else borderSize; end finally SystemParametersInfo(SPI_SCREENSAVERRUNNING, integer(false), Nil, 0); //taskManagerEnable end; messagebox(0, pchar( #13#10+ ' Und? Geschockt? *grins*' +#13#10#13#10+ ' Dieses winzige und harmlose Scherzprogramm richtet'+#13#10+ ' keinerlei Schaden an. Ein Klick auf den OK-Button,'+#13#10+ ' und der Spuk ist vorüber...'+#13#10#13#10 + ' P.S.: Schnell Freunde schocken!'+#13#10 ), pchar(TITLE), mb_iconQuestion + mb_OK); monitorDistortion; end.