delphi-7

Update free space amount displayed in Windows Explorer

廉价感情. 提交于 2019-12-08 11:21:32
how to update free space amount displayed in Windows Explorer for a drive ? Suppose Windows Explorer is opened and some files are deleted programmatically. Windows Explorer will not be refreshed to show the new free space available. So, I tried to use SHChangeNotify like this (Delphi code) : ws := 'C:\'; SHChangeNotify (SHCNE_FREESPACE, SHCNF_PATH, PWideChar(ws), nil); but it doesn't update values reported in "Windows Explorer". Please help. If you are using Delphi 7, then SHCNF_PATH will map to the ANSI version, SHCNF_PATHA . In which case passing PWideChar is wrong. Write it like this: var

Storing a set of values in Delphi

别来无恙 提交于 2019-12-08 08:10:18
问题 I am trying to store a set of values in delphi, but i want to be able to address them using their name, instead of an assigned number. For example, an array of 'OldValues' would let me do OldValue[1] := InflationEdit.Text; Ideally however, i would like to have a value stored in 'Data.Inflation.OldValue' for example. For each identifier, such as Inflation, there is an OldValue, NewValue and StoredValue. There are about 12 of these identifiers. Is there some way i could store the values like

Sharing ADOConnectionString accross multiple applications-Delphi

烈酒焚心 提交于 2019-12-08 07:09:07
问题 I am working on Delphi 7, SQL Server 2008 R2 and i am using ADO to connect to database. My Connection String: Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TESTDataBase;Data Source=TestDataSource when i make my TADOconnection.Connected to True Connectin string is changing it to Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TESTDataBase;Data Source=TestDataSource; Use Procedure for Prepare=1; Auto Translate

Please explain package use

荒凉一梦 提交于 2019-12-08 06:40:10
问题 Please explain package use (in short sentences with small words (for Dummies)). I just moved from D7 to XE2 and packages seem much more prevelant, and I seem to need to qualify a lot more things. In D7 I would say uses windows and now I must say uses winapi.windows . I find that when I call MessageDlg() I can't pass in mtError , I need to qualify it. Before I go too far down the wrong road - what's the simple solution? Can I somehow continue to use my old code with package names which I

Loading images into TImage, via array

◇◆丶佛笑我妖孽 提交于 2019-12-08 05:37:53
问题 I'm very new to delphi, doing a project for my A level. When I run my code the images just don't show, I've looked everywhere and my teacher can't help me. Can anyone tell me what I'm missing? const Animal : array[0..6] of string = ('Bears','Dogs','Cats','Chickens','Horses','Cows','Monkeys'); ImagePaths : array [0..6] of string = ('img0.JPG', 'img1.JPG', 'img2.JPG', 'img3.JPG', 'img4.JPG', 'img5.JPG', 'img6.JPG'); var i:integer; Images : array [0..11] of TImage; procedure LoadImages; var k,l

Connecting with Google Picasa -> Delphi 7

六眼飞鱼酱① 提交于 2019-12-08 05:36:07
问题 I am looking for various ways to make my application more userfriendly, at this time I use my own functions and graphic library in order to crop images and save them, however I really like Google Picasa for it's userfriendly interface, and allready functions So I am asking if there is a way to connect Google picasa to my own application, ActiveX ? If I could also tell google what file to open, and what to store it as would be a great bonus 回答1: here you have a forum http://groups.google.com

Delphi set to read only files from folder and subfolders

↘锁芯ラ 提交于 2019-12-08 05:26:23
问题 How can I put the files from a specific folder and subfolders to read only in delphi? I know that I can put the folder with FileSetAttr to read only but is there a way to put the files from the folder and subfolders ? Thanks 回答1: You need to iterate over all the files in a directory, and recursively over all the sub-directories. You can use this function to do that: type TFileEnumerationCallback = procedure(const Name: string); procedure EnumerateFiles(const Name: string; const Callback:

How to detect number of logical and physical processors efficiently?

我只是一个虾纸丫 提交于 2019-12-08 05:20:33
问题 Currently I'm using this function. It works fine but each query takes about 1 second. So in my case I waste 3 seconds in my application. At the moment I'm thinking about using 3 threads to get this all information in one second. function GetWMIstring (wmiHost, wmiClass, wmiProperty : string):string; var // These are all needed for the WMI querying process Locator: ISWbemLocator; Services: ISWbemServices; SObject: ISWbemObject; ObjSet: ISWbemObjectSet; SProp: ISWbemProperty; Enum: IEnumVariant

OpenSSL's PEM file and Lockbox3 interoperability

余生颓废 提交于 2019-12-08 05:02:40
问题 I have a RSA key in a PEM file created with openssl, and Im trying to load it into Lockbox3 (a delphi component) but it seems they are not compatible. In their forums I found this: "Only after you nail down all the options used by the other party, both explicit and implicit (which are typically poorly documented), do you have a chance for interoperability." So, I'm wondering if someone had made it work. 回答1: The latest version of Lockbox (available from SVN, not the file downloads as yet),

Problems in setting DNS address

徘徊边缘 提交于 2019-12-08 04:15:52
问题 I'm using one popular Delphi function and one laptop with Wi-fi adapter connected on attempt to set preferred and alternative dns server address and catch an error saying - "Invalid Syntax". I think "Win32_NetworkAdapterConfiguration" function work only in Ethernet adapters and not in Wi-fi adapters, or I'm wrong? Exceptions generated: http://prntscr.com/4qvjmz http://prntscr.com/4qvjvn And this is the function: uses ComObj, ActiveX, UrlMon, Variants; function SetDnsServers(const APrimaryDNS