Archive for maj, 2010

Witam... Jest to mój pierwszy post wiec na wstępie witam wszystkich :). Delphi zajmuje się od 4 miesięcy i mam już za sobą szablonowe aplikacje typu notatnik i przeglądarka plików. Postanowiłem napisać coś pożytecznego dla kolegi :) I teraz tak. Błagam wszystkich wiem że jestem słaby w tym co robię ale dopiero się uczę więc nie bluzgajcie na mnie. Jestem tylko człowiekiem. Program :Ma kontrolować czas spędzony na komputerze Założenia MA działać w auto starcie (tu nie dawałem nic w kodzie bo patrz ps1) Ma być nie widoczny w uruchomionych aplikacjach w alt ctrl delete (ok, widac go w procesach ale patrz ps1) Ma nie dać się zamknąć przez alt F4 (to mi się udało) Ma Zamykać się po podaniu hasła (tu znowu proszę się nie śmiać z sposobu w jaki to zrobiłem bo patrz ps1) Ma wyświetlać ile minut komputer jest już wlączony Ma po podanym czasie się wyłączyc (tu mała uwaga w kodzie jest napis koniec ale dodam tam shoutdown-a ale dopiero po waszej opini) po za tym MA DZIAŁAC :) unit Unit1; interface uses MMSystem, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Mask, ExtCtrls, ComCtrls, TabNotBk; type TForm1 = class(TForm) Button1: TButton; GroupBox1: TGroupBox; MaskEdit1: TMaskEdit; Timer1: TTimer; GroupBox2: TGroupBox; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Timer60: TTimer; RadioButton1: TRadioButton; Button2: TButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; GroupBox3: TGroupBox; Timer30: TTimer; Timer90: TTimer; Timer120: TTimer; Label5: TLabel; Button4: TButton; procedure Button1Click(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormCreate(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Timer60Timer(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure RadioButton1Click(Sender: TObject); procedure Timer30Timer(Sender: TObject); procedure Timer90Timer(Sender: TObject); procedure Timer120Timer(Sender: TObject); procedure RadioButton3Click(Sender: TObject); procedure RadioButton4Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);// zamykanie przez haslo aaa begin if maskedit1.Text= 'aaa' then close else ShowMessage ('Zle hasło, przykro mi nadal jestes pod opieką'); end; procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;//wyłaczenie alt f4 Shift: TShiftState); begin if (Key=VK_F4) and (ssAlt in Shift) then Key:=0; end; procedure TForm1.FormCreate(Sender: TObject);//nie ma go w uruchomionych i na pasku begin SetWindowLong(Application.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW) end; procedure TForm1.Timer1Timer(Sender: TObject);//ile od włączenia var ile : integer; begin ile := timegettime() div 60000; Label1.Caption := IntToStr(ile) + 'minut'; end; //PANEL ADMINA WIDOCZNY PO WPISANIU AAA procedure TForm1.RadioButton1Click(Sender: TObject); //30 min begin Timer30.Enabled:=True; Timer60.Enabled:=False; Timer90.Enabled:=False; Timer120.Enabled:=False; end; procedure TForm1.RadioButton2Click(Sender: TObject); //60min begin Timer30.Enabled:=False; Timer60.Enabled:=True; Timer90.Enabled:=False; Timer120.Enabled:=False; end; procedure TForm1.RadioButton3Click(Sender: TObject); //90min begin Timer30.Enabled:=False; Timer60.Enabled:=False; Timer90.Enabled:=True; Timer120.Enabled:=False; end; procedure TForm1.RadioButton4Click(Sender: TObject);//120MIN begin Timer30.Enabled:=False; Timer60.Enabled:=False; Timer90.Enabled:=False; Timer120.Enabled:=True; end; procedure TForm1.Timer30Timer(Sender: TObject); //KOMUNIKATY 30min begin if Label1.Caption='1minut' then Label4.Caption:='29'; if Label1.Caption='2minut' then Label4.Caption:='28'; if Label1.Caption='3minut' then Label4.Caption:='27'; if Label1.Caption='4minut' then Label4.Caption:='26'; if Label1.Caption='5minut' then Label4.Caption:='25'; if Label1.Caption='6minut' then Label4.Caption:='24'; if Label1.Caption='7minut' then Label4.Caption:='23'; if Label1.Caption='8minut' then Label4.Caption:='22'; if Label1.Caption='9minut' then Label4.Caption:='21'; if Label1.Caption='10minut' then Label4.Caption:='20'; if Label1.Caption='11minut' then Label4.Caption:='19'; if Label1.Caption='12minut' then Label4.Caption:='18'; if Label1.Caption='13minut' then Label4.Caption:='17'; if Label1.Caption='14minut' then Label4.Caption:='16'; if Label1.Caption='15minut' then ShowMessage ('Pozostało 15 min'); if Label1.Caption='15minut' then Label4.Caption:='15'; if Label1.Caption='16minut' then Label4.Caption:='14'; if Label1.Caption='17minut' then Label4.Caption:='13'; if Label1.Caption='18minut' then Label4.Caption:='12'; if Label1.Caption='19minut' then Label4.Caption:='11'; if Label1.Caption='20minut' then Label4.Caption:='10'; if Label1.Caption='20minut' then ShowMessage ('Pozostało 10 min'); if Label1.Caption='21minut' then Label4.Caption:='9'; if Label1.Caption='22minut' then Label4.Caption:='8'; if Label1.Caption='23minut' then Label4.Caption:='7'; if Label1.Caption='24minut' then Label4.Caption:='6'; if Label1.Caption='25minut' then Label4.Caption:='5'; if Label1.Caption='26minut' then Label4.Caption:='4'; if Label1.Caption='27minut' then Label4.Caption:='3'; if Label1.Caption='28minut' then Label4.Caption:='2'; if Label1.Caption='29minut' then Label4.Caption:='1'; if Label1.Caption='30minut' then Label4.Caption:='Koniec'; end; procedure TForm1.Timer60Timer(Sender: TObject); //KOMUNIKATY 60min begin if Label1.Caption='1minut' then Label4.Caption:='59'; if Label1.Caption='2minut' then Label4.Caption:='58'; if Label1.Caption='3minut' then Label4.Caption:='57'; if Label1.Caption='4minut' then Label4.Caption:='56'; if Label1.Caption='5minut' then Label4.Caption:='55'; if Label1.Caption='6minut' then Label4.Caption:='54'; if Label1.Caption='7minut' then Label4.Caption:='53'; if Label1.Caption='8minut' then Label4.Caption:='52'; if Label1.Caption='9minut' then Label4.Caption:='51'; if Label1.Caption='10minut' then Label4.Caption:='50'; if Label1.Caption='11minut' then Label4.Caption:='49'; if Label1.Caption='12minut' then Label4.Caption:='48'; if Label1.Caption='13minut' then Label4.Caption:='47'; if Label1.Caption='14minut' then Label4.Caption:='46'; if Label1.Caption='15minut' then Label4.Caption:='45'; if Label1.Caption='16minut' then Label4.Caption:='44'; if Label1.Caption='17minut' then Label4.Caption:='43'; if Label1.Caption='18minut' then Label4.Caption:='42'; if Label1.Caption='19minut' then Label4.Caption:='41'; if Label1.Caption='20minut' then Label4.Caption:='40'; if Label1.Caption='21minut' then Label4.Caption:='39'; if Label1.Caption='22minut' then Label4.Caption:='38'; if Label1.Caption='23minut' then Label4.Caption:='37'; if Label1.Caption='24minut' then Label4.Caption:='36'; if Label1.Caption='25minut' then Label4.Caption:='35'; if Label1.Caption='26minut' then Label4.Caption:='34'; if Label1.Caption='27minut' then Label4.Caption:='33'; if Label1.Caption='28minut' then Label4.Caption:='32'; if Label1.Caption='29minut' then Label4.Caption:='31'; if Label1.Caption='30minut' then Label4.Caption:='30'; if Label1.Caption='30minut' then ShowMessage ('Pozostało 30min.'); if Label1.Caption='31minut' then Label4.Caption:='29'; if Label1.Caption='31minut' then Label4.Caption:='28'; if Label1.Caption='33minut' then Label4.Caption:='27'; if Label1.Caption='34minut' then Label4.Caption:='26'; if Label1.Caption='35minut' then Label4.Caption:='25'; if Label1.Caption='36minut' then Label4.Caption:='24'; if Label1.Caption='37minut' then Label4.Caption:='23'; if Label1.Caption='38minut' then Label4.Caption:='22'; if Label1.Caption='39minut' then Label4.Caption:='21'; if Label1.Caption='40minut' then Label4.Caption:='20'; if Label1.Caption='41minut' then Label4.Caption:='19'; if Label1.Caption='42minut' then Label4.Caption:='18'; if Label1.Caption='43minut' then Label4.Caption:='17'; if Label1.Caption='44minut' then Label4.Caption:='16'; if Label1.Caption='45minut' then Label4.Caption:='15'; if Label1.Caption='46minut' then Label4.Caption:='14'; if Label1.Caption='47minut' then Label4.Caption:='13'; if Label1.Caption='48minut' then Label4.Caption:='12'; if Label1.Caption='49minut' then Label4.Caption:='11'; if Label1.Caption='50minut' then Label4.Caption:='10'; if Label1.Caption='50minut' then ShowMessage('Pozostało 10 minut.'); if Label1.Caption='51minut' then Label4.Caption:='9'; if Label1.Caption='52minut' then Label4.Caption:='8'; if Label1.Caption='53minut' then Label4.Caption:='7'; if Label1.Caption='54minut' then Label4.Caption:='6'; if Label1.Caption='55minut' then Label4.Caption:='5'; if Label1.Caption='56minut' then Label4.Caption:='4'; if Label1.Caption='57minut' then Label4.Caption:='3'; if Label1.Caption='58minut' then Label4.Caption:='2'; if Label1.Caption='59minut' then Label4.Caption:='1'; if Label1.Caption='60minut' then Label4.Caption:='KONIEC'; end; procedure TForm1.Timer90Timer(Sender: TObject); //KOMUNIKATY 90min begin if Label1.Caption='1minut' then Label4.Caption:='89'; if Label1.Caption='2minut' then Label4.Caption:='88'; if Label1.Caption='3minut' then Label4.Caption:='87'; if Label1.Caption='4minut' then Label4.Caption:='86'; if Label1.Caption='5minut' then Label4.Caption:='85'; if Label1.Caption='6minut' then Label4.Caption:='84'; if Label1.Caption='7minut' then Label4.Caption:='83'; if Label1.Caption='8minut' then Label4.Caption:='82'; if Label1.Caption='9minut' then Label4.Caption:='81'; if Label1.Caption='10minut' then Label4.Caption:='80'; if Label1.Caption='11minut' then Label4.Caption:='79'; if Label1.Caption='12minut' then Label4.Caption:='78'; if Label1.Caption='13minut' then Label4.Caption:='77'; if Label1.Caption='14minut' then Label4.Caption:='76'; if Label1.Caption='15minut' then Label4.Caption:='75'; if Label1.Caption='16minut' then Label4.Caption:='74'; if Label1.Caption='17minut' then Label4.Caption:='73'; if Label1.Caption='18minut' then Label4.Caption:='72'; if Label1.Caption='19minut' then Label4.Caption:='71'; if Label1.Caption='20minut' then Label4.Caption:='70'; if Label1.Caption='21minut' then Label4.Caption:='69'; if Label1.Caption='22minut' then Label4.Caption:='68'; if Label1.Caption='23minut' then Label4.Caption:='67'; if Label1.Caption='24minut' then Label4.Caption:='66'; if Label1.Caption='25minut' then Label4.Caption:='65'; if Label1.Caption='26minut' then Label4.Caption:='64'; if Label1.Caption='27minut' then Label4.Caption:='63'; if Label1.Caption='28minut' then Label4.Caption:='62'; if Label1.Caption='29minut' then Label4.Caption:='61'; if Label1.Caption='30minut' then Label4.Caption:='60'; if Label1.Caption='30minut' then ShowMessage ('Pozostało 60min.'); if Label1.Caption='31minut' then Label4.Caption:='59'; if Label1.Caption='31minut' then Label4.Caption:='58'; if Label1.Caption='33minut' then Label4.Caption:='57'; if Label1.Caption='34minut' then Label4.Caption:='56'; if Label1.Caption='35minut' then Label4.Caption:='55'; if Label1.Caption='36minut' then Label4.Caption:='54'; if Label1.Caption='37minut' then Label4.Caption:='53'; if Label1.Caption='38minut' then Label4.Caption:='52'; if Label1.Caption='39minut' then Label4.Caption:='52'; if Label1.Caption='40minut' then Label4.Caption:='51'; if Label1.Caption='41minut' then Label4.Caption:='49'; if Label1.Caption='42minut' then Label4.Caption:='48'; if Label1.Caption='43minut' then Label4.Caption:='47'; if Label1.Caption='44minut' then Label4.Caption:='46'; if Label1.Caption='45minut' then Label4.Caption:='45'; if Label1.Caption='46minut' then Label4.Caption:='44'; if Label1.Caption='47minut' then Label4.Caption:='43'; if Label1.Caption='48minut' then Label4.Caption:='42'; if Label1.Caption='49minut' then Label4.Caption:='41'; if Label1.Caption='50minut' then Label4.Caption:='40'; if Label1.Caption='51minut' then Label4.Caption:='39'; if Label1.Caption='52minut' then Label4.Caption:='38'; if Label1.Caption='53minut' then Label4.Caption:='37'; if Label1.Caption='54minut' then Label4.Caption:='36'; if Label1.Caption='55minut' then Label4.Caption:='35'; if Label1.Caption='56minut' then Label4.Caption:='34'; if Label1.Caption='57minut' then Label4.Caption:='33'; if Label1.Caption='58minut' then Label4.Caption:='32'; if Label1.Caption='59minut' then Label4.Caption:='31'; if Label1.Caption='60minut' then Label4.Caption:='30'; if Label1.Caption='60minut' then ShowMessage('Pozostało 30 minut.'); if Label1.Caption='61minut' then Label4.Caption:='29'; if Label1.Caption='62minut' then Label4.Caption:='28'; if Label1.Caption='63minut' then Label4.Caption:='27'; if Label1.Caption='64minut' then Label4.Caption:='26'; if Label1.Caption='65minut' then Label4.Caption:='25'; if Label1.Caption='66minut' then Label4.Caption:='24'; if Label1.Caption='67minut' then Label4.Caption:='23'; if Label1.Caption='68minut' then Label4.Caption:='22'; if Label1.Caption='69minut' then Label4.Caption:='21'; if Label1.Caption='70minut' then Label4.Caption:='20'; if Label1.Caption='71minut' then Label4.Caption:='19'; if Label1.Caption='72minut' then Label4.Caption:='18'; if Label1.Caption='73minut' then Label4.Caption:='17'; if Label1.Caption='74minut' then Label4.Caption:='16'; if Label1.Caption='75minut' then ShowMessage ('Pozostało 15 min'); if Label1.Caption='75minut' then Label4.Caption:='15'; if Label1.Caption='76minut' then Label4.Caption:='14'; if Label1.Caption='77minut' then Label4.Caption:='13'; if Label1.Caption='78minut' then Label4.Caption:='12'; if Label1.Caption='79minut' then Label4.Caption:='11'; if Label1.Caption='80minut' then Label4.Caption:='10'; if Label1.Caption='80minut' then ShowMessage ('Pozostało 20 min'); if Label1.Caption='81minut' then Label4.Caption:='9'; if Label1.Caption='82minut' then Label4.Caption:='8'; if Label1.Caption='83minut' then Label4.Caption:='7'; if Label1.Caption='84minut' then Label4.Caption:='6'; if Label1.Caption='85minut' then Label4.Caption:='5'; if Label1.Caption='86minut' then Label4.Caption:='4'; if Label1.Caption='87minut' then Label4.Caption:='3'; if Label1.Caption='88minut' then Label4.Caption:='2'; if Label1.Caption='89minut' then Label4.Caption:='1'; if Label1.Caption='90minut' then Label4.Caption:='Koniec'; end; procedure TForm1.Timer120Timer(Sender: TObject); //komunikaty 120 begin if Label1.Caption='1minut' then Label4.Caption:='119'; if Label1.Caption='2minut' then Label4.Caption:='118'; if Label1.Caption='3minut' then Label4.Caption:='117'; if Label1.Caption='4minut' then Label4.Caption:='116'; if Label1.Caption='5minut' then Label4.Caption:='115'; if Label1.Caption='6minut' then Label4.Caption:='114'; if Label1.Caption='7minut' then Label4.Caption:='113'; if Label1.Caption='8minut' then Label4.Caption:='112'; if Label1.Caption='9minut' then Label4.Caption:='111'; if Label1.Caption='10minut' then Label4.Caption:='110'; if Label1.Caption='11minut' then Label4.Caption:='109'; if Label1.Caption='12minut' then Label4.Caption:='108'; if Label1.Caption='13minut' then Label4.Caption:='107'; if Label1.Caption='14minut' then Label4.Caption:='106'; if Label1.Caption='15minut' then Label4.Caption:='105'; if Label1.Caption='16minut' then Label4.Caption:='104'; if Label1.Caption='17minut' then Label4.Caption:='103'; if Label1.Caption='18minut' then Label4.Caption:='102'; if Label1.Caption='19minut' then Label4.Caption:='101'; if Label1.Caption='20minut' then Label4.Caption:='100'; if Label1.Caption='21minut' then Label4.Caption:='99'; if Label1.Caption='22minut' then Label4.Caption:='98'; if Label1.Caption='23minut' then Label4.Caption:='97'; if Label1.Caption='24minut' then Label4.Caption:='96'; if Label1.Caption='25minut' then Label4.Caption:='95'; if Label1.Caption='26minut' then Label4.Caption:='94'; if Label1.Caption='27minut' then Label4.Caption:='93'; if Label1.Caption='28minut' then Label4.Caption:='92'; if Label1.Caption='29minut' then Label4.Caption:='91'; if Label1.Caption='30minut' then Label4.Caption:='90'; if Label1.Caption='30minut' then ShowMessage ('Pozostało 90min.'); if Label1.Caption='31minut' then Label4.Caption:='89'; if Label1.Caption='31minut' then Label4.Caption:='88'; if Label1.Caption='33minut' then Label4.Caption:='87'; if Label1.Caption='34minut' then Label4.Caption:='86'; if Label1.Caption='35minut' then Label4.Caption:='85'; if Label1.Caption='36minut' then Label4.Caption:='84'; if Label1.Caption='37minut' then Label4.Caption:='83'; if Label1.Caption='38minut' then Label4.Caption:='82'; if Label1.Caption='39minut' then Label4.Caption:='81'; if Label1.Caption='40minut' then Label4.Caption:='80'; if Label1.Caption='41minut' then Label4.Caption:='79'; if Label1.Caption='42minut' then Label4.Caption:='78'; if Label1.Caption='43minut' then Label4.Caption:='77'; if Label1.Caption='44minut' then Label4.Caption:='76'; if Label1.Caption='45minut' then Label4.Caption:='75'; if Label1.Caption='46minut' then Label4.Caption:='74'; if Label1.Caption='47minut' then Label4.Caption:='73'; if Label1.Caption='48minut' then Label4.Caption:='72'; if Label1.Caption='49minut' then Label4.Caption:='71'; if Label1.Caption='50minut' then Label4.Caption:='70'; if Label1.Caption='51minut' then Label4.Caption:='69'; if Label1.Caption='52minut' then Label4.Caption:='68'; if Label1.Caption='53minut' then Label4.Caption:='67'; if Label1.Caption='54minut' then Label4.Caption:='66'; if Label1.Caption='55minut' then Label4.Caption:='65'; if Label1.Caption='56minut' then Label4.Caption:='64'; if Label1.Caption='57minut' then Label4.Caption:='63'; if Label1.Caption='58minut' then Label4.Caption:='62'; if Label1.Caption='59minut' then Label4.Caption:='61'; if Label1.Caption='60minut' then Label4.Caption:='60'; if Label1.Caption='60minut' then ShowMessage('Pozostało 60 minut.'); if Label1.Caption='61minut' then Label4.Caption:='59'; if Label1.Caption='62minut' then Label4.Caption:='58'; if Label1.Caption='63minut' then Label4.Caption:='57'; if Label1.Caption='64minut' then Label4.Caption:='56'; if Label1.Caption='65minut' then Label4.Caption:='55'; if Label1.Caption='66minut' then Label4.Caption:='54'; if Label1.Caption='67minut' then Label4.Caption:='53'; if Label1.Caption='68minut' then Label4.Caption:='52'; if Label1.Caption='69minut' then Label4.Caption:='51'; if Label1.Caption='70minut' then Label4.Caption:='50'; if Label1.Caption='71minut' then Label4.Caption:='49'; if Label1.Caption='72minut' then Label4.Caption:='48'; if Label1.Caption='73minut' then Label4.Caption:='47'; if Label1.Caption='74minut' then Label4.Caption:='46'; if Label1.Caption='75minut' then Label4.Caption:='45'; if Label1.Caption='76minut' then Label4.Caption:='44'; if Label1.Caption='77minut' then Label4.Caption:='43'; if Label1.Caption='78minut' then Label4.Caption:='42'; if Label1.Caption='79minut' then Label4.Caption:='41'; if Label1.Caption='80minut' then Label4.Caption:='40'; if Label1.Caption='81minut' then Label4.Caption:='39'; if Label1.Caption='82minut' then Label4.Caption:='38'; if Label1.Caption='83minut' then Label4.Caption:='37'; if Label1.Caption='84minut' then Label4.Caption:='36'; if Label1.Caption='85minut' then Label4.Caption:='35'; if Label1.Caption='86minut' then Label4.Caption:='34'; if Label1.Caption='87minut' then Label4.Caption:='33'; if Label1.Caption='88minut' then Label4.Caption:='32'; if Label1.Caption='89minut' then Label4.Caption:='32'; if Label1.Caption='90minut' then Label4.Caption:='30'; if Label1.Caption='91minut' then Label4.Caption:='29'; if Label1.Caption='92minut' then Label4.Caption:='28'; if Label1.Caption='93minut' then Label4.Caption:='27'; if Label1.Caption='94minut' then Label4.Caption:='26'; if Label1.Caption='95minut' then Label4.Caption:='25'; if Label1.Caption='96minut' then Label4.Caption:='24'; if Label1.Caption='97minut' then Label4.Caption:='23'; if Label1.Caption='98minut' then Label4.Caption:='22'; if Label1.Caption='99minut' then Label4.Caption:='21'; if Label1.Caption='100minut' then Label4.Caption:='20'; if Label1.Caption='101minut' then Label4.Caption:='19'; if Label1.Caption='102minut' then Label4.Caption:='18'; if Label1.Caption='103minut' then Label4.Caption:='17'; if Label1.Caption='104minut' then Label4.Caption:='16'; if Label1.Caption='105minut' then ShowMessage ('Pozostało 15 min'); if Label1.Caption='105minut' then Label4.Caption:='15'; if Label1.Caption='106minut' then Label4.Caption:='14'; if Label1.Caption='107minut' then Label4.Caption:='13'; if Label1.Caption='108minut' then Label4.Caption:='12'; if Label1.Caption='109minut' then Label4.Caption:='11'; if Label1.Caption='110minut' then Label4.Caption:='10'; if Label1.Caption='110minut' then ShowMessage ('Pozostało 10 min'); if Label1.Caption='111minut' then Label4.Caption:='9'; if Label1.Caption='112minut' then Label4.Caption:='8'; if Label1.Caption='113minut' then Label4.Caption:='7'; if Label1.Caption='114minut' then Label4.Caption:='6'; if Label1.Caption='115minut' then Label4.Caption:='5'; if Label1.Caption='116minut' then Label4.Caption:='4'; if Label1.Caption='117minut' then Label4.Caption:='3'; if Label1.Caption='118minut' then Label4.Caption:='2'; if Label1.Caption='119minut' then Label4.Caption:='1'; if Label1.Caption='1200minut' then Label4.Caption:='Koniec'; end; //ukrywa panel admina wyboru czasu procedure TForm1.Button4Click(Sender: TObject); begin RadioButton1.Visible:= False; RadioButton2.Visible:= False; RadioButton3.Visible:= False; RadioButton4.Visible:= False; end; //pokazuje czasu wyboru procedure TForm1.Button2Click(Sender: TObject); begin if maskedit1.Text= 'aaa' then RadioButton1.Visible:= True; if maskedit1.Text= 'aaa' then RadioButton2.Visible:= True; if maskedit1.Text= 'aaa' then RadioButton3.Visible:= True; if maskedit1.Text= 'aaa' then RadioButton4.Visible:= True; end; end. Domyślnie jest 60min. tzn timer 3 jest jako jedyny włączony po starcie programu. Kod opisałem może nie zbyt jasno ale chyba się połapiecie :) Tak wygląda kod i teraz proszę o sugestje jak go uprościć. Szczególnie nie podoba mi się ta cześć z 4 Timerami i jak to zastąpić funkcją która by działała tak. Label1 wyświetla czas od wlaczenia kompa. Label2 tu jest czas do wyłączenia i wlasnie label1 - label2 dało by nam liczbę ujemną która po pomnożeniu przez -1 dała by liczbę minut do końca (to bylo by ok 6 linijek kodu a nie 200 tak jak u mnie) Ale jak to napisać? P.s1 Program jest pisany by kontrolować 12 letnie dziecko więc nikt nie będzie ubijać procesów czy np. łamać hasła TU TEŻ pytanie czy to moje "aaa" może być zmienną która będzie zmieniana przez admina?

[Newbie] [VC++] ToolStripMenuItem - zaznaczony ?

Hej mam sobie rozwijane menu, w jednym z menu mam podmenu, ktore sie rozwija do prwej strony Chcialbym teraz sprawdzic, ktore z pol menu jest zaznaczone (taki ptaszek). Wiec chcialem zrobic tak int number=0; for(int i=0;iDropDownItems->Count;i++) { if(localizationOptionsToolStripMenuItem->DropDownItems[i]->Checked == true) { number=i; } } Niestety wyrzuca blad is not a member of 'System::Windows::Forms::ToolStripItem' Jednak jak sie patrze na wlasciwosci/wlasnosci tego pola to widze, ze znajduje sie tam wlasciwosc Checked wiec chyba powinienem miec mozliwosc jej sprawdzenia? Co robie zle ?
Witam, czy ktoś potrafi mi w jakiś prosty sposób wytłumaczyć dlaczego te 2 obiekty się tak nazywają i jak wygląda ich rola w przesyłaniu pakietów. Oczywiście wiem, że są do tego niezbędne, ale nie rozumiem sposobu ich działania. Na MSDN jest napisane : An AddressFamily member specifies the addressing scheme that a Socket will use to resolve an address. The IPEndPoint class contains the host and local or remote port information needed by an application to connect to a service on a host. By combining the host's IP address and port number of a service, the IPEndPoint class forms a connection point to a service. To do mnie nie przemawia. Właściwie jak to się ma do pakietów? Jakieś nagłówki, coś? Napisałem sobie bardzo prosty programik w C#. Odpaliłem Wiresharka i użyłem Socket.Connect(..); Okazało się, że jakieś pakiety są przesyłane do destination IP: najpierw ten: 0000 00 17 9a db f4 20 00 18 f3 5f cf ee 08 00 45 00 ..... ..._....E. 0010 00 34 26 e0 40 00 80 06 b9 6f c0 a8 01 0e d1 55 .4&.@....o.....U 0020 87 68 c6 be 00 50 eb c4 24 2c 00 00 00 00 80 02 .h...P..$,...... 0030 20 00 5d 9c 00 00 02 04 05 b4 01 03 03 08 01 01 .]............. 0040 04 02 .. później odbiór tego: 0000 00 18 f3 5f cf ee 00 17 9a db f4 20 08 00 45 00 ..._....... ..E. 0010 00 34 88 d5 00 00 39 06 de 7a d1 55 87 68 c0 a8 .4....9..z.U.h.. 0020 01 0e 00 50 c6 be d4 10 f1 95 eb c4 24 2d 80 12 ...P........$-.. 0030 16 58 a1 ac 00 00 02 04 05 96 01 01 04 02 01 03 .X.............. 0040 03 06 .. i znowu wysyłamy: 0000 00 17 9a db f4 20 00 18 f3 5f cf ee 08 00 45 00 ..... ..._....E. 0010 00 28 26 e1 40 00 80 06 b9 7a c0 a8 01 0e d1 55 .(&.@....z.....U 0020 87 68 c6 be 00 50 eb c4 24 2d d4 10 f1 96 50 10 .h...P..$-....P. 0030 01 00 f7 b7 00 00 ...... Co tam właściwie jest zapisane? Do czego to służy? Proszę o jakieś porównanie :P Pozdrawiam Tilosag

[Java] możliwość otworzenia tylko 1 kopii apletu

Witam czy da się sprawdzić z poziomu php lub podczas startu apletu czy jego kopia nie została już uruchomiona?

[Nietuzinkowe tematy] Kod w PDFie

Szukam sposobu wykonywania dowolnej akcji w plikach PDF. Chcę dołączyć do prezentacji pomocną aplikację, która zadaje pytanie o kolor i wczytuje odpowiedzi. Czytałem, że można to jakoś zrobić, ale nie wiem jak. Ma ktoś pomysł?

[Java] do bani

Admin tutaj jest do bani, nie dość że napisał mi wiadomość która nic mi nie dała (dla tych co nie wiedzą to spam 8-O ) a czegoś takiego adminom nie powinno się przydarzać to jeszcze usunęli mój temat.. spodziewałam się czegoś więcej po tym forum.. bywa

[C/C++] wyswiettlaniie zawartosci dysku.

Mam pytanie chodzi o to w jaki sposób najłatwiej wyświetlić katalogi wybranego dysku np.c: albo d:. same foldery znajdujące się bezpośrednio c: or d: jak kto woli użytkownik ma do wyboru.

[Newbie] [Delphi] Algorytm sprawdzający warunki

Witam Potrzebny mi jest algorytm, który sprawdzi warunek i zwroci true lub false. Opisze to w ten sposob i wszystko bedzie jasne: if Sprawdz('(($liczba = 3) or ($liczba = 4) and ($imie = "adolf"))') then ShowMessage(Warunek spelniony) Wczesniej oczywiscie sobie podstawiam do $liczba, $imie zmienne. Potrzeba mi takiej funkcji Sprawdz:) Funkcja musi sobie poradzić z takim prostym zapisem: ($liczba = 5) jak i takim: ((($liczba = 4) or ($liczba > 100) or ($ilosc 3)) and (($imie = 'zenek') and ($adres = 'bunkier 4'))) Gdy sobie pomysle jak to ma wygladac z pos, length, delete to dostaje zwiechy, dlatego zapytalem sie o gotowca krazacego gdzies w necie bo sam sobie nie poradze(nie ze jestem leniwy) nie moge dobrac odpowiednich slow kluczowych dla google, abym sam mogl znalezc rozwiazanie :) Z góry dzięki za pomoc ps: Temat wygrzebałem z kosza, bo jakiś admin się bawił i wyrzucił :)

[Newbie] [delphi] Valuelisteditor Jak zapisac do pliku

Mam problem nie wiem jak zapisac dane ktore mam w valuelisteditor do pliku ?? Moze mi ktos powiedziec jak to zrobic??

[Delphi/Pascal] Twain >= D2009

Witam. Moze ktos korzystal ze skanera, wraz z D2009/10 ? Na pewno w zrodlach jest konflikt z stringami, bo nawet po kompilacji sample nie dzialaja (nie wykrywaja skanera). Same exeki z sampli dzialaly, po skompilowaniu - juz nie.
« Previous posts Back to top