Category: Delphi General
-
How do I make UDP server-client communication in Delphi FMX
To create a UDP server-client communication in Delphi FMX, you can use the TIdUDPClient and TIdUDPServer components from the IdUDPServer and IdUDPClient units. Here is an example of how you can use these components to create a simple UDP server and client in Delphi FMX; uses IdUDPServer, IdUDPClient; procedure TForm1.FormCreate(Sender TObject); var UDPServer TIdUDPServer; UDPClient…
-
How do I parse json in Delphi
To parse JSON in Delphi, you can use the TJsonObject class from the System.JSON unit of the Delphi RTL. This class provides properties and methods that allow you to parse a JSON string and access the values of the JSON properties. Here is an example of how you can use the TJsonObject class in Delphi…
-
How do I off smart screen in Delphi
To turn off the SmartScreen filter in Delphi, you can use the SetSmartScreenFilter function from the Winapi.ShellAPI unit of the Delphi RTL. This function allows you to enable or disable the SmartScreen filter for your Delphi application, so that it is not blocked by the security feature in Windows. Here is an example of how…
-
How do I make different ways to round number in Delphi
In Delphi, you can use the following functions to round a number to the nearest integer: Round: This function rounds a number to the nearest integer. If the fractional part of the number is exactly 0.5, the function will round to the nearest even integer. For example, Round(3.5) returns 4, and Round(4.5) returns 4. Trunc:…
-
How can I simulate KeyDown event in Delphi
To simulate a KeyDown event in Delphi, you can use the KeyDown method of the TWinControl class. This method takes a key code as an argument and simulates pressing the key. Here is an example of how to use the KeyDown method to simulate pressing the “A” key: procedure TForm1.Button1Click(Sender: TObject); begin Form1.KeyDown(VK_A); end; This…
-
How can I convert long filename to DOS filename in Delphi
To convert a long filename to a DOS filename (also known as an 8.3 filename) in Delphi, you can use the GetShortPathName function from the Windows API. This function takes a long filename as input and returns the corresponding short (8.3) filename. Here is an example of how to use the GetShortPathName function to convert…
-
How can I use named pipes in Delphi
In Delphi, you can use named pipes to communicate between processes on the same computer or between processes on different computers across a network. To create a named pipe in Delphi, you can use the CreateNamedPipe function from the Windows API. Here is an example of how to use this function to create a named…
-
How can I create login page in Delphi
To create a login page in Delphi, you can use a combination of visual components such as TEdit for the username and password fields, TButton for the login button, and TLabel for the prompts and error messages. Here is an example of how you might create a simple login form in Delphi: unit Unit1; interface…