delphi-7

How can I put a custom button on the title bar? [duplicate]

若如初见. 提交于 2019-12-23 13:08:26
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Non client painting on aero glass window I want to have a button like Skype's compact-view button on the title bar. How can I do that? For example: 回答1: You can use the JvCaptionButton which comes free in the very-nice-but-very-large open-source free JVCL library. It is a general purpose "caption button". Caveat: The appearance is not purely native and not Windows-7-aero-themed. This button does not decide what

Delphi - How to get total disk space of Windows drive?

走远了吗. 提交于 2019-12-23 13:07:01
问题 I need to get total disk space in Delphi program. 回答1: Use DiskSize and DiskFree functions for this problem. ComboBox1 contains a list of drives letters. var Disk: Integer; ... procedure TForm1.Button1Click(Sender: TObject); var Total, Free: LongInt; begin Total:=DiskSize(Disk) div 1024; Free:=DiskFree(Disk) div 1024; Gauge1.MaxValue:=Total; Gauge1.Progress:=Free; Label1.Caption:='Total size - '+IntToStr(Total); Label2.Caption:='Free - '+IntToStr(Free); end; procedure TForm1.ComboBox1Change

How to change TreeView node height, to draw 3 lines in a node

£可爱£侵袭症+ 提交于 2019-12-23 13:04:04
问题 I use D7 with TreeView (not VirtualTreeView). How can I change node height to use OwnerDraw and draw 3 (or 5 or more) "lines" of text in node rectangle? So tree should look like this (root node + 2 nodes are shown, aaa and bbb): [+] Root node | | [aaa1 |--[aaa2222 | [aaa333 | | [bbb1 |--[bbb2222 | [bbb333 | ... I know how to use owner-draw. But don't know how to make tall node rectangle. 回答1: The simplest way would be to set the node height when the node is already added in the tree view.

Delphi2010-IDE keeps stoping on CPU debug window

≡放荡痞女 提交于 2019-12-23 12:34:29
问题 I keep getting the CPU-debug window in D2010 IDE, i noticed this appears on some Breakepoints, some others doesnt cause this effect. Can't explain when exactly this happends or which Breakpoints cause this but it seems like when the debugger can't reach a breackpoint on code it stops on the beginaddress of the method, and it gets in an endless loop so even removing the Breakpoint doesnt help, only solution is break debugging, remove breakpoint and restart again. I had the same issue with D7

How to change image boarder to circle

不想你离开。 提交于 2019-12-23 10:59:53
问题 I have to use Image as Notification.For that Image boarder should be in elliptical shape .can any one help me to change my image boarder as a circle. I have mentioned an sample image 10 should be an image component.how can i get circle shape for it. Thanks in advance. Yours Rakesh 回答1: const BORDER = 3; Var Bmp : TBitmap; w, h: Integer; x, y: Integer; begin Bmp:=TBitmap.Create; try Bmp.PixelFormat:=pf24bit; Bmp.Canvas.Font.Name :='Arial'; // set the font to use Bmp.Canvas.Font.Size :=20; /

How to find out which DB-Aware controls are linked to a TDataSource?

丶灬走出姿态 提交于 2019-12-23 08:08:10
问题 I have DataSource1 (TDataSource) , and there are some DB-Aware controls linked to it (via SomeDBControl.DataSource=DataSource1 ) How can I find out (enumerate) in code which controls are linked to a given TDataSource? 回答1: The code below, which uses RTTI, works for me in D7 to list the components which have a DataSource or MasterSource property by recursively searching a container object (i.e. the form and its components). (Obviously, you could do similar for any other forms/datamodules you

How to Decode XML Blob field in D7

て烟熏妆下的殇ゞ 提交于 2019-12-23 07:47:38
问题 I'm having a problem trying to decode XML data returned by an instance of MS SQL Server 2014 to an app written in D7. (the version of Indy is the one which came with it, 9.00.10). Update When I originally wrote this q, I was under the impression that the contents of the blob field needed to be Base64-decoded, but it seems that that was wrong. Having followed Remy Lebeau's suggestion, the blob stream contains recognisable text in the field names and field values before decoding but not

Borland Delphi 7 TExcelApplication.Connect works on office machines but not at client

☆樱花仙子☆ 提交于 2019-12-23 07:03:10
问题 I'm in charge of maintaining some legacy code at my office (Pascal) due to it's limitations, I've written a delphi dll to access excel using TExcelApplication. The dll works perfectly at the office, the machines are running Microsoft Office 2010, Windows 7 32-Bit and 64-Bit. The client is using Novel Workstations, Windows XP, Microsoft 2007. The dll gives a breakpoint exception when encountering the TExcelApplication.Connect; command. Other than the differences that I've mentioned, the

Create an image and colored ir?

冷暖自知 提交于 2019-12-23 04:03:39
问题 how can I create an image and how can I colored it pixel by pixel using hexadecimal code of colors? For ex. I wanna create a 100x100 pixel image and I wanto to 1x1 area's color is '$002125',2x2 area's color is '$125487'.... How can I do it? Thank you for your answers.. 回答1: Made a simple sample for you. Using Canvas.Pixels not Scanline. Scanline is faster though but for start I think it suits just fine. The colors are randomly generated, so you just need to replace this part of the code.

How to delete a file that is using by windows?

我怕爱的太早我们不能终老 提交于 2019-12-23 03:17:08
问题 Is there any way to delete a file when its using by any program or other process in windows? I searched and found this 2 ways: 1- using RunOnce key in Registry; I'm not gonna use this because i dont want to wait for windows restart or anything else... prefer to do it ontime! 2- using the way declared in this page: http://www.delphipages.com/forum/showthread.php?t=201190 the problem here is its useful under NT windows, i need a way works on all Windowses! Thank you. 回答1: the problem here is