Delphi

Delphi: Simulate key press for automation

余生长醉 提交于 2020-08-03 05:47:10
问题 I want to change text of an edit control of an external application. The application is written in Delphi. It has several forms. I started with Python libraries pywinauto + sendkeys to test the first form TLoginForm . It works perfectly. Here is the pseudo code: helper = pywinauto.application.Application() hwnd = pywinauto.findwindows.find_windows(class_name='TLoginForm')[0] window = helper.window_(handle=hwnd) ctrl = window[2] # the second control is the edit control I want to access ctrl

How to make TWebBrowser ignore accelerator chars of others controls?

北慕城南 提交于 2020-08-03 03:25:11
问题 I have a TWebBrowser placed on a form with the designMode enabled. Bellow the browser I have a close button with the Caption set to 'Clos&e'. When I am editing the contents of a document inside the WebBrowser and I press the key E the button close is called. It appears that it is treating TWebBrowser like other controls that don't handle keys and/or don't accept chars (e.g. TButton). How can I solve this? Thanks in advance. 回答1: Descend from TWebBrowser, override the CN_CHAR message handler,

DDS转换工具

风格不统一 提交于 2020-07-27 03:51:38
本工具用于将(长宽均为 2 的指数次幂的)图像文件如 PNG、TGA、BMP、JPG 等转换为 DDS 图像(DXT 压缩类型可选,DXT1~DXT5),也可将 DDS 图像转换回此几种格式图片。 截图如下: 工具下载链接在 这里 。 注:本软件开发工具为 Delphi XE6 UP1,可能会有杀毒软件拦截。当然,我们已习惯了误报,及滥报。 来源: oschina 链接: https://my.oschina.net/u/4292686/blog/4335740

2020年7月中国编程语言排行榜

浪尽此生 提交于 2020-07-24 00:35:00
编程语言比例 排名 编程语言 平均工资 中位数 最低 最高 人头 百分比 1 rust 20027 17500 5357 45000 460 0.11% 2 scala 19342 17500 7000 45000 2849 0.68% 3 python 18345 16000 6000 45000 32897 7.80% 4 go 18256 16000 6856 40000 27035 6.41% 5 matlab 18207 17500 7000 37500 5798 1.38% 6 lua 18061 16500 6388 37500 3944 0.94% 7 r 17834 16000 6000 40000 3129 0.74% 8 julia 17667 18929 9000 25000 12 0.00% 9 swift 17053 15000 7000 37500 2770 0.66% 10 perl 16854 15000 5408 37500 2576 0.61% 11 ruby 16196 15000 5250 37500 1373 0.33% 12 kotlin 16106 15000 7000 33050 1217 0.29% 13 haskell 15308 15000 11500 31425 26 0.01% 14 cpp 15282 12500

Use PUT to upload file with TIdHTTP

穿精又带淫゛_ 提交于 2020-07-23 04:41:19
问题 I'd like to upload a file using PUT on TIdHtttp. I found an answer from Remy Lebeau saying to not use PUT, but use POST instead. But, in my case I can't do it because I'm using a third API, and it specifies that I need to use PUT. If I try to use POST, it returns me a message saying that the Method is not allowed. Basically, I'm trying to do something like this: Response := TStringStream.Create; DS := TIdMultiPartFormDataStream.Create; DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop

Use PUT to upload file with TIdHTTP

女生的网名这么多〃 提交于 2020-07-23 04:39:22
问题 I'd like to upload a file using PUT on TIdHtttp. I found an answer from Remy Lebeau saying to not use PUT, but use POST instead. But, in my case I can't do it because I'm using a third API, and it specifies that I need to use PUT. If I try to use POST, it returns me a message saying that the Method is not allowed. Basically, I'm trying to do something like this: Response := TStringStream.Create; DS := TIdMultiPartFormDataStream.Create; DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop

Use PUT to upload file with TIdHTTP

五迷三道 提交于 2020-07-23 04:38:18
问题 I'd like to upload a file using PUT on TIdHtttp. I found an answer from Remy Lebeau saying to not use PUT, but use POST instead. But, in my case I can't do it because I'm using a third API, and it specifies that I need to use PUT. If I try to use POST, it returns me a message saying that the Method is not allowed. Basically, I'm trying to do something like this: Response := TStringStream.Create; DS := TIdMultiPartFormDataStream.Create; DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop

How to check if an object is already destroyed or not?

若如初见. 提交于 2020-07-23 01:52:52
问题 I have created an object I passed it to somewhere else as parameter. Somewhere else has Free the object which out of my control. At the end my coding, I try to check if the object is valid then destroy it. The Assigned() method returned true (seems it is because the variable storing the object reference address). However, the referenced object ready destroyed and I got an exception. My question is, how could I check if an object is already destroyed? What else other than Assigned() can check

How to check if an object is already destroyed or not?

流过昼夜 提交于 2020-07-23 01:51:12
问题 I have created an object I passed it to somewhere else as parameter. Somewhere else has Free the object which out of my control. At the end my coding, I try to check if the object is valid then destroy it. The Assigned() method returned true (seems it is because the variable storing the object reference address). However, the referenced object ready destroyed and I got an exception. My question is, how could I check if an object is already destroyed? What else other than Assigned() can check

How to ignore accelerator chars in TWebBrowser (design mode)

痴心易碎 提交于 2020-07-22 05:59:05
问题 I have essentially the same problem like the one described in this question: How to make TWebBrowser ignore accelerator chars of others controls? So the TWebBrowser is in design mode and accelerator keys from TAction are executing associated action. The solution was: type TWebBrowser = class(SHDocVw.TWebBrowser) procedure CNChar(var Message: TWMChar); message CN_CHAR; end; ... procedure TWebBrowser.CNChar(var Message: TWMChar); begin Message.Result := 0; end; I'd like to try the solution