delphi-7

Delphi notification when a file gets updated

眉间皱痕 提交于 2019-12-17 19:24:53
问题 My app contains documents in its database. The users can open the documents in which case, the document gets saved to a temporary folder and gets opened on the user's computer. I'd like to get a notification when one of these temporary files are changed, and offer the user to save the changed document back to the database. What is the most simple way to do this in Delphi7? (I suppose it requires some shell magic or 3rd party component) Thanks! 回答1: You can either: use the Win32 API

in Delphi7, How can I retrieve hard disk unique serial number?

白昼怎懂夜的黑 提交于 2019-12-17 17:45:20
问题 Hi I want to retrieve HDD unique (hardware) serial number. I use some functions but in Windows Seven or Vista they don't work correctly because of admin right. Is it possible retrieve it without run as Administrator? 回答1: Following the links in the question comments Sertac posted, I came across this interesting C++ question, where Fredou answered with a nice link to a codeproject example showing how to do this in .NET, which in turn was based on a link to Borland C++ code and article. The

Unit testing in Delphi - how are you doing it? [closed]

我们两清 提交于 2019-12-17 17:24:54
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I'm wondering how the few Delphi users here are doing unit testing, if any? Is there anything that integrates with the IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it all works? Update

Delphi: StringList Delimiter is always a space character even if Delimiter is set

百般思念 提交于 2019-12-17 15:59:21
问题 I am having trouble with the delimiter in the TStringList Class. Take a look: var s: string; sl: TStringList; begin sl := TStringList.Create; s := 'Users^foo bar^bar foo^foobar^barfoo'; sl.Delimiter := '^'; sl.DelimitedText := s; ShowMessage(sl[1]); end; sl[1] SHOULD return 'foo bar' sl[1] DOES return 'foo' It seems that the delimiter is now '^' AND ' ' Any ideas? 回答1: You should set s1.StrictDelimiter := True for spaces not to be considered delimiters, more info here. Since you work in a

How to programatically enable System Restore monitoring for a drive? [closed]

∥☆過路亽.° 提交于 2019-12-14 04:13:25
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I found a code that enables System Restore monitoring, but it's for C# and I need to convert it to Delphi. Here's the code: ManagementScope scope = new

How to change the ClientRect of a form?

非 Y 不嫁゛ 提交于 2019-12-14 04:13:06
问题 Please refer to another question here: Resizing borderless form from different constraints than far edges? This previous question has been resolved, but I have another similar question. Since I am building a custom shaped form with a different client area, I need to change the ClientRect area of this form. The form has some special drawing of some curved edges and such, but that part's irrelevant. I need to change the ClientRect of the form to represent a new client area where components are

How can I convert base of decimal string to another base? [closed]

送分小仙女□ 提交于 2019-12-14 03:29:41
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . here is my codes; {Sayitabani=orginal base, SonucTabani=result-converted base} function SayiCevir(Sayi:String;const SayiTabani,SonucTabani:Word):String; function ChToRkm(const C:Char):Byte; var B:Byte absolute C;{c ile b aynı adresteki değişkenlerdir. c:='B' olursa b değeri 66 olur veya b:=65

How can I replace a special characters in a given string with space or without space by using delphi

一世执手 提交于 2019-12-14 02:42:14
问题 How can I replace special characters in a given string with spaces, or just remove it, by using Delphi? The following works in C#, but I don't know how to write it in Delphi. public string RemoveSpecialChars(string str) { string[] chars = new string[] { ",", ".", "/", "!", "@", "#", "$", "%", "^", "&", "*", "'", "\"", ";","_","(", ")", ":", "|", "[", "]" }; for (int i = 0; i< chars.Lenght; i++) { if (str.Contains(chars[i])) { str = str.Replace(chars[i],""); } } return str; } 回答1: I would

Indy9 Get Raw Email header?

你。 提交于 2019-12-13 21:35:46
问题 Does Indy9 have any way to get a specific raw email header (say, "Subject" or "From") which still includes the transfer-encoding (ie: has not been mangled by DecodeHeader on older versions of Delphi with poor Unicode support), or would I have to parse the entire email header manually to extract this information? 回答1: The TIdMessage.RawHeaders property is what you are looking for, eg: Subject := IdMessage1.RawHeaders.Values['Subject']; 回答2: I have solved the problem, calling IdMessage1.Headers

Installing LockBox 3 to Delphi 7

女生的网名这么多〃 提交于 2019-12-13 21:17:23
问题 I am trying to install Lockbox 3.5 to Delphi 7. I have come to the point where it should compile, but I am having some trouble with TBytes . Delphi sees TBytes as an Undeclared identifier . I am a student in my first year and don't know exactly how to fix this problem. function SelfTest_Key: TBytes; This script is found under uTPLb_BlockCipher. function Stream_to_Base64(ASource: TStream; const ATransform: TBytes = nil) : TBytes; This script is found under uTPLb_StreamUtils I would really