Delphi

Low-level keyboard hook issue : Keyboard state losed when application is not focused (Delphi)

谁说胖子不能爱 提交于 2021-02-08 07:54:51
问题 I've been asked to develop a new application that will work along side the existing one. Both application will wait for a barcode reader input. I don't want our operator to scan a barcode twice: once for the existing application (16bit - clipper, no sources) and once for the new application. To solves this issue I've decided to use a low-level keyboard hook (written in Delphi). It looks perfect since 2 applications will need the barcode reader input and that my application will not be focused

Low-level keyboard hook issue : Keyboard state losed when application is not focused (Delphi)

跟風遠走 提交于 2021-02-08 07:54:37
问题 I've been asked to develop a new application that will work along side the existing one. Both application will wait for a barcode reader input. I don't want our operator to scan a barcode twice: once for the existing application (16bit - clipper, no sources) and once for the new application. To solves this issue I've decided to use a low-level keyboard hook (written in Delphi). It looks perfect since 2 applications will need the barcode reader input and that my application will not be focused

conversion of a string from some codepage to Unicode

二次信任 提交于 2021-02-08 07:53:52
问题 I would like to convert a CP-1253 string to Unicode and also perform the opposite conversion as well. Suppose I have two variables holding the strings, a MySource1253 and a MyUnicodeTarget . I presume AnsiString to be the appropriate type for MySource1253 , while String should be suitable for MyUnicodeTarget , please correct me if I am wrong. Is there some function in Delphi XE to make these conversions from one to the other and vice versa? 回答1: Declare: type GreekString = type Ansistring

Delphi Writing to HKEY LOCAL MACHINE

这一生的挚爱 提交于 2021-02-08 07:42:01
问题 I have a back up application that I wrote and I need it to run on start up, always for all users. I want to use key := '\Software\Microsoft\Windows\CurrentVersion\Run'; Reg := TRegIniFile.Create; try Reg.RootKey:=HKEY_LOCAL_MACHINE; Reg.CreateKey(Key); if Reg.OpenKey(Key,False) then Reg.WriteString(key, 'Backup', 'c:\backup.exe'); finally Reg.Free; end; I have written a manifest and added it as a resource, It asks for admin privileges every time it runs. However, it is not adding the the reg

“Emergency” termination of omnithread IOmniParallelTask

…衆ロ難τιáo~ 提交于 2021-02-08 06:52:13
问题 Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( procedure begin SetWin32ThreadName('TestLoopedAppProgressRelease_SubThread'); RunLoopedAppProgressRelease; end ); lSuccess:=bt.WaitFor(cRunLoopTimerMilliSecs*2); if not lSuccess then bt.Terminate; // emergency termination, unit test failed <<< How do I

“Emergency” termination of omnithread IOmniParallelTask

北战南征 提交于 2021-02-08 06:50:38
问题 Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( procedure begin SetWin32ThreadName('TestLoopedAppProgressRelease_SubThread'); RunLoopedAppProgressRelease; end ); lSuccess:=bt.WaitFor(cRunLoopTimerMilliSecs*2); if not lSuccess then bt.Terminate; // emergency termination, unit test failed <<< How do I

“Emergency” termination of omnithread IOmniParallelTask

这一生的挚爱 提交于 2021-02-08 06:50:21
问题 Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( procedure begin SetWin32ThreadName('TestLoopedAppProgressRelease_SubThread'); RunLoopedAppProgressRelease; end ); lSuccess:=bt.WaitFor(cRunLoopTimerMilliSecs*2); if not lSuccess then bt.Terminate; // emergency termination, unit test failed <<< How do I

Delphi - SysUtils.Trim not deleting last space(?) char

雨燕双飞 提交于 2021-02-08 06:39:40
问题 Delphi RIO. I have built an Excel PlugIn with Delphi (also using AddIn Express). I iterate through a column to read cell values. After I read the cell value, I do a TRIM function. The TRIM is not deleting the last space. Code Snippet... acctName := Trim(UpperCase(Acctname)); Before the code, AcctName is 'ABC Holdings '. It is the same AFTER the TRIM function. It appears that Excel has added some type of other char there. (new line?? Carriage return??) What is the best way to get rid of this?

Thread update GUI

夙愿已清 提交于 2021-02-08 02:03:28
问题 I've used the Delphi many years ago, I remember that in version 7 and even then I did not have much knowledge, I worked with C++ since then and I am currently working in a company using Delphi XE10 and realized that searching I found a lot of random things of difference versions and that makes me a little confused. I'm playing with threads and I wanted to update the GUI and searching I found the Synchronize and the way in which it works shows the impact it has on performance, you can notice

How can I troubleshoot design-time packages in Delphi/C++Builder?

蹲街弑〆低调 提交于 2021-02-07 20:57:36
问题 I have consistently had IDE problems in Delphi/C++Builder for years, with every version. I usually just reboot, recompile, etc. and move on. However, I keep seeing others say that the IDE is rock solid. I've read many people say that most IDE problems are a result of custom component problems. We have several of our own custom components and I would not be at all surprised that they were causing the problems. However, I have no idea how to find out. 1) I cannot easily just uninstall a