1,715 questions
1
vote
1
answer
217
views
How to detect if there's a Windows Update available using Delphi code?
I need to know from within my app whether the person has a pending Windows Update available or not, and then prompt him to update his Windows if it's not updated yet.
Is there a way to check if an ...
-2
votes
1
answer
121
views
How to get the names of my active monitors using Delphi VCL? [duplicate]
I found this function that is supposed to get the names of all the actively plugged-in monitors on the computer:
function GetMonitorNames: TArray<string>;
begin
Result := [];
var ...
0
votes
1
answer
94
views
How to get the active monitor count in Delphi VCL?
I'm trying to get the count for the amount of monitors on my computer using VCL and Delphi.
For my purposes, it only needs to work on Windows 11 and Delphi 13. I don't care about older versions.
Is ...
1
vote
1
answer
174
views
Select a new monitor as a display using VCL
I want to switch my application from one monitor to another. The code below work many times perfectly as expected but sometimes it only moved the titlebar of my application to the new screen.
How to ...
-1
votes
0
answers
55
views
C++Builder - linker errors with shellctrls when compiling with Clang [duplicate]
I use C++Builder 11.3. I want to compile a project that was written for the 'classic' Borland compiler. I want to compile it with the modern Clang compiler.
I removed most errors, but I still get ...
0
votes
1
answer
47
views
Why does my VCL form created inside a DLL disappear when minimised
I have a Windows VCL application written in C++Builder. Some of the UI is implemented inside a DLL rather than directly in the main EXE.
The DLL exports a function that creates and shows a VCL form, ...
1
vote
0
answers
101
views
TImage image is being truncated
I have written a Print Preview option for a larger application. Mostly it works to my satisfaction, except sometimes the image is truncated.
The code below is a much cut-down version that shows the ...
2
votes
1
answer
112
views
What's the difference between Text and EditValue in DevExpress TcxTextEdit component?
I have been tasked to convert one of our VCL DevExpress forms over to FMX. I am now busy replacing all of the TcxTextEdit components with TEdit components.
The problem is that in some places, the code ...
0
votes
1
answer
181
views
How to SelectAll text when a TEdit gains input focus by the user clicking?
Short Version
How can i select all text in a TEdit when the control gains input focus from the user clicking the edit box?
Motiviation
Following the Windows User Design Guidelines for a "search&...
0
votes
1
answer
202
views
What is the purpose of the "HORSE_VCL" compilation directive?
I have started using the horse web framework for building an API in Delphi. The VCL sample mentions the following as a comment in the Main.Form.pas file:
// Need to set "HORSE_VCL" ...
0
votes
1
answer
127
views
{dcc64 Fatal Error} F1026 File not found: 'cxLibraryRS29.dcp' (VCL + DevExpress)
Heyllo.
I just upgraded my project to Delphi 13 and latest DevExpress, but now I'm getting this new error in one of my frames:
[dcc64 Fatal Error] frameAdmin.pas(8): F1026 File not found: '...
4
votes
1
answer
193
views
Can there be a non-visual (without dfm) base form between TForm and any other form of the app?
In my Delphi 2009 VCL application, I have several base forms, like:
TListBaseForm = class(TForm)
TEditableListBaseFrom = class(TForm)
TEditBaseForm = class(TForm)
Each of these base forms is using ...
2
votes
1
answer
98
views
How to prevent dithering when rendering a 24 bpp bitmap with GDI+?
In C++Builder, I have a small VCL application that creates a 100 x 100 pixel, 24 bpp Gdiplus::Bitmap and fills it with the default form background color (clBtnFace / COLOR_BTNFACE). A TPaintBox fills ...
2
votes
1
answer
168
views
How to disable "blow up" behavior when opening a dialog window on Windows 11?
I have a VCL app written in Delphi 12.3. It displays a dialog over a form. The dialog may be displayed as the result of a toolbar speedbutton click, or from a menu selection; if called from the ...
1
vote
2
answers
106
views
How to read a TBitmap property from an old DFM stream into a TPicture property in C++Builder 1?
In C++Builder 1 (ancient, I know), I have a class TGlyph with a Graphics::TBitmap property:
class TGlyph : public TPersistent
{
typedef TPersistent inherited;
private:
Graphics::...
3
votes
3
answers
347
views
Should I use FileExists(Path) or TFile.Exists(Path) in Delphi?
I'm always working on the latest Delphi and so I have TFile.Exists(Path) available to me, but currently at my company, all of our code uses the older FileExists(Path) method.
What are the differences ...
1
vote
1
answer
123
views
Problem with TVirtualTreeView EditLink assignment in C++Builder
I have a problem with assigning an EditLink to TVirtualStringTree in Embarcadero C++Builder. When I try to assign a new editor class, only the default editor is working.
Only the constructor is called ...
0
votes
1
answer
147
views
Changing OpenGL (wgl) context to a different window handle
I am creating an application using OpenGL (4.2). By default, the rendering is done on a panel in a window, it works without issues, but the panel can be docked/undocked, which causes the underlying ...
0
votes
0
answers
42
views
Error when trying to compile a basic Delphi project using tcxGrid
When compiling a project in Delphi 12 Community using tcxGrid from DevExpress 12 Trial, the following error occurs:
[dcc32 Fatal Error] Unit4.pas(16): E2225 Never-build package 'cxLibraryRS29' must be ...
2
votes
1
answer
200
views
How to make a custom VCL control detect when another VCL control has moved?
What I am trying to do is write a custom TLabel that is coupled to another control, for example a TDBEdit, and the label will always position itself relative to the control's position, and when this ...
0
votes
1
answer
199
views
In Delphi TPrintDialog, can the printer name and paper size be programmatically set?
Using Delphi VCL.
When the user starts a print job, I display TPrintDialog.
Ideally, the print dialog would show the name of the printer, paper size and orientation that the user last used (which I ...
3
votes
1
answer
150
views
Is there really a difference between Image->Picture->Assign(Bitmap) and Image->Picture->Bitmap = Bitmap?
I am struggling to understand if there is really a difference between both statements:
Image->Picture->Bitmap = bitmap; // bitmap is a TBitmap object
Image->Picture->Assign(bitmap);
The ...
1
vote
3
answers
201
views
Winapi MessageBox (Delphi) : How to Determine the Owner Handle When Parent is Unknown to Ensure Proper Modal Order
I’m working on a custom message dialog function as custom library functions to reuse it in Delphi across all project groups and I’m facing an issue with maintaining the modal order of forms when the ...
1
vote
0
answers
68
views
Extract OLE linked file path from disk file
I'm working with a Delphi codebase where I need to extract the file path of a linked file in an OLE container.
The container is saved on disk, and is openable with the methods TOleContainer....
2
votes
1
answer
298
views
How to set printer page size to "continuous paper roll 80mm" in Printer dialog?
I need to print to POS PRINTER (Epson TM 30) on a roll paper 80mm. Every time i open a print dialog i have to change the paper size from A4 to paper roll 80 mm.
Printer Setting:
In order to print ...
0
votes
1
answer
78
views
How to replace an image in a TImageCollection?
I'm using a TVirtualImage in a TControlList connected to a TImageCollection. I would like to be able to load an image from a TOpenPictureDialog and replace an image in the Collection. For example, ...
1
vote
1
answer
65
views
Is TControlList::Invalidate() thread safe?
If I call MainForm->ControlList1->Invalidate() from a TIdUDPServer::>OnUDPRead event, is it thread safe, or do I still need to use TThread::Synchronize() or TThread::Queue()?
0
votes
0
answers
126
views
TImage in TPanel flickers
dfm : https://pastebin.com/KqCRLn2f
Code :
unit Unit2;
interface
uses
System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;
type
...
1
vote
0
answers
90
views
Change TPopupMenu.BiDiMode of just one TMenuItem's submenu?
I have a TPopupMenu that acts as a tray menu (it is linked to a TTrayIcon). The .BiDiMode of this menu is set to bdLeftToRight, and this is how I want it for almost all its items.
But I have one ...
0
votes
1
answer
106
views
C++Builder - How to save and restore key values from HKEY_LOCAL_MACHINE using TRegistry?
Using C++ Builder 11.1.5. This is for a Windows VCL 64-bit application.
I am trying to write a key from the registry (and all subkeys and values) to a backup file so it can be restored at a later time....
1
vote
0
answers
138
views
Changing top level menu items font
I need to increase the font size of my menus (TMainMenu, TPopupMenu) and I cannot figure out how to do it correctly.
I thought I don't need to draw the menu items completely, so I just assigned ...
1
vote
0
answers
189
views
Delphi 12 visual inheritance not working as I expect
I made a simple VCL form called TFormBase, and set some properties like for example WindowState = wsMaximized.
The form is also in a package that registers it, so my own properties are visible in the ...
4
votes
1
answer
189
views
FireDAC Append function not creating a new record on the dataset, instead it modifies the record
For my internship, I'm developing a simple tcl Windows-only app using C++Builder 12.
The app is used to do some simple CRUD with an interface. I'm using SQLite as a database, and also FireDAC, ...
1
vote
2
answers
140
views
Control xx has no parent window when Creating PageControl with TTabSheet inside of a visual component derived from TPanel
I'm working with Delphi 12.
I want to create a visual component derived from TPanel with several components grouped together.
One piece is to create a PageControl with 2 (at the moment) tabsheets, and ...
3
votes
1
answer
191
views
How to set up the properties of the ScrollBars of a TStringGrid?
The property ScrollBars of a TStringGrid specifies whether the grid includes horizontal and vertical scroll bars. These are visible if ScrollBars = ssBoth, and when all the cells do not fit in the ...
0
votes
0
answers
33
views
Python VCL MenuItem text disappears when assigning ImageIndex when have a style
Loaded a style from file, but when assigning ImageIndex to a MenuItem the text disappears, everything else seems fine.
Not sure if there is additional properties for the ImageList to make this work.
...
0
votes
1
answer
157
views
C++ Builder Error. Vcl.Buttons.hpp(44): candidate found by name lookup is 'Vcl'
When I create simple project in C++ Builder and add component on a From from my Package - EhLib I get next compilation error.
[bcc32c Error] Vcl.Buttons.hpp(66): reference to 'Vcl' is ambiguous
Vcl....
0
votes
1
answer
109
views
_wcsdup memory is not being freed in C++Builder
I am having trouble freeing the memory allocated by _wcsdup() to create a TObject pointer for a TComboBox. I thought this memory was freed automatically when the TComboBox or the Parent TForm was ...
1
vote
0
answers
118
views
How do I apply user selections to QuickReport preview, correctly and efficiently?
I have an old project using QuickReport in Delphi 10 Seattle. I based the entire solution on the ClosePreview() call.
I tried changing the QRPrinter object, Printer object, or TQuickRep(QRUserPreview....
1
vote
2
answers
239
views
New VCL component - Add Style using Bitmap Style Designer
In RAD Studio 12.2 C++Builder, I created a new component called TGroupBoxE derived from TGroupBox. It inherited all of the graphic properties of TGroupBox.
I want the new component to not use the ...
1
vote
1
answer
182
views
How to set sample text in TFontDialog?
How to replace the "AaBb..." sample text? Why is the sample text not shown by default when executing TFontDialog? (it seems to show the text only if I click on a font size, even if I set the ...
0
votes
0
answers
82
views
TCustomTransparentControl is not transparent
I'm trying to use TCustomTransparentControl, but it is not transparent. When creating one with :
TTransparentControl = class(TCustomTransparentControl)
protected
procedure Paint; override;
...
1
vote
1
answer
58
views
How can I set SelStart and SelLength when setting focus to a TComboBox
When I move focus with the Tab key to a VCL TComboBox control containing text in the Text field, the complete text is always displayed as selected.
How can this be changed so that the selection can be ...
4
votes
1
answer
89
views
TRegistry GetKeyNames not working as expected
I am trying to use the following code to get a list of subkeys in the registry. GetKeyNames takes a TString object. Upon return, the TStringList object has a count of 3 which is the correct count. ...
0
votes
1
answer
106
views
How can I subclass a TButton to owner-draw it?
I want to color a TButton control in C++Builder. I am trying to follow the information I found that suggests using SetWindowLong() to enable the BS_OWNERDRAW style for my TButton control, then catch ...
0
votes
1
answer
136
views
Error 1053 when trying to start the service in Windows Service
I can't start a service that I created in C++Builder using the TService class.
I wrote a service that does nothing and I want to start it, but the service does not start. I register the service and ...
1
vote
2
answers
825
views
Double-clicking on TButton is giving the error : cannot find implementation of method
I have multiple TButtons on a TPageControl. The first 3 work, when I double-click on them, the IDE takes me to their procedure (ie procedure TForm3.btn1q1Click(Sender: TObject);) but it gives me this ...
1
vote
0
answers
217
views
Delphi TMediaPlayer cannot play a WAV file?
I am using Delphi's TMediaPlayer to play .WAV files. It works on some files. However, when using it to play one .WAV files, in the following command:
MediaPlayer.FileName := OpenDialog.FileName;
...
0
votes
1
answer
97
views
Winapi.Perception.hpp is missing for Rad Studio 12
I'm trying to compile a part of the firefox source code using C++ builder. Specifically the SMTC integration. This requires WinAPI.Media.hpp. But almost all WindowsRT units require Winapi.Perception....
1
vote
0
answers
124
views
Clicking on the right mouse button during dragging fires the DragDrop Event instead of canceling the operation
For my VCL StringGrid component, I have successfully implemented the whole DragAndDrop operation for swapping the rows.
The unique problem that remains is that when I click on the right mouse button ...