Procedure Start // initialise the connection to the database the first time Property Event : TEvent read FEvent write FEvent įunction WhenDone(aValue : PrcDone) : TThDb įunction WithAgencies(aValue : string) : TThDb įunction WithOwner(aValue : TComponent) : TThDb GetTGUIDString simply convert number from to letter, and remove special char to get a random name.įDM : TFDb // is a datamodule who will be created within the treadĬonstructor Create(bSuspended : boolean) I create a form TForm.Create(Self) and I include a frame in it TFrm.Create(Self) When I click on MyForm Create Thread Button, I launch the code bellow Now if you have any suggestions, you're welcome it's too quick, I need to introduce a delay in my loop and everything is working PostMessage(Handle, WM_STRINGMESSAGE, ACTION_CHANGECAPTION, Integer(TStrMsgObject.Found the prob. Procedure TForm2.btnChangeCaptionClick(Sender: TObject) PostMessage(Handle, WM_STRINGMESSAGE, ACTION_SETCAPTION, Integer(TStrMsgObject.Create('My new caption'))) Procedure TForm2.btnSetCaptionClick(Sender: TObject) Procedure TForm2.WMStringMessage(var Msg: TMessage) Procedure WMStringMessage(var Msg: TMessage) message WM_STRINGMESSAGE Ĭonstructor TStrMsgObject.Create(const aMsg: string) Procedure btnSetCaptionClick(Sender: TObject) Procedure btnChangeCaptionClick(Sender: TObject) Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, unit SendingStringWithPostMessageUsingObjectMainForm In this way, you could not only send strings but also other data as well. Then, in the message handler, use the string and free the object. Create an object containing the string as a property and pass the pointer to the object as Integer LParam.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |