Delphi

SendInput not working in certain apps - Windows with Delphi

冷暖自知 提交于 2019-12-30 11:08:12
问题 Using Delphi, I'm trying to find a way of sending a string/series of characters or keystrokes to the active window. Using SendInput I have the following code: uses System.SysUtils, Windows, System.Types, System.UITypes, System.Classes, System.Variants, VCL.Dialogs, VCL.ExtCtrls; var input: array of TInput; s: String; i: Integer; begin s := 'This is a longer string.' + sLineBreak + 'This is the second string with unicode ασδλκφχωιοευα.'; SetLength(input, Length(s)); i := 1; while i <= Length(s

Explorer Integration in the Context Menu but using the already running instance

▼魔方 西西 提交于 2019-12-30 11:08:00
问题 I want to check for the existence and if it doesn't exist add some actions in the Explorer's right click (context) menu. Besides of the above requirement (for which one can find easily solutions on web) I want to add one more: Suppose that I register the following commands: "Command #1" - triggers 'C:\MyProg.exe /cmd1' "Command #2" - triggers 'C:\MyProg.exe /cmd2' ... (aso.) How do I check if there is already a running instance of MyProg.exe and passing it the appropriate command/command line

File not found 'DBAccess.res'的错误

早过忘川 提交于 2019-12-30 10:53:09
今天运行Delphi 项目时,报错: file not found:’DBAccess.dcu’ 解决方案 在Delphi工具栏中打开 Tools->Environment Options : 然后在 Library 选项卡 中的 Library Path 中加入该控件的路径。 上述控件路径中 包含了文件 DBAccess.dcu 总结 以后碰到类似的file not found:’ *.dcu ’问题,解决方法类似 来源: CSDN 作者: 木生火 链接: https://blog.csdn.net/msh2016/article/details/103760684

how to show the availble files in Android memory with Firemonkey

可紊 提交于 2019-12-30 10:46:06
问题 In Delphi for Windows one has the TOpenDialog and the commands such as FindFirst . In Firemonky/Android there is no TOpenDialog , but according to many forums FindFirst` should exist. However there are more who have problems with it, but no solution: In Windows the following functions properly: var iResult,n:integer; Filenaam,s:string; sr: TSearchRec; begin with form1 do begin L_toonactie.Text:='start file list'; M_filelist.lines.Clear; Filenaam:= System.IOUtils.tpath.GetDocumentsPath+'

How do I debug a designtime package unloading crash involving a crash in ThreadProc in Classes.pas?

倾然丶 夕夏残阳落幕 提交于 2019-12-30 10:30:56
问题 I am not sure how to track down the following crash: It happens when Unloading a Designtime Package that is used in-house at my company. It is our code, thus it is our bug to fix, not a third party component vendor problem. It apppears that a thread is involved, but since it happens in the Function ThreadProc in Classes.pas, I'm guessing it's a bare System/RTL thread without even a TThread class wrapper that I should be searching for in our code. (Question Part A: Is that so?) The call stack

Read a Delphi TClientDataset Files with .NET

让人想犯罪 __ 提交于 2019-12-30 10:19:07
问题 I need to read Files that are written with the TClientDataset class from Delphi with .NET Code. The Solution mentioned here does not work for me. 回答1: "A dotNet program that does not run on Windows platform" means to me that you're deploying a Mono application. Possibly on Linux, if that's the case try WINE and see if the Delph app suggested above works as expected. If yes, your problem of leaving the dotnet app machine is solved as both will run on the same hardware without communication

jSon_encode like function for Delphi which accepts TDataSet

南笙酒味 提交于 2019-12-30 10:12:21
问题 I have been tasked with creating a Indy server in Delphi 2007 which communicates with clients and returns json formatted data from Sql based databases. Someone from our office created a prototype using php. And in the prototype they use the jSon_encode function extensively to return the data from tables. I was wondering if there was a similar Delphi function which could accept a TDataSet parameter and return properly formatted json data. Anyone know of such function? Update 12/10/2013 - my

jSon_encode like function for Delphi which accepts TDataSet

安稳与你 提交于 2019-12-30 10:12:13
问题 I have been tasked with creating a Indy server in Delphi 2007 which communicates with clients and returns json formatted data from Sql based databases. Someone from our office created a prototype using php. And in the prototype they use the jSon_encode function extensively to return the data from tables. I was wondering if there was a similar Delphi function which could accept a TDataSet parameter and return properly formatted json data. Anyone know of such function? Update 12/10/2013 - my

Delphi单元文件(*.pas)结构说明

Deadly 提交于 2019-12-30 10:11:46
单元文件的后缀名为 .pas , 主要组成部分为:单元名称、Interface、implementation、 [initialization]、 [finalization]、 end unit Unit1; // 单元的名称 interface //Interface 部分起始处 {接口部分开始} uses {引用单元列表,这是可选的,如果包含必须紧跟interface关键字} Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private declarations } public { Public declarations } end; var Form1: TForm1; {接口部分结束} implementation //Implementation 部分起始处 {实现部分} uses {如果包含uses字句,必须紧跟关键字implementation} {在这里实现interface中定义的过程和函数} {$R *.dfm} {如果是对应窗体的单元文件,会有这句. $R 指令用于加载一个外部资源文件, 这里是指加载同名的窗体文件一起编译.} initialization

Delphi Dictionary and ordering data

你说的曾经没有我的故事 提交于 2019-12-30 10:04:40
问题 My code is: procedure TfrmSettings.btnFillDictClick(Sender: TObject); var Dict: TDictionary<string, string>; Item: TPair<string, string>; begin Dict := TDictionary<string, string>.Create(); Dict.Add('Key1', 'Text1'); Dict.Add('Key2', 'Text2'); Dict.Add('Key3', 'Text3'); Dict.Add('Key4', 'Text4'); for Item in Dict do begin ShowMessage(Item.Key + ' ' + Item.Value); end; end; Why almost every time I'm getting a different value in Showmessage? Why values are not stored in the order in which they