Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

where to put : while GetMessage(theMessage,0,0,0) in Vcl form!

ruliandiruliandi Member Posts: 15
i go an example about how to get message always on/with API programming. It say that we just put:


bla...

begin //main
.. //Create window
.. //update window
.. //etc

while GetMessage (TheMessage,0,0,0) do
begin
TranslateMessage (theMessage);
DispatchMessage (TheMessage);
end;

end.

before the end of main part (like main in C++)

but how to put that thing (while part) in vcl? where is the main part that will always execute?

I have try to put that on event Form.OnCreate....
but, it end with error (the form never show!)

Thank You!

Comments

  • zibadianzibadian Member Posts: 6,349
    : i go an example about how to get message always on/with API programming. It say that we just put:
    :
    :
    : bla...
    :
    : begin //main
    : .. //Create window
    : .. //update window
    : .. //etc
    :
    : while GetMessage (TheMessage,0,0,0) do
    : begin
    : TranslateMessage (theMessage);
    : DispatchMessage (TheMessage);
    : end;
    :
    : end.
    :
    : before the end of main part (like main in C++)
    :
    : but how to put that thing (while part) in vcl? where is the main part that will always execute?
    :
    : I have try to put that on event Form.OnCreate....
    : but, it end with error (the form never show!)
    :
    : Thank You!
    :
    :
    The C++ Main() routine in the vcl is deeply embedded into the TApplication object and the underlying event handling. The easiest way to handle messages is to assign a method to the TApplication.OnMessage(). All windows messages will be handled as follows:
    - TranslateMessage()
    - OnMessage()
    - DispatchMessage() to appropriate control.
    The various parameters of the OnMessage() event allow you to disable the message handling or to modify the message.
  • ruliandiruliandi Member Posts: 15
    i've try it, and it's works!!

    Thank You Zib!!!
Sign In or Register to comment.