delphi-5

How to not have a MainForm in Delphi?

一曲冷凌霜 提交于 2019-11-27 05:27:06
问题 i've been trying to get some modeless forms in my application to appear on the taskbar - taking advantage of the new useful taskbar in Windows 7. There's are many issues with the VCL that need to be undone before a form can exist on the taskbar. But the final issue is that minimizing the form that the VCL has designated the main form causes all windows in the application to vanish. Ten years ago, Peter Below (TeamB) documented these problems, and attempts to work around them. But there are

Changing component class at run-time on demand

两盒软妹~` 提交于 2019-11-27 04:22:56
问题 My Question is similar to the idea here: Replacing a component class in delphi. But I need to change a specific component(s) class on demand. Here is some pseudo demo code: unit Unit1; TForm1 = class(TForm) ImageList1: TImageList; ImageList2: TImageList; private ImageList3: TImageList; end; procedure TForm1.FormCreate(Sender: TObject); begin ImageList3 := TImageList.Create(Self); // all instances of TImageList run as usual end; procedure TForm1.Button1Click(Sender: TObject); begin Unit2

Delphi: How to hide ancestor constructors?

自古美人都是妖i 提交于 2019-11-27 01:59:24
Update: gutted the question with a simpler example, that isn't answered by the originally accepted answer Given the following class, and its ancestor: TComputer = class(TObject) public constructor Create(Teapot: string=''); end; TCellPhone = class(TComputer) public constructor Create(Cup: Integer); overload; virtual; constructor Create(Cup: Integer; Teapot: string); overload; virtual; end; Right now TCellPhone has 3 constructors visible: Cup: Integer Cup: Integer; Teapot: string Teapot: string = '' What do i do to TCellPhone so that the ancestor constructor ( Teapot: string = '' ) is not

How to minimize a window to the taskbar? (i.e. not iconify)

独自空忆成欢 提交于 2019-11-27 01:59:10
问题 i have a window that i want to minimize (to the taskbar), so i call ShowWindow : ShowWindow(Handle, SW_MINIMIZE); Except that rather than minimizing itself (to the taskbar), the window is iconified : The window is unparented: How do i minimize a window to the taskbar? Update: Following some advice from 2002, i try setting the WS_EX_APPWINDOW window style and/or ensuring the window has no owner: Unfortunately, that changes the behavior of my (Delphi) application because there is now two

Converting a string to TDateTime based on an arbitrary format

情到浓时终转凉″ 提交于 2019-11-27 01:49:31
Is there any way in Delphi 5 to convert a string to a TDateTime where you can specify the actual format to use? I'm working on a jobprocessor, which accepts tasks from various workstations. The tasks have a range of parameters, some of which are dates, but (unfortunately, and out of my control) they're passed as strings. Since the jobs can come from different workstations, the actual datetime format used to format the dates as a string might (and, of course, actual do ) differ. Googling around, the only quick solutions I found was to sneakily change the ShortDateFormat variable, and restore it

Delphi: How to hide ancestor constructors?

时光总嘲笑我的痴心妄想 提交于 2019-11-26 09:51:56
问题 Update: gutted the question with a simpler example, that isn\'t answered by the originally accepted answer Given the following class, and its ancestor: TComputer = class(TObject) public constructor Create(Teapot: string=\'\'); end; TCellPhone = class(TComputer) public constructor Create(Cup: Integer); overload; virtual; constructor Create(Cup: Integer; Teapot: string); overload; virtual; end; Right now TCellPhone has 3 constructors visible: Cup: Integer Cup: Integer; Teapot: string Teapot: