delphi-2007

How to install classes or units like components in Delphi 2007?

落花浮王杯 提交于 2019-11-28 09:58:07
问题 I'm writing a package in Delphi 2007 containing a component and several classes. I want to "install" the classes as well as the components. To be more precise: when a component is installed, the unit is somehow registered such that it is not necessary to add its path to the search path in the project. I would also like to do this with a few extra units that do not contain components: if I can somehow register the root of the package, I'm done. Is this possible? EDIT: In one sentence the

How to hide an application from taskbar in Windows 7?

久未见 提交于 2019-11-28 09:11:27
I would like to hide an application from the Windows 7 taskbar. I want to make something like a toolbar on the edge of the screen which does certain things when the user clicks on it, but I don't want it to show in the taskbar, since its a thing that i want to stay in the background. I tried the instructions in the following post, but it did not work on my application: How to hide a taskbar entry but keep the window form Then i tried it on a new empty VCL Forms Application and it still did not work. I searched for other solutions, but they all do very much the same like in the linked post. Has

How do I turn specific Delphi warnings and hints off?

我是研究僧i 提交于 2019-11-28 08:32:53
问题 In CodeGear Delphi 2007, how can I turn specific warnings and hints off? I am attempting to turn off H2077 - Value assigned to 'varname' never used. 回答1: Hints? No specific. You'll have to disable them all: {$HINTS OFF} Warnings? {$WARN _name_of_warning_ OFF|ON|ERROR} Check here for a full list 回答2: You are not able to disable specific hints like you can with warnings. Hints are those things that would not have any potential adverse affects on your runtime code. For instance, when you see the

Initialise string function result?

。_饼干妹妹 提交于 2019-11-28 04:58:05
I've just been debugging a problem with a function that returns a string that has got me worried. I've always assumed that the implicit Result variable for functions that return a string would be empty at the start of the function call, but the following (simplified) code produced an unexpected result: function TMyObject.GenerateInfo: string; procedure AppendInfo(const AppendStr: string); begin if(Result > '') then Result := Result + #13; Result := Result + AppendStr; end; begin if(ACondition) then AppendInfo('Some Text'); end; Calling this function multiple times resulted in: "Some Text" the

What is the best way to make a Delphi Application completely full screen?

橙三吉。 提交于 2019-11-28 04:24:53
What is the best way to make a delphi application (delphi 2007 for win32 here) go completely full screen, removing the application border and covering windows task bar ? I am looking for something similar to what IE does when you hit F11. I wish this to be a run time option for the user not a design time decision by my good self. As Mentioned in the accepted answer BorderStyle := bsNone; was part of the way to do it. Strangely I kept getting a E2010 Incompatible types: 'TFormBorderStyle' and 'TBackGroundSymbol' error when using that line (another type had bsNone defined). To overcome this I

Why doesn't my program's memory usage return to normal after I free memory?

蹲街弑〆低调 提交于 2019-11-28 04:04:53
问题 consider the next sample application program TestMemory; {$APPTYPE CONSOLE} uses PsAPI, Windows, SysUtils; function GetUsedMemoryFastMem: cardinal; var st: TMemoryManagerState; sb: TSmallBlockTypeState; begin GetMemoryManagerState(st); result := st.TotalAllocatedMediumBlockSize + st.TotalAllocatedLargeBlockSize; for sb in st.SmallBlockTypeStates do begin result := result + sb.UseableBlockSize * sb.AllocatedBlockCount; end; end; function GetUsedMemoryWindows: longint; var ProcessMemoryCounters

How do you design FIFO queue with variable data size?

混江龙づ霸主 提交于 2019-11-28 01:39:25
问题 I'm just working on the FIFO queue (the simple one, just what's pushed first, pops at first) with the variable data size but I'm not sure with the way I'm designing it. The data types I will store there will be known in advance and let's say will be the same for each instance of this class. I was thinking about using TList where the records with the following definition will be stored (@David - it's for D2007, so I have no Generics.Collections available :) type PListItem = ^TListItem;

Which is the correct way to start a suspended thread in delphi 2007?

跟風遠走 提交于 2019-11-28 00:01:31
问题 in delphi XE i can use the start procedure, but this method does not exist in delphi 2007. this sample code works ok in delphi xe, using Start MyThread:=TMyThread.Create(True); MyThread.FreeOnTerminate :=True; MyThread.Property1:=900; MyThread.Property2:=2; MyThread.Start; but in delphi 2007 the start procedure does not exist, so i am using the resume procedure wich is deprecated in the new versions of delphi. MyThread:=TMyThread.Create(True); MyThread.FreeOnTerminate :=True; MyThread

Convert Hi-Ansi chars to Ascii equivalent (é -> e)

自古美人都是妖i 提交于 2019-11-27 18:34:09
Is there a routine available in Delphi 2007 to convert the characters in the high range of the ANSI table (>127) to their equivalent ones in pure ASCII (<=127) according to a locale (codepage)? I know some chars cannot translate well but most can, esp. in the 192-255 range: À → A à → a Ë → E ë → e Ç → C ç → c – (en dash) → - (hyphen - that can be trickier) — (em dash) → - (hyphen) Zoë Peterson WideCharToMultiByte does best-fit mapping for any characters that aren't supported by the specified character set, including stripping diacritics. You can do exactly what you want by using that and

How to make TWebBrowser Zoom when using ctrl+mousewheel like Internet Explorer does?

两盒软妹~` 提交于 2019-11-27 18:04:35
问题 According to http://www.rendelmann.info/blog/CommentView,guid,356fbe68-3ed6-4781-90a4-57070a0141da.aspx and http://msdn.microsoft.com/en-us/library/aa770056(v=vs.85).aspx getting the hosted WebBrowser to zoom using the control key and the mouse wheel should just require calling IWebBrowser2.ExecWB(OLECMDID_OPTICAL_ZOOM, ...) with a pvaIn value of 100 , but after calling it, ctrl+mousewheel still doesn't zoom the content Code I'm using with Delphi 2007: const OLECMDID_OPTICAL_ZOOM = 63; var