System

Delphi 10.3 Released

Posted in System

2018.11.22 Embarcadero has released a shining new version of Delphi, with new language, RTL, VCL, FireMonkey, mobile, database and RAD Server features, plus a large number of quality improvements.

Delphi 10.3 has been released  as part of RAD Studio 10.3. The new release has a very large number of features, in many different areas, which you can read in the product main page and documentation (see links below).

 

There are a few things in Delphi 10.3 I'm personally proud of and would like to underline:

 

the new inline variable declaration, a small change that breaks with the original Pascal language opening up a lot of new possibilities for improving your every day code; its effects include block variable lifetime and visibility, type inference, and a few more

the image collection and the new virtual image list for VCL Hi-DPI applications; nothing in Microsoft own Windows UI comes close in terms of API integration, compatibility with different versions of Windows, easy transition of existing code. Same for the new Per Monitor v2 support deep in the VCL. VCL and Delphi continue to lead as the best Windows UI library

the large expansion of FireMonkey on the Android platforms with native controls, z-Order, better editing support, new permissions architecture and more

the "2.0" version of RAD Server, with better URL and content type mapping, server side components, a more flexible architecture, and the ability to avoid repeated boilerplate code

the overall focus on RTL performance

a very very nice UI and UX for the IDE itself, makes it hard to go back to 10.2

the C++ 17 work is also great, even if not strictly Delphi 

 

Here are some relevant links:

Official press release: https://www.businesswire.com/news/home/20181121005044/en/Embarcadero-Releases-RAD-Studio-10.3-Enhance-Delphi

Sarina's announcement blog post: https://community.idera.com/developer-tools/b/blog/posts/delphi-c-builder-and-rad-studio-10-3-rio-are-now-available

What's new in Delphi 10.3 product page (with video): https://www.embarcadero.com/products/rad-studio/whats-new-in-10-3-rio

DocWiki New in 10.3 page (more technical information): http://docwiki.embarcadero.com/RADStudio/Rio/en/What%27s_New

List of almost 500 publicly reported bugs fixed: http://docwiki.embarcadero.com/RADStudio/Rio/en/New_features_and_customer_reported_issues_fixed_in_RAD_Studio_10.3

New public demos repository on GitHub: https://github.com/Embarcadero/RADStudio10.3Demos

Show system volume control

Posted in System

Use SNDVOL32.EXE program, which is contained in windows directory. Use ShellExecute for running this program. Don't forget to add ShellAPI in uses chapter.

uses ShellAPI;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  MyWin: array[0..255] of Char;
const
  Size: Integer = MAX_PATH;
begin
  GetWindowsDirectory(MyWin, Size);
  ShellExecute(
    Form1.Handle,
    'open',
    'sndvol32.exe',
    nil,
    MyWin,
    SW_SHOWNORMAL);
end;

Show special folders

Posted in System

Use SHGetSpecialFolderLocation for getting identifier of special folder. After that, you must fill components of ShellExecuteInfo structure where one of the parameters is the identifier of special folder. Folder variable contains a constant, which shows special folder. For example: CSIDL_DRIVES - My Computer SIDL_CONTROLS - Control Panel CSIDL_DESKTOP - Desctop CSIDL_BITBUCKET - Recycle Bin

uses
  ShlObj, ShellAPI;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  MyItemIDList: PItemIDList;
  MyShellEx: TShellExecuteInfo;
  Folder: Integer;
begin
  Folder:=CSIDL_DRIVES;
  SHGetSpecialFolderLocation(Form1.Handle, Folder, MyItemIDList);
  with MyShellEx do
  begin
    cbSize:=Sizeof(MyShellEx);
    fMask:=SEE_MASK_IDLIST;
    Wnd:=Handle;
    lpVerb:=nil;
    lpFile:=nil;
    lpParameters:=nil;
    lpDirectory:=nil;
    nShow:=SW_SHOWNORMAL;
    hInstApp:=0;
    lpIDList:=MyItemIDList;
  end;
  ShellExecuteEx(@MyShellEx);
end;

Show list of installed programs

Posted in System

Use SHGetSpecialFolderLocation for getting identifier of special folder. After that, you must fill components of ShellExecuteInfo structure where one of the parameters is the identifier of special folder. Folder variable contains a constant, which shows special folder. For example: CSIDL_DRIVES - My Computer SIDL_CONTROLS - Control Panel CSIDL_DESKTOP - Desctop CSIDL_BITBUCKET - Recycle Bin

uses
  ShlObj, ShellAPI;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  MyItemIDList: PItemIDList;
  MyShellEx: TShellExecuteInfo;
  Folder: Integer;
begin
  Folder:=CSIDL_DRIVES;
  SHGetSpecialFolderLocation(Form1.Handle, Folder, MyItemIDList);
  with MyShellEx do
  begin
    cbSize:=Sizeof(MyShellEx);
    fMask:=SEE_MASK_IDLIST;
    Wnd:=Handle;
    lpVerb:=nil;
    lpFile:=nil;
    lpParameters:=nil;
    lpDirectory:=nil;
    nShow:=SW_SHOWNORMAL;
    hInstApp:=0;
    lpIDList:=MyItemIDList;
  end;
  ShellExecuteEx(@MyShellEx);
end;

Set system decimal separator

Posted in System

Set system decimal separator - System - Tips & Tricks - Greatis Delphi Pages Use SetLocaleInfo function, where last parameter is a new system separator.

SetLocaleInfo(
  LOCALE_SYSTEM_DEFAULT,
  LOCALE_SDECIMAL,
  ',');


Eckehard Fiedler wrote:

example might work better, if you change it a bit:


procedure TForm1.Button1Click(Sender: TObject);
const  cs1 : pchar = 'Windows';
begin
    SetLocaleInfo(    LOCALE_SYSTEM_DEFAULT,  LOCALE_SDECIMAL,',');
    SetLocaleInfo(    LOCALE_SYSTEM_DEFAULT,  LOCALE_STHOUSAND,'.');
    SendMessage( HWND_BROADCAST, WM_SETTINGCHANGE, 0, LongInt(cs1));
end;

Then applications are informed, that separators have changed.