List Info

Thread: Application.Processmessages in a service




Application.Processmessages in a service
user name
2006-06-23 10:31:36

Hi all

Is there an alternative to application.processmessages in a service? i
need some message queues processed as im waiting for a result so in a
normal app id do

while (condition) do
application.processmessages;

but the application variable in a service is of type tserviceapplication
which doesn't have the processmessages procedure.

any ideas?

j

__._,_.___
.

__,_._,___
Application.Processmessages in a service
user name
2006-06-23 13:59:46

Hi,

try this,

procedure TService1.ProcessMessages;
var
Msg: TMsg;
begin
if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;

Ben

-----Original Message-----
From: delphi-enyahoogroups.com [mailto:delphi-enyahoogroups.com]On
Behalf Of Jangita
Sent: 23 June 2006 11:32
To: delphi-enyahoogroups.com
Subject: [delphi-en] Application.Processmessages in a service

Hi all

Is there an alternative to application.processmessages in a service? i
need some message queues processed as im waiting for a result so in a
normal app id do

while (condition) do
application.processmessages;

but the application variable in a service is of type tserviceapplication
which doesn't have the processmessages procedure.

any ideas?

j

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: delphi-en-unsubscribeyahoogroups.com
Yahoo! Groups Links

__._,_.___
.

__,_._,___
Application.Processmessages in a service
user name
2006-06-23 14:01:49

Thanks - works perfectly; just do the normal message loop stuff.

J

Ben Cameron wrote:
>
>
> Hi,
>
> try this,
>;
> procedure TService1.ProcessMessages;
>; var
> Msg: TMsg;
>; begin
>; if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then
> begin
>; TranslateMessage(Msg);
> DispatchMessage(Msg);
> end;
> end;
>
> Ben
>
> -----Original Message-----
> From: delphi-enyahoogroups.com <mailto:delphi-en%40yahoogroups.com>;
> [mailto:delphi-enyahoogroups.com <mailto:delphi-en%40yahoogroups.com>;]On
> Behalf Of Jangita
&gt; Sent: 23 June 2006 11:32
>; To: delphi-enyahoogroups.com <mailto:delphi-en%40yahoogroups.com>;
> Subject: [delphi-en] Application.Processmessages in a service
&gt;
> Hi all
>
> Is there an alternative to application.processmessages in a service? i
> need some message queues processed as im waiting for a result so in a
> normal app id do
>
> while (condition) do
> application.processmessages;
&gt;
> but the application variable in a service is of type tserviceapplication
> which doesn't have the processmessages procedure.
>
> any ideas?
&gt;
> j
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> <http://groups.yahoo.com/group/delphi-en/>
> To unsubscribe: delphi-en-unsubscribeyahoogroups.com
> <mailto:delphi-en-unsubscribe%40yahoogroups.com&gt;
> Yahoo! Groups Links
>;
>

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )