AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi flood text Protection
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi flood text Protection

Ein Thema von drama22 · begonnen am 4. Nov 2014 · letzter Beitrag vom 5. Nov 2014
 
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

Delphi flood text Protection

  Alt 4. Nov 2014, 21:22
hi i decided to add some flood protection to my chat application so i do something like this
Delphi-Quellcode:
begin
if IsFlood then
  begin
  ShowInfo('Anti-Flood', 20);
  Exit;
end;
end;
Delphi-Quellcode:
procedure TMAIN.ShowInfo(Text: string; Waiting: Integer);
var
  Rect: TRect;
begin
  GetWindowRect(self.Smilebtn.Handle, Rect);
  with pnlFlood do
    begin
      Caption := ' ' + Text + ' ';
      Width := self.Canvas.TextWidth(Text) + 40;
      Left := weblog.Left + 1;
      Top := weblog.Height - Height;
      if TB1.Visible then Top := Top-TB1.Height else Top := Top+TB1.Height;
      Visible := True;
      FloodpSay := 0;
      msgTmr.Enabled := True;
    end;
  FloodClose := Waiting;
end;
basically i have created a unit function called IsFlood and i adjust some visual alert to it here is my is flood unit

Delphi-Quellcode:
unit checkFlood;

  interface
  uses Windows;

  function IsFlood:Boolean;


  var
  LastFloodTime : Integer;
  floods:integer;

  implementation

 function IsFlood:Boolean;
  var
  i, x : integer;
  begin
    Result := False;
    i := trunc(GetTickCount/2);
    x := trunc((i - LastFloodTime)/4);
    Result := False;
if x < //detect flood// then Result := True;
    LastFloodTime := i;
  end;

end.
but i cant detect the fast typing ,, what iam doing wrong any help ?

Geändert von drama22 ( 5. Nov 2014 um 12:55 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:50 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz