delphi-7

Update free space amount displayed in Windows Explorer

天涯浪子 提交于 2019-12-08 04:14:25
问题 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. 回答1: If you are using Delphi 7, then SHCNF_PATH

Postmessage LParam truncation

天大地大妈咪最大 提交于 2019-12-08 04:09:32
问题 My app has a worker thread, and I use PostMessage to send a string to the main thread. For 1 message, the string is truncated when it gets to the message handler in the main thread. The string is constructed in the worker thread from a string of raw data that is like this. It ends at the last '20'. '01010000000030000102000008850008855343414E204544474520000000000000000000' Decoded into the string I want to send it looks like this, which is correct: '0100 0.50000 LSB0288.588.5SCAN EDGE ' The

Tlistbox items from database column

戏子无情 提交于 2019-12-08 03:56:34
问题 Is there a way to populate a TListbox control with items from a database column? I know the proper way to do this is to simply use a DBLookupListbox control and set it up to access the column I want, but the problem with that is when I click on one of the items in the lookup control, it changes the current row in the dataset (expected behavior) but I do not want this to happen. Instead, I would want the current row to be changed only on a double click event in the lookup control and since I

Delphi 7 ISAPI WebBroker file upload

醉酒当歌 提交于 2019-12-08 03:33:19
问题 I am trying to accept file uploads in a Delphi 7 Webbroker CGI. I'm using Shiv Kumar's TMsMultipartParser, but I have a problem with Chrome. I can't access the parsed data (surprisingly, Explorer works fine). This is my code: with TMsMultipartFormParser.Create do begin Parse(Request); lsExternalID:=ContentFields.Values['external_id']; if (lsExternalID='') then raise Exception.Create('No external ID'); for i := 0 to Files.Count -1 do begin lsFileName:=files[i].FileName; //Rename file using

Partial Search In Table(BDE)

假装没事ソ 提交于 2019-12-08 03:07:30
I made a database with paradox 7. The usual search I do is a syntax like this: Table.Filter := 'Country=' + QuotedStr(Edit.Text); This returns rows those country field is same as the entered text in edit. when I want to search for countries are beginning by "L" i use this syntax: Table.Filter := 'Country=' + QuotedStr(Edit.Text + '*'); But how can I search for fields those are finished with "L"? this syntax does not work: Table.Filter := 'Country=' + QuotedStr('*' + Edit.Text ); Thanks. You can use the OnFilterRecord event to carry out a customized filtering. With your example, maybe sth. like

Column height in DBGrid in Delphi

好久不见. 提交于 2019-12-08 02:38:09
问题 I am using DBgrid Component in delphi 7. I want to display my table columns to grid. Table Columns are queryId,empid,empname and Query . Query column has datatype as Text. The Query column may contain a long string. But it's displayed in a single line. I need to fix the width of columns and depending upon the data the height will vary for that particular row. Is it possible in DBGrid to change the height of a row like it allows multiline in single record similar to Excel? 回答1: Look this code.

Delphi 7 TRichTextEdit Text in a box not displaying correctly

别来无恙 提交于 2019-12-08 02:25:25
问题 Using delphi 7 TRichEdit component, RTF data is being imported from a msword document through copy and paste, but if data is contained in a box, it is not displaying correctly i.e. Please assist 回答1: Try to use the following, it should subclass the TRichEdit class to version 4.1. However I don't know if Delphi 7 supports interposed classes, so just try to paste the following code and try to build the project. If it compiles then if you put a TRichEdit component and run the project you should

IDL to Type Library

送分小仙女□ 提交于 2019-12-07 22:58:36
问题 Is there a way in Delphi 7 to generate a tlb from an idl? Or even from a class/ interface definition? 回答1: you can use the IDL2PAS.bat batch file (check in this location C:\Program Files\Borland\Delphi7\Bin) or the MIDL.exe application. 回答2: In Delphi 7 one of the easiest ways is to copy/paste the IDL into the Type Library editor source window. NOT the *_TLB.pas source unit 'behind' the type library, but the type library editor itself. I don't have D7 to hand right now, but iirc you may have

CREATE new TABLE from a query on another TABLE using ADO

浪尽此生 提交于 2019-12-07 22:19:52
问题 I need to CREATE a new table from a query on existing tables using ADO query. DB is MS Access 2003. Is there a simple way to recreate this? DROP TABLE IF EXISTS tmp_report; CREATE TABLE tmp_report SELECT Userid, Name, DATE(CheckTime) AS date, MIN(CheckTime) AS first_login, MAX(checktime) AS last_login, COUNT(CheckTime) AS No_logins, IF(COUNT(CheckTime) = 1, 'ERROR', TIME_TO_SEC(TIMEDIFF(max(checktime), min(CheckTime))) AS total_sec FROM Checkinout LEFT JOIN Userinfo USING(Userid) GROUP BY

Delphi 7 - Embedded file open dialog in a form

自闭症网瘾萝莉.ら 提交于 2019-12-07 21:35:50
问题 Does anyone know if it is possible to embed a file open dialog inside your own form? We have a tabbed dialog and on one of the tabs we want the user to be able to browse for a file with the same functionality as the the standard open dialog e.g. 'Look in' combobox, places bar, shell file list, file name comboedit with name completion etc etc. I've looked at recreating the dialog with some 3rd party components, namely Jam Shell Browser Components I can get most of the functionality this way,