{"id":22173255,"url":"https://github.com/digao-dalpiaz/dztalkapp","last_synced_at":"2025-07-12T05:02:36.900Z","repository":{"id":47132689,"uuid":"174860047","full_name":"digao-dalpiaz/DzTalkApp","owner":"digao-dalpiaz","description":"Delphi non-visual component to communicate between applications","archived":false,"fork":false,"pushed_at":"2021-09-19T23:11:50.000Z","size":5897,"stargazers_count":57,"open_issues_count":0,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T20:29:35.412Z","etag":null,"topics":["applications","communication","component","data","delphi","pascal"],"latest_commit_sha":null,"homepage":null,"language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digao-dalpiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-10T17:55:34.000Z","updated_at":"2025-01-31T14:10:15.000Z","dependencies_parsed_at":"2022-08-12T13:11:51.691Z","dependency_job_id":null,"html_url":"https://github.com/digao-dalpiaz/DzTalkApp","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/digao-dalpiaz/DzTalkApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzTalkApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzTalkApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzTalkApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzTalkApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digao-dalpiaz","download_url":"https://codeload.github.com/digao-dalpiaz/DzTalkApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzTalkApp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264940367,"owners_count":23686241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applications","communication","component","data","delphi","pascal"],"created_at":"2024-12-02T07:31:30.721Z","updated_at":"2025-07-12T05:02:36.379Z","avatar_url":"https://github.com/digao-dalpiaz.png","language":"Pascal","funding_links":["https://ko-fi.com/C0C53LVFN"],"categories":[],"sub_categories":[],"readme":"# DzTalkApp\n\n## Delphi non-visual component to communicate between applications\n\n![Delphi Supported Versions](https://img.shields.io/badge/Delphi%20Supported%20Versions-XE3..11-blue.svg)\n![Platforms](https://img.shields.io/badge/Platforms-Win32%20and%20Win64-red.svg)\n![Auto Install](https://img.shields.io/badge/-Auto%20Install%20App-orange.svg)\n![VCL and FMX](https://img.shields.io/badge/-VCL%20and%20FMX-lightgrey.svg)\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C53LVFN)\n\n- [What's New](#whats-new)\n- [Component Description](#component-description)\n- [Installing](#installing)\n- [How to use](#how-to-use)\n- [Properties](#properties)\n- [Methods](#methods)\n- [Events](#events)\n- [How to send and read custom types](#how-to-send-and-read-custom-types)\n\n![Demo Screen](images/demo_screen.png)\n\n## What's New\n\n- 09/12/2021 (Version 1.9)\n\n   - Delphi 11 auto-install support.\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick here to view the entire changelog\u003c/summary\u003e\n\n- 03/13/2021 (Version 1.8)\n\n   - Removed CompInstall.exe from component sources due to AV false positive warning (now you can get it directly from CompInstall repository).\n\n- 02/01/2021 (Version 1.7)\n\n   - Removed Delphi XE2 from the list of environments as it was never possible to compile in this version.\n\n- 12/18/2020 (Version 1.6)\n\n   - Updated Component Installer app (Fixed call to rsvars.bat when Delphi is installed in a path containing spaces characters).\n\n- 11/28/2020 (Version 1.5)\n\n   - FMX support.\n\n- 11/01/2020 (Version 1.4)\n\n   - Implemented Unicode string send method support.\n\n- 10/31/2020 (Version 1.3)\n\n   - Included Delphi 10.4 auto-install support.\n\n- 10/27/2020 (Version 1.2)\n\n   - Fixed previous Delphi versions (at least on XE2, XE3, XE4 and XE5) package tag. It was causing package compilation error.\n\n- 10/26/2020 (Version 1.1)\n\n   - Updated CompInstall to version 2.0 (now supports GitHub auto-update)\n\n- 05/03/2020\n\n   - Updated CompInstall to version 1.2\n\n- 03/11/2019\n\n   - Add Result Code possibility.\n   - Add method to send Stream data.\n   - OnMessage event declaration changed. :warning:\n   \n\u003c/details\u003e\n\n## Component Description\n\nDzTalkApp allows you to send data between distinct applications. You can send simple data type like Integer or String, and even complex data, like a record.\n\n## Installing\n\n### Auto install\n\n1. Download Component Installer from: https://github.com/digao-dalpiaz/CompInstall/releases/latest\n2. Put **CompInstall.exe** into the component repository sources folder.\n3. Close Delphi IDE and run **CompInstall.exe** app.\n\n### Manual install\n\n1. Open **DzTalkApp** package in Delphi.\n2. Ensure **Win32** Platform and **Release** config are selected.\n3. Then **Build** and **Install**.\n4. If you want to use Win64 platform, select this platform and Build again.\n5. Add sub-path Win32\\Release to the Library paths at Tools\\Options using 32-bit option, and if you have compiled to 64 bit platform, add sub-path Win64\\Release using 64-bit option.\n\nSupports Delphi XE3..Delphi 11\n\n## How to use\n\nDrop a TDzTalkApp in the source and destination applications.\n\nYou just need to set the window name in the component, and the communication will occur between window handles.\n\nIn the destination application, just set the OnMessage event to receive and read data.\n\n## Properties\n\n`AutoActivate: Boolean` = Auto-enable the handle on component loaded. This will only works when you set other properties in design-time mode.\n\n`AutoFind: Boolean` = When AutoFind is enabled, on each Send command, the component will find the destination window handle.\n\n`MyWindowName: String` = Specify the source handle name. This property is only needed if this app will receive communication. Otherwise you only need to set the destination window name.\n\n`DestWindowName: String` = Specify the destination window name. This property is only needed if this app will send communication, otherwise you only need to set the source window handle name.\n\n`Synchronous: Boolean` = If this property is enabled, when you send a command to other app, the execution pointer will be released only after the destination app method `OnMessage` ends. If this property is disabled, when the destination receive the message, immediately the execution pointer is released in the source application.\n\n`Active: Boolean` (public read-only) = Indicates if the component is enabled or disabled (see `Enable` and `Disable` methods).\n\n`ToHandle: HWND` (public) = Stores the last destination window handle. You can set this property manually if needed, but I recommend you to use `FindDestWindow` method instead.\n\n## Methods\n\n```delphi\nprocedure Enable;\n```\n\nEnables the window handle to send and receive messages. You need to specify the name of window handle before use this method.\n\n```delphi\nprocedure Disable;\n```\n\nDisables the window handle.\n\n```delphi\nprocedure FindDestWindow;\n```\n\nFind and set destination window handle by the name defined in `DestWindowName` property. If the destination window is not found, an error is raised, using class `EDzTalkAppWndNotFound`.\n\n```delphi\nprocedure Send(ID: Word); overload;\nprocedure Send(ID: Word; N: Integer); overload;\nprocedure Send(ID: Word; const A: string); overload;\nprocedure Send(ID: Word; P: Pointer; Size: Cardinal); overload;\nprocedure Send(ID: Word; S: TMemoryStream); overload;\n```\n\nUse **Send** methods to send a message to destination application. To send messages, the component needs to be enabled (use `Enable` method) and needs a destination window name defined (use `DestWindowName` property).\n\nThe overloads methods allows you to send:\n\n- Only a command, using `ID` parameter\n\n- A command with an Integer parameter, using `N` parameter\n\n- A command with a String parameter, using `A` parameter\n\n- A command with any kind of data parameter, using `P` parameter and specifying the size of data parameter.\n\n- A command with a memory data stream, using `S` parameter.\n\n```delphi\nfunction AsString: string;\n```\n\nUse this function inside the OnMessage event to get a message data as String type.\n\n```delphi\nfunction AsInteger: Integer;\n```\n\nUse this function inside the OnMessage event to get a message data as Integer type.\n\n```delphi\nprocedure AsStream(Stm: TStream);\n```\n\nUse this procedure inside the OnMessage event to get a message data as TStream type (the object need to be created before call this method).\n\n```delphi\nfunction GetResult: Integer;\n```\n\nYou can use this function right after call `Send` method to get the result code of the message received by the destination app. You can set this result in **OnMessage** event at destination application. *Please see description of OnMessage event.*\n\n## Events\n\n```delphi\nprocedure OnMessage(Sender: TObject; From: HWND; ID: Word; P: Pointer; Size: Cardinal; var Result: Integer);\n```\n\nThis method will occur in the destination app when a message is received. The `From` parameter indicates the handle of the source window. The `ID` parameter indicates the code of the message used in the `Send` method at the source app. The `P` parameter has the pointer of the message data. The `Size` parameter allows you to know the size of the data received.\n\nThe `Result` parameter allows you to set a result code to return to the sender application (the sender application should use `GetResult` function right after use `Send` method to read this result code).\n\nYou can use the `AsString`, `AsInteger` or `AsStream` methods to get message data content as specific type.\n\n## How to send and read custom types\n\n### Record types:\n\nYou can send record structure. To do this, ensure you are always using `packed record`, because this kind of record will use a fixed size structure.\n\n**To send a record, use:**\n\n```delphi\ntype\n  TData = packed record\n    Number: Integer;\n    Text: ShortString;\n    Flag: Boolean;\n  end;\n  \nvar R: TData;\nbegin\n  R.Number := 100;\n  R.Text := 'TEST';\n  R.Flag := True;\n  \n  DzTalkApp.Send(1, @R, SizeOf(R));\nend;\n```\n\n**To receive this record using OnMessage event:**\n\n```delphi\nvar R: TData;\nbegin\n  R := TData(P^);\nend;\n```\n\n\u003e Of course, the packed record on destination application must have the same structure as the record used in the sender application.\n\n### Simple types:\n\n**To send a Double type:**\n\n```delphi\nvar D: Double;\nbegin\n  DzTalkApp.Send(1, @D, SizeOf(D));\nend;\n```\n\n**To receive a Double type (OnMessage event):**\n\n```delphi\nvar D: Double;\nbegin \n  D := Double(P^);\nend;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigao-dalpiaz%2Fdztalkapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigao-dalpiaz%2Fdztalkapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigao-dalpiaz%2Fdztalkapp/lists"}