[ apex @ 12.11.2005. 14:59 ] @
Zna li neko zasto ovo ne radi?
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i := 1 to (Timer1.Interval) do
    AnalogMeter1.Value := i;
    begin
          if RadioGroup1.Caption = 'LOGOFF' then
          ExitWindowsEx(EWX_LOGOFF,1);
          if RadioGroup1.Caption = 'SHUTDOWN' then
          ExitWindowsEx(EWX_SHUTDOWN,1);
          if RadioGroup1.Caption = 'REBOOT' then
          ExitWindowsEx(EWX_REBOOT,2);
          if RadioGroup1.Caption = 'FORCE' then
          ExitWindowsEx(EWX_FORCE,4);
          if RadioGroup1.Caption = 'POWEROFF' then
          ExitWindowsEx(EWX_POWEROFF,0);
          if RadioGroup1.Caption = 'FORCEIFHUNG' then
          ExitWindowsEx(EWX_FORCEIFHUNG,16);
          if RadioGroup1.Caption = 'HIBERNATE' then
          SetSystemPowerState(False,False);

end;
end;

Probao sam i sa ItemIndex
A ovo radi:
Code:
AnalogMeter1.Value := i;
          if RadioButton1.Checked then
          ExitWindowsEx(EWX_LOGOFF,0);
          if RadioButton2.Checked then
          ExitWindowsEx(EWX_SHUTDOWN,0);
          if RadioButton3.Checked then
          ExitWindowsEx(EWX_REBOOT,0);
          if RadioButton4.Checked then
          ExitWindowsEx(EWX_FORCE,0);
          if RadioButton5.Checked then
          ExitWindowsEx(EWX_POWEROFF,0);
          if RadioButton6.Checked then
          ExitWindowsEx(EWX_FORCEIFHUNG,0);
          if RadioButton7.Checked then
          SetSystemPowerState(False,False);


[Ovu poruku je menjao apex dana 12.11.2005. u 15:59 GMT+1]
[ Milos D @ 13.11.2005. 10:58 ] @
RadioGroup1.Caption je obični caption koji je fiksan i ne zavisi od odabrane opcije.

Predlazem ovakav kod:

case RadioGroup1.ItemIndex of
0 : ExitWindowsEx(EWX_LOGOFF,1);
1 : ExitWindowsEx(EWX_SHUTDOWN,1);
...

Inače gledam tvoj kod...

if RadioButton1.Checked ...

ako koristiš radio group, odakle ti RadioButton1? Tj. ako si koristio RadioGroup.Items onda ne možeš ovako da pristupaš pojedinačnim radio buttonima?!?
[ apex @ 13.11.2005. 13:17 ] @
Citat:
ako si koristio RadioGroup.Items onda ne možeš ovako da pristupaš pojedinačnim radio buttonima?!?
yeeeesssssss.

Code:
case RadioGroup1.ItemIndex of
0 : ExitWindowsEx(EWX_LOGOFF,1);
1 : ExitWindowsEx(EWX_SHUTDOWN,1);
...
- probao, radi hvala