|
소스를 보니 ID 는 1로 통일이네요.
매 TTimer 마다 핸들을 하나 생성해서 거기에 Timer 하나 할당해서 동작하네요.
ID 신경쓰지 말고 일정 시간간격 별로 모아서 TTimer 하나 할당해서 처리하면 편하죠.
생성자: FWindowHandle := Classes.AllocateHWnd(WndProc);
소멸자: Classes.DeallocateHWnd(FWindowHandle);
procedure TTimer.WndProc(var Msg: TMessage);
begin
with Msg do
if Msg = WM_TIMER then
try
Timer;
except
Application.HandleException(Self);
end
else
Result := DefWindowProc(FWindowHandle, Msg, wParam, lParam);
end;
타이머생성: if SetTimer(FWindowHandle, 1, FInterval, nil) = 0 then
정원종 님이 쓰신 글 :
: VC만 쓰다가 빌더를 시작하니 애로사항이 한둘이 아님니다..
:
: VC에서 SetTimer(hWnd,1,1000,NULL); , SetTimer(hWnd,2,5000,NULL);
:
: 요렇게 id값을 둬서 Ontimer를 호출하는 걸 빌더에선 어떻게 하는지 궁금합니다.
|