delphi-5

wsMaximized forms do not appear maximized

自古美人都是妖i 提交于 2019-12-03 08:09:13
问题 Setting a form to WindowState = wsMaximized will sometimes cause the form to be maximized but not: Long-time bug: this is a question I first asked in the Borland newsgroups in 2003: Accepted fix for WindowState = wsMaximized? and then again in 2006: wsMaximized breaks it, NOT caused by Position=poScreenCenter, reproducible dfm and then again in 2008: Forms not starting maximized Someone asked it on the Embarcadero forums in 2012: Thread: Application not starting with maximized window Now it's

How to export Image list of 32bit icons into single 32bit bitmap file?

馋奶兔 提交于 2019-12-03 03:21:36
I want to write a small utility which will help me load a single 32bit bitmap (with alpha) from a EXE resource: ImageList1.DrawingStyle := dsTransparent; ImageList1.Handle := ImageList_LoadImage(MainInstance, 'MyBitmap32', 16, ImageList1.AllocBy, CLR_NONE, IMAGE_BITMAP, LR_CREATEDIBSECTION or LR_LOADTRANSPARENT); The above works well. So to generate that bitmap, I'm loading 32 bit transparent icons from my disk (with alpha) into an ImageList for i := 1 to 10 do ... ImageList2.AddIcon(AIcon) Now, how do I export the 32 bitmap (which will be transparent and have the alpha channel) from this

How to simulate an OnDestroy event on a TFrame in Delphi?

孤者浪人 提交于 2019-12-03 00:33:42
How can i simulate an OnDestroy event for a TFrame in Delphi? i nievely added a constructor and destructor to my frame, thinking that is what TForm does: TframeEditCustomer = class(TFrame) ... public constructor Create(AOwner: TComponent); override; destructor Destroy; override; ... end; constructor TframeEditCustomer.Create(AOwner: TComponent) begin inherited Create(AOwner); //allocate stuff end; destructor TframeEditCustomer.Destroy; begin //cleanup stuff inherited Destroy; end; The problem with this is that by the time my destructor runs, controls on the frame have been destroyed and are no

How to create Telnet Client with Delphi 5

烂漫一生 提交于 2019-12-01 23:30:53
How do I create a Telnet Client inside of a Delphi 5 application? ICS (Internet Component Suite) by Francois Piette has got some useful components: http://www.overbyte.be/eng/products/ics.html It'll give you telnet protocol support, a terminal emulator and some stuff to help you scripting. It's easy to use, and it's all free. From the site: TTnCnx - TELNET client protocol support. TEmulVT - ANSI terminal emulation (like a TMemo but with ANSI escape sequences interpretation). TTnEmulVT - TELNET and ANSI terminal emulation combined into a single component. You can build a full telnet client

How to create Telnet Client with Delphi 5

人盡茶涼 提交于 2019-12-01 22:12:41
问题 How do I create a Telnet Client inside of a Delphi 5 application? 回答1: ICS (Internet Component Suite) by Francois Piette has got some useful components: http://www.overbyte.be/eng/products/ics.html It'll give you telnet protocol support, a terminal emulator and some stuff to help you scripting. It's easy to use, and it's all free. From the site: TTnCnx - TELNET client protocol support. TEmulVT - ANSI terminal emulation (like a TMemo but with ANSI escape sequences interpretation). TTnEmulVT -

How do i construct a WideString with a diacratic in a non-unicode Delphi version?

烂漫一生 提交于 2019-12-01 21:32:00
问题 i am trying to construct a (test) WideString of: á (U+00E1 Small Letter Latin A with acute) but using it's decomposed form: LATIN SMALL LETTER A (U+0061) COMBINING ACUTE ACCENT (U+0301) So i have the code fragment: var test: WideString; begin test := #$0061#$0301; MessageBoxW(0, PWideChar(test), 'Character with diacratic', MB_ICONINFORMATION or MB_OK); end; Except it doesn't appear to work: This could be a bug in MessageBox, but i'm going to go ahead and say that it's more likely the bug is

How to pause Windows shutdown

喜你入骨 提交于 2019-12-01 21:25:15
问题 I need to mute/un-mute the sound card at startup and shutdown. I have found some code to do the work, but often Windows slams through the shutdown and the sound never gets muted. Can someone please tell me how to pause the shutdown long enough for my app to mute the sound? I can use a simple TTimer to pause the app long enough for it to run the muting and then let Windows get on with shutting down. How do I tell Windows to wait though? I notice that if I leave Firefox running and try to

How to pause Windows shutdown

狂风中的少年 提交于 2019-12-01 20:11:03
I need to mute/un-mute the sound card at startup and shutdown. I have found some code to do the work, but often Windows slams through the shutdown and the sound never gets muted. Can someone please tell me how to pause the shutdown long enough for my app to mute the sound? I can use a simple TTimer to pause the app long enough for it to run the muting and then let Windows get on with shutting down. How do I tell Windows to wait though? I notice that if I leave Firefox running and try to shutdown, Windows stops with a message, "These programs are preventing windows closing..." and needs a click

Access JCL Debug information contained in executable?

情到浓时终转凉″ 提交于 2019-12-01 09:34:09
Is there a way to access the Jedi Debug Information (JDBG) contained in an executable? Microsoft debugging tools have pointed me to a stack chain in my binary, and i want to know what methods/procedures/functions these offsets correspond to: user32.dll!SendMessageA+0x4c StackOverflow.exe+0x179263 StackOverflow.exe+0x2315b5 StackOverflow.exe+0x1fc82 StackOverflow.exe+0x50388 StackOverflow.exe+0x541fe user32.dll!gapfnScSendMessage+0x332 Obviously i'm calling SendMessage , but i don't know from where. The executable was built with Jcl Debug info embedded in the executable; but i can't figure out

Casting a delphi interface to its implementation class without modifying the interface [duplicate]

浪尽此生 提交于 2019-12-01 07:23:58
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to cast a Interface to a Object in Delphi Using Delphi 5; I have an interface that I cannot change for legacy reasons. I am passing (pointers to) that interface all over the place. The implementing class has several new properties - is there a way to force a cast from the interface to the actual implementation? http://www.malcolmgroves.com/blog/?p=500 says that this is (newly) implemented in Delphi 2010,