delphi-xe2

Is it possible to made a TCombo edit caret 'wider' or to 'bold' it?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 16:06:26
问题 I have an mode that uses TComboBox.SelStart to indicate progress along the edit text string. In this mode I would like to make some kind of change to the edit caret, for example to widen it to 2 pixels or 'bold' it in some way to indicate this mode and to have it grab more attention. Is this possible? 回答1: Yes, as Alex mentioned in his comment, this can be done using API calls. Example: procedure SetComboCaretWidth(ComboBox: TComboBox; Multiplier: Integer); var EditWnd: HWND; EditRect: TRect;

Get automatically notified on audio device connection/disconnection?

与世无争的帅哥 提交于 2019-12-13 15:11:15
问题 Is it possible to get automatically notified whenever the user connects or disconnects an audio device? 回答1: In Vista+ you can use Core Audio IMMNotificationClient interface to be notified. The IMMNotificationClient interface provides notifications when an audio endpoint device is added or removed, when the state or properties of an endpoint device change, or when there is a change in the default role assigned to an endpoint device. Handling WM_DEVICECHANGE and/or polling is the solution in

How to have both VCL and FMX in one application?

99封情书 提交于 2019-12-13 15:04:49
问题 I have a VCL application and pretty isolated VCL code. I would like to include Fire Monkey forms for Mac OSX support. I plan using heavily IFDEF to determine should I build for Windows with VCL or for Mac OSX with FireMonkey. Unfortunately there is no way to add MacOS platform from the Project Manager if the application is VCL one. Is there a way to hack this somehow? Maybe manually tweak the .dpr and .dproj files? 回答1: What about doing it the other way around: start with a FireMonkey

Generics and Marshal / UnMarshal. What am I missing here? PART #2 :-)

心不动则不痛 提交于 2019-12-13 13:19:49
问题 Following up on my earlier question : Generics and Marshal / UnMarshal. What am I missing here? In "part #1" (the link above) TOndrej provided a nice solution - that failed on XE2. Here I provide corrected source to correct that. And I feel the need to expand this issue a bit more. So I would like to hear you all how to do this : First - To get the source running on XE2 and XE2 update 1 make these changes : Marshal.RegisterConverter(TTestObject, function (Data: TObject): String // <-- String

Loading many images and running out of memory when using NativeJpg

送分小仙女□ 提交于 2019-12-13 10:15:00
问题 I'm building a Picture Loader which has two major abilities: 1) Loading pictures in a thread, and 2) Saving cached images. Since I implemented NativeJpg 1.32, I have been noticing that a TsdJpgGraphic uses approximately 3 times as much memory as the TJpegImage . I'm not concerned about resolving how much it reserves, but rather to make sure my threads manage the memory properly. Specifications TPictureLoader is the main component for this system. Every time a picture needs to be loaded, a

ATI ADL - AdapterInfo_Get

杀马特。学长 韩版系。学妹 提交于 2019-12-13 04:44:26
问题 Good evening guys! I'm currently trying to work with a Delphi pascal translation of the ATI ADL structure. In brief, this allows me to retrieve information from an ATI/AMD GPU in a system, and potentially control various aspects of it (such as clock and fan speeds). The translation was taken from Delphi-Praxis (Google Translated) or Delphi-Praxis (not translated) and the provided example application works. I successfully transferred it over to a visual/GUI application, but i'm having trouble

How to blacklist an IP on TIdHTTPServer

不问归期 提交于 2019-12-13 04:39:26
问题 In a TIdHTTPServer component, I'd like to enable a blacklist of IP addresses to block. I'd like to make sure this is on the lowest level possible to prevent any unnecessary data streaming in from a blacklisted client. How should I intercept this server component to block an IP on the lowest level possible? This applies to both IP v4 and v6 回答1: On Indy 9, there was an event for refusing a connection before it was actually accepted. On Indy 10, it's still not implemented. If you look at

Error Delphi XE2 - Exception class $C00000005

好久不见. 提交于 2019-12-13 03:57:53
问题 I am getting this error will debugging a project, which used to be in Delphi 7 and I have been upgrading to Delphi XE2, the same error happens in several methods. First chance exception at $006DC660. Exception class $C0000005 with message 'access violation at 0x006dc660 read of address 0xffffffff' This is one of the methods: PFI = ^TFI; TFI = record Id : TToken; Name : TName; Parameters : string; end; function TListFI.IsIn(S: PChar): PFI; function SearchName2(Item: PFI):Boolean; var N1, N2:

How to display an email images on Pbear Html viewer component?

ⅰ亾dé卋堺 提交于 2019-12-13 02:38:22
问题 I just know I must save the images in a temp folder and then use them on Htmlviewer . But suppose we have an email which contains 5 pictures, so html viewer provides 5 empty frames for the images , some of them are located before the text body, some of them are at the middle and some at the end of the email body . Now How can I define which frame should contain which picture ! ? and how to insert them to the Html viewer ?!. (is there any way to do all job in a memory stream ? I mean without

Show the window shadow when using VCL styles

独自空忆成欢 提交于 2019-12-12 15:45:41
问题 Is there a way to show the window shadow, as per normal Windows 7 forms, when using a VCL style? I understand the bitmap and settings in the style replaces the form borders, but isn't the shadow some sort of alpha blend / aero thing that is outside the area affected by the style? Adding CS_DROPSHADOW to the WindowClass.Style seems to have no effect. 回答1: Using the CS_DROPSHADOW style works fine type TMyForm = class(TForm) protected procedure CreateParams(var Params: TCreateParams); override;