2021年12月21日 星期二

high DPI displays standard-DPI displays

 high DPI displays
standard-DPI displays

https://docs.microsoft.com/zh-tw/windows/uwp/get-started/universal-application-platform-guide
Windows Universal Platform (UWP)
https://docs.microsoft.com/zh-tw/archive/blogs/askcore/display-scaling-in-windows-10
Display Scaling in Windows 10
display scale factor scale factor
display scaling is > 100% “System DPI Awareness.” System DPI Awareness  

https://docs.microsoft.com/zh-tw/archive/blogs/askcore/display-scaling-changes-for-the-windows-10-anniversary-update
Display Scaling changes for the Windows 10 Anniversary Update
https://docs.microsoft.com/zh-tw/windows/win32/api/winuser/nf-winuser-setthreaddpiawarenesscontext?redirectedfrom=MSDN
SetThreadDpiAwarenessContext function (winuser.h)
Classic desktop applications scaled to 100%, 125%, 150%, 200% and 250%; Store apps scaled to 100%, 140% and 180%. As a result, when running different apps side by side in productivity scenarios,

~450% 23” 8K desktop

applications to dynamically scale and where Windows was limited in this regard. One of the main lessons learned was that, even for simple applications, the model of registering an application as being either System DPI Aware or Per-Monitor-DPI Aware

https://docs.microsoft.com/zh-tw/windows/win32/dlgbox/common-dialog-box-library?redirectedfrom=MSDN
 (ComDlg32, for example  Common Item Dialog ) that didn’t scale on a per-DPI basis.

DPI_AWARENESS_CONTEXT and the SetThreadDpiAwarenessContext API
DPI _ 感知 _ 內容控制碼 https://docs.microsoft.com/zh-tw/windows/win32/hidpi/dpi-awareness-context
SetThreadDpiAwarenessContext function (winuser.h)
The old DPI_AWARENESS_CONTEXT for the thread.
If the dpiContext is invalid,
the thread will not be updated and the return value will be NULL ...


https://docs.microsoft.com/zh-tw/windows/win32/hidpi/wm-dpichanged-beforeparent
https://docs.microsoft.com/zh-tw/windows/win32/hidpi/wm-getdpiscaledsize
WM_DPICHANGE message
https://docs.microsoft.com/zh-tw/windows/win32/api/winuser/nf-winuser-setwindowpos?redirectedfrom=MSDN
SetWindowPos function (winuser.h)

 EnableNonClientDpiScaling API to get Notepad’s non-client area to automatically DPI scale properly.
https://docs.microsoft.com/zh-tw/windows/win32/api/winuser/nf-winuser-enablenonclientdpiscaling?redirectedfrom=MSDN
 WM_NCCREATE

https://docs.microsoft.com/zh-tw/windows/win32/api/winuser/nf-winuser-getdpiforwindow?redirectedfrom=MSDN
GetDpiForWindow function (winuser.h)
FontStruct.lfHeight = -MulDiv(iPointSize, GetDpiForWindow(hwndNP), 720);

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms646914(v=vs.85)?redirectedfrom=MSDN
 ChooseFont dialog was not per-monitor DPI aware

DPI_AWARENESS_CONTEXT previousDpiContext = SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE);
BOOL cfResult = ChooseFont(cf);
SetThreadDpiAwarenessContext(previousDpiContext);

DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
 DPI_AWARENESS_CONTEXT_UNAWARE
FontStruct.lfHeight = -MulDiv(cf.iPointSize, GetDpiForWindow(hwndNP), 720);

SetThreadDpiAwarenessContext
DPI_AWARENESS_CONTEXT
AdjustWindowRectExForDpi
GetDpiForSystem
GetDpiForWindow
GetSystemMetricForDpi
SystemParametersInfoForDpi
GetDpiForSystem GetDC  GetDeviceCaps
EnableNonClientDpiScaling
SetThreadDpiAwarenessContext
 

https://github.com/Microsoft/Windows-classic-samples/tree/main/Samples/DPIAwarenessPerWindow

https://docs.microsoft.com/zh-tw/windows/win32/hidpi/high-dpi-improvements-for-desktop-applications?redirectedfrom=MSDN

https://blogs.windows.com/windowsdeveloper/2016/10/24/high-dpi-scaling-improvements-for-desktop-applications-and-mixed-mode-dpi-scaling-in-the-windows-10-anniversary-update/

https://blogs.windows.com/windowsdeveloper/2017/05/19/improving-high-dpi-experience-gdi-based-desktop-apps/

Improving the high-DPI experience in GDI based Desktop Apps

https://docs.microsoft.com/zh-tw/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows?redirectedfrom=MSDN




Manifest File

The most common way to declare an application as DPI aware is through the application manifest file. There are two settings that you can use - <dpiAware> and <dpiAwareness>. Here is a small table that describes the different states that you can use with each setting.
DPI Mode  <dpiAware>  <dpiAwareness>
<description>Microsoft Management Console</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="highestAvailable"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
<gdiScaling>true</gdiScaling>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>    
 



ode Sample:

[code lang=”csharp”]

LRESULT WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{



case WM_PAINT:
{
PAINTSTRUCT ps;

// Get a paint DC for current window.
// Paint DC contains the right scaling to match
// the monitor DPI where the window is located.
HDC hdc = BeginPaint(hWnd, &ps);

RECT rect;
GetClientRect(hDlg, &rect);

UINT cx = (rect.right – rect.left);
UITN cy = (rect.bottom – rect.top);

// Create a compatible bitmap using paint DC.
// Compatible bitmap will be properly scaled in size internally and
// transparently to the app to match current monitor DPI where
// the window is located.
HBITMAP memBitmap = CreateCompatibleBitmap(hdc, cx, cy);

// Create a compatible DC, even without a bitmap selected,
// compatible DC will inherit the paint DC GDI scaling
// matching the window monitor DPI.
HDC memDC = CreateCompatibleDC(hdc);

// Selecting GDI scaled compatible bitmap in the
// GDI scaled compatible DC.
HBTIMAP oldBitmap = (HBITMAP)SelectObject(memDC, memBitmap);

// Setting some properties in the compatible GDI scaled DC.
SetTextColor(memDC, GetSysColor(COLOR_INFOTEXT));
SetBkMode(memDC, TRANSPARENT);
SelectObject(memDC, g_hFont);

// Drawing content on the compatible GDI scaled DC.
// If the monitor DPI was 150% or 200%, text internally will
// be draw at next integral scaling value, in current example
// 200%.
DrawText(memDC, ctx.balloonText, -1, &rect,
DT_NOCLIP | DT_LEFT | DT_NOPREFIX | DT_WORDBREAK);

// Copying the content back from compatible DC to paint DC.
// Since both compatible DC and paint DC are GDI scaled,
// content is copied without any stretching thus preserving
// the quality of the rendering.
BitBlt(hdc, 0, 0, cx, cy, memDC, 0, 0);

// Cleanup.
SelectObject(memDC, oldBitmap);
DeleteObject(memBitmap);
DeleteDC(memDC);

// At this time the content is presented to the screen.
// DWM (Desktop Window Manager) will scale down if required the
// content to actual monitor DPI.
// If the monitor DPI is already an integral one, for example 200%,
// there would be no DWM down scaling.
// If the monitor DPI is 150%, DWM will scale down rendered content
// from 200% to 150%.
// While not a perfect solution, it’s better to scale-down content
// instead of scaling-up since a lot of the details will be preserved
// during scale-down.
// The end result is that with GDI Scaling enabled, the content will
// look less blurry on screen and in case of monitors with DPI setting
// set to an integral value (200%, 300%) the vector based and text
// content will be rendered natively at the monitor DPI looking crisp
// on screen.

EndPaint(hWnd, &ps);
}
break;

}
}

[/code]

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
  <asmv3:application>
    <asmv3:windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>
Native API

There are three native API calls that can set awareness now:

    SetProcessDpiAware - Windows Vista or later
    SetProcessDpiAwareness - Windows 8.1 or later
    SetProcessDpiAwarenessContext - Windows 10, version 1607 or later

The latest API offers PerMonitorV2 support, so it is the currently recommend one.

https://www.telerik.com/blogs/winforms-scaling-at-large-dpi-settings-is-it-even-possible-


New events for handling dynamic DPI changes – DpiChanged, DpiChangedAfterParent, DpiChangedBeforeParent.
New methods – DeviceDpi, ScaleBitmapLogicalToDevice, LogicalToDeviceUnits.

this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ivate void workbookTestButton_Click(object sender, EventArgs e)
{
    SetProcessDpiAwareness(_Process_DPI_Awareness.Process_DPI_Unaware);
    Workbook wb = new Workbook();
}
   
[DllImport("shcore.dll")]
static extern int SetProcessDpiAwareness(_Process_DPI_Awareness value);
   
enum _Process_DPI_Awareness
{
    Process_DPI_Unaware = 0,
    Process_System_DPI_Aware = 1,
    Process_Per_Monitor_DPI_Aware = 2
}

Delphi VCL Applications with mixed DPI
https://www.uweraabe.de/Blog/2021/08/28/delphi-vcl-applications-with-mixed-dpi/

 add a second VCL form to the application and drop some controls on to it, so we can distinguish the form instances by its display quality on a high DPI monitor. I just assume that the second form class is named TForm2.

Now we get back to the first form and drop two buttons on the form and double click each to fill their event handlers. The first button gets the single line:
procedure TForm1.Button1Click(Sender: TObject);
begin
  TForm2.Create(Self).Show;
end;

Make sure that the unit containing TForm2 is added to the uses clause.

The OnClick event of the second button needs a bit more code:
procedure TForm1.Button2Click(Sender: TObject);
var
  previousDpiContext: DPI_AWARENESS_CONTEXT;
  myForm: TForm;
begin
  previousDpiContext := SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE);
  try
    myForm := TForm2.Create(Self);
  finally
    SetThreadDpiAwarenessContext(previousDpiContext);
  end;
  myForm.Show;
end;

So we temporarily change the DPI awareness of the current thread to unaware, create the form and restore the context to its previous state before finally showing the form.


https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-improvements-for-desktop-applications

https://question-it.com/questions/736123/kak-konvertirovat-declare_handle-i-posledujuschie-konstanty-iz-windefh-v-delphi
  DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
  #define DPI_AWARENESS_CONTEXT_UNAWARE           ((DPI_AWARENESS_CONTEXT)-1)
  #define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE      ((DPI_AWARENESS_CONTEXT)-2)
  #define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
 NativeUInts:
  DPI_AWARENESS_CONTEXT_UNAWARE = 16;  
  DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = 17;
  DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = 18;
 SetThreadDpiAwarenessContext

https://docs.microsoft.com/zh-tw/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process

https://github.com/MicrosoftDocs/visualstudio-docs.zh-tw/blob/live/docs/extensibility/addressing-dpi-issues2.md

https://docs.microsoft.com/zh-tw/visualstudio/extensibility/addressing-dpi-issues2?view=vs-2022

https://docs.microsoft.com/zh-tw/dotnet/api/microsoft.visualstudio.platformui.dpihelper?view=visualstudiosdk-2022

 https://www.visualstudioextensibility.com/2015/02/01/visual-studio-extensions-and-dpi-awareness/

Winapi.MultiMon.MonitorFromPoint GetDpiForMonitor  GetScaleFactorForMonitor delphi

 https://www.sql.ru/forum/1317197/getscalefactorformonitor-nevernoe-znachenie

 procedure CallSetProcessDPIAware;
var
  SetProcessDPIAware: function: Boolean; stdcall;
  H: THandle;
begin
  H := GetModuleHandle('User32.dll');
  if H > 0 then
  begin
    @SetProcessDPIAware := GetProcAddress(H, 'SetProcessDPIAware');
    if Assigned(SetProcessDPIAware) then
      SetProcessDPIAware();
  end;
end;

 

 http://yamatyuu.net/computer/program/vc2013/gmonitorinfo/index.html

 WMIを使用してディスプレイサイズ,接続方法を取得(Windows 10高DPI対応)

Launch Notepad

 https://coderoad.ru/6645426/%D0%9F%D1%80%D0%BE%D0%B1%D0%BB%D0%B5%D0%BC%D0%B0-%D0%B1%D0%BB%D0%BE%D0%BA%D0%BD%D0%BE%D1%82%D0%B0-%D0%B2-delphi

 Проблема блокнота в delphi 

 привет, мы используем версию Delphi 5. Мы получаем проблему при открытии блокнота в delphi. Мы хотим открыть блокнот по щелчку кнопки и передать ему данные, чтобы Блокнот мог отображать эти данные. Я не хочу его спасать. пожалуйста, помогите мне в этом. спасибо.  

 

uses
  Clipbrd;

procedure LaunchNotepad(const Text: string);
var
  SInfo: TStartupInfo;
  PInfo: TProcessInformation;
  Notepad: HWND;
  NoteEdit: HWND;
  ThreadInfo: TGUIThreadInfo;
begin
  ZeroMemory(@SInfo, SizeOf(SInfo));
  SInfo.cb := SizeOf(SInfo);
  ZeroMemory(@PInfo, SizeOf(PInfo));
  CreateProcess(nil, PChar('Notepad'), nil, nil, False,
                NORMAL_PRIORITY_CLASS, nil, nil, sInfo, pInfo);
  WaitForInputIdle(pInfo.hProcess, 5000);

  Notepad := FindWindow('Notepad', nil);
  // or be a little more strict about the instance found
//  Notepad := FindWindow('Notepad', 'Untitled - Notepad');

  if Bool(Notepad) then begin
    NoteEdit := FindWindowEx(Notepad, 0, 'Edit', nil);
    if Bool(NoteEdit) then begin
      SendMessage(NoteEdit, WM_SETTEXT, 0, Longint(Text));

      // To force user is to be asked if changes should be saved
      // when closing the instance
      SendMessage(NoteEdit, EM_SETMODIFY, WPARAM(True), 0);
    end;
  end
  else
  begin
    ZeroMemory(@ThreadInfo, SizeOf(ThreadInfo));
    ThreadInfo.cbSize := SizeOf(ThreadInfo);
    if GetGUIThreadInfo(0, ThreadInfo) then begin
      NoteEdit := ThreadInfo.hwndFocus;
      if Bool(NoteEdit) then begin
        Clipboard.AsText := Text;
        SendMessage(NoteEdit, WM_PASTE, 0, 0);
      end;
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  LaunchNotepad('test string');
end;

藝術鍛造 鑄鐵 欄杆 大門 鍛造

http://vorotauzabora.ru/vorota-i-kalitki/kovanye-vorota-svoimi-rukami.html

Делаем кованые ворота своими руками: инструкция от специалистов  Перед непосредственной сваркой потребуется лишь чертеж, который можно создать самостоятельно или же срисовать с понравившегося готового варианта.
Выбор элементов для кованых ворот

Кованые ворота
 

https://www.google.com/search?client=firefox-b-d&q=%D0%9E%D0%B1%D1%8A%D1%8F%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F+%D0%BF%D0%BE+%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D1%83+%C2%AB%D0%BA%D0%BE%D0%B2%D0%B0%D0%BD%D1%8B%D0%B5+%D0%B2%D0%BE%D1%80%D0%BE%D1%82%D0%B0%C2%BB+%D0%B2+%D0%A0%D0%BE%D1%81%D1%81%D0%B8%D0%B8



https://kuznica-msk.ru/eskiz-vorota-kalitki


https://www.google.com/search?q=%D0%9C%D0%B5%D1%82%D0%B0%D0%BB%D0%BB.+%D0%9C%D0%B5%D1%82%D0%B0%D0%BB%D0%BB%D0%BE%D0%BF%D0%BB%D0%B0%D1%81%D1%82%D0%B8%D0%BA.+%D0%98%D0%B7%D0%B4%D0%B5%D0%BB%D0%B8%D1%8F%D0%9A%D0%9E%D0%92%D0%90%D0%9D%D0%AB%D0%95+%D0%98%D0%97%D0%94%D0%95%D0%9B%D0%98%D0%AF.+%D0%9B%D0%95%D0%A1%D0%A2%D0%9D%D0%98%D0%A6%D0%AB.+%D0%9E%D0%93%D0%A0%D0%90%D0%96%D0%94%D0%95%D0%9D%D0%98%D0%AF.+%D0%92%D0%9E%D0%A0%D0%9E%D0%A2%D0%90+%D0%A1%D0%95%D0%92%D0%90%D0%A1%D0%A2%D0%9E%D0%9F%D0%9E%D0%9B%D0%AC++%D0%90%D1%80%D1%82%D0%B5%D0%BB%D1%8C+%D0%BA%D1%83%D0%B7%D0%BD%D0%B5%D1%87%D0%BD%D1%8B%D1%85,+%D0%BB%D0%B8%D1%82%D0%B5%D0%B9%D0%BD%D1%8B%D1%85+%D0%B8+%D1%81%D0%BB%D0%B5%D1%81%D0%B0%D1%80%D0%BD%D1%8B%D1%85+%D1%82%D0%B5%D1%85%D0%BD%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D0%B9&client=firefox-b-d&sxsrf=AOaemvLr7RzL0mhNrTHmFI5SEK-aLxVgwg:1640037292674&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiarf2Br_P0AhUrL6YKHdyKDrYQ_AUoAXoECAEQAw&biw=1536&bih=778&dpr=1.25#imgrc=dfUmNDzB20S1RM


https://www.google.com/search?q=%D0%90%D1%80%D1%82%D0%B5%D0%BB%D1%8C+%D0%BA%D1%83%D0%B7%D0%BD%D0%B5%D1%87%D0%BD%D1%8B%D1%85,+%D0%BB%D0%B8%D1%82%D0%B5%D0%B9%D0%BD%D1%8B%D1%85+%D0%B8+%D1%81%D0%BB%D0%B5%D1%81%D0%B0%D1%80%D0%BD%D1%8B%D1%85+%D1%82%D0%B5%D1%85%D0%BD%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D0%B9&client=firefox-b-d&sxsrf=AOaemvKdlhHzpsN1RZgZCvP7ICqI0mA_7g:1640036084301&source=lnms&tbm=isch&sa=X&ved=2ahUKEwikseTBqvP0AhUKGKYKHYDfBw0Q_AUoAXoECAEQAw&biw=1536&bih=778&dpr=1.25#imgrc=dfUmNDzB20S1RM&imgdii=fdRRfwjmJDUBeM
 
https://www.google.com/search?q=%D0%98%D0%B7%D0%B3%D0%BE%D1%82%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B8%20%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0%20%D0%BA%D0%BE%D0%B2%D0%B0%D0%BD%D1%8B%D1%85%20%D0%B2%D0%BE%D1%80%D0%BE%D1%82%20%20%20%D1%80%D1%83%D0%BA%D0%B0%D0%BC%D0%B8:%20%D0%B8%D0%B7%D0%B3%D0%BE%D1%82%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B8%20%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0%2C%20%D1%8D%D1%81%D0%BA%D0%B8%D0%B7%D1%8B%20%D0%92%D1%8B%D0%B1%D0%B8%D1%80%D0%B0%D0%B5%D0%BC%20%D0%B7%D0%B0%D0%B1%D0%BE%D1%80%D1%8B%20%D0%B8%20%20%D0%B4%D0%BB%D1%8F%20%D0%92%D0%B0%D1%88%D0%B5%D0%B3%D0%BE%20%D1%83%D1%87%D0%B0%D1%81%D1%82%D0%BA%D0%B0%20%20%C2%AB%D0%9F%D0%B8%D0%BA%D0%B0%C2%BB%20%D0%B2%20%D0%B0%D1%81%D1%81%D0%BE%D1%80%D1%82%D0%B8%D0%BC%D0%B5%D0%BD%D1%82%D0%B5%20%D0%9E%D0%9E%D0%9E%20%D0%91%D0%B5%D0%BB%D0%B1%D0%B5%D1%82%D0%BE%D0%BD%20%20%D1%81%20%D0%BA%D0%B0%D0%BB%D0%B8%D1%82%D0%BA%D0%BE%D0%B9%20%D0%B2%D0%BD%D1%83%D1%82%D1%80%D0%B8%20%D0%B2%D0%BE%D1%80%D0%BE%D1%82%20%D1%84%D0%BE%D1%82%D0%BE%20%D1%86%D0%B5%D0%BD%D0%B0%20%D0%BA%D0%BE%D0%B2%D0%BA%D0%B0%20%D0%BC%D0%BE%D0%B4%D0%B5%D1%80%D0%BD%20%D1%87%D0%B5%D1%80%D1%82%D0%B5%D0%B6:%208%20%D1%82%D1%8B%D1%81%20%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B9%20%D0%BD%D0%B0%D0%B9%D0%B4%D0%B5%D0%BD%D0%BE%20%D0%B2%20%D0%AF%D0%BD%D0%B4%D0%B5%D0%BA%D1%81.%D0%9A%D0%B0%D1%80%D1%82%D0%B8%D0%BD%D0%BA%D0%B0%D1%85%20%7C%20%D0%9A%D1%83%D0%B7%D0%BD%D0%B5%D1%87%D0%BD%D1%8B%D0%B5%20%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D1%8B%2C%20%D0%94%D0%B5%D0%BA%D0%BE%D1%80%D0%B0%D1%82%D0%B8%D0%B2%D0%BD%D1%8B%D0%B5%20%D0%BA%D0%B0%D1%80%D1%82%D0%B8%D0%BD%D1%8B%2C%20%D0%9E%D0%BA%D0%BE%D0%BD%D0%BD%D1%8B%D0%B5%20%D1%80%D0%B5%D1%88%D0%B5%D1%82%D0%BA%D0%B8%20%D0%9A%D0%BE%D0%B2%D0%B0%D0%BD%D1%8B%D0%B5%20%D0%B2%D0%BE%D1%80%D0%BE%D1%82%D0%B0:%20%D1%8D%D1%81%D0%BA%D0%B8%D0%B7%D1%8B%2C%20%D0%B8%D0%B7%D0%B3%D0%BE%D1%82%D0%BE%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B8%20%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B0%20%D0%B8%D0%B7%D0%B4%D0%B5%D0%BB%D0%B8%D1%8F%20%20%D0%92-025%20-%20%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C%20%D0%B2%20%D0%A2%D1%8E%D0%BC%D0%B5%D0%BD%D0%B8%20-%20233%20%D0%93%D0%BE%D1%82%D0%BE%D0%B2%D1%8B%D0%B5%20%D1%8D%D1%81%D0%BA%D0%B8%D0%B7%D1%8B%20%D0%B8%20%D1%87%D0%B5%D1%80%D1%82%D0%B5%D0%B6%D0%B8%20%D0%B2%D0%BE%D1%80%D0%BE%D1%82%20%D1%81%20%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%80%D0%B0%D0%BC%D0%B8%20%D0%A6%D0%B5%D0%BD%D0%B0%20%D0%BD%D0%B0%20%D0%BA%D0%BE%D0%B2%D0%B0%D0%BD%D1%8B%D1%85%20%D0%B2%D0%BE%D1%80%D0%BE%D1%82%20%D0%B4%D0%BB%D1%8F%20%D0%B4%D0%B0%D1%87%D0%B8%2C%20%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C%20%20%D0%B2%20%D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B5%20%20%D0%B8%20%D0%BA%D0%B0%D0%BB%D0%B8%D1%82%D0%BA%D0%B8%20(%D0%AD%D1%81%D0%BA%D0%B8%D0%B7%D1%8B)%20-%20%D0%9A%D0%BE%D0%B2%D0%B0%D0%BD%D1%8B%D0%B5%20%D0%B8%D0%B7%D0%B4%D0%B5%D0%BB%D0%B8%D1%8F%20%20%D0%BC%D0%B5%D1%82%D0%B0%D0%BB%D0%BB%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D0%B5%20%D1%81%20%D0%BA%D0%B0%D0%BB%D0%B8%D1%82%D0%BA%D0%BE%D0%B9%20%E2%80%93%20%D0%BA%D0%BE%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%86%D0%B8%D1%8F%2C%20%D1%87%D0%B5%D1%80%D1%82%D0%B5%D0%B6%D0%B8&tbm=isch&tbs=rimg:CXep0Hr3nrc5YajrvEmJXEBEsgIGCgIIARAA&client=firefox-b-d&hl=zh-TW&sa=X&ved=0CBsQuIIBahcKEwiwyOTrrPP0AhUAAAAAHQAAAAAQBg&biw=1519&bih=778







2021年12月20日 星期一

EtheaDev IconFontsImageList https://githubhelp.com/EtheaDev/IconFontsImageList

 https://githubhelp.com/EtheaDev/IconFontsImageList

 

Four advanced components to simplify use of Icon Fonts as images and ImageList: TIconFontImage, TIconFontsImageCollection, TIconFontsVirtualImageList, TIconFontsImageList (for VCL and FMX). Full support for High-DPI apps. Rendering optimized with GDI+ 



delphi-code-coverage/JwaWinGDI.pas

 at master - GitHub


This is a clone of the code coverage tool for Delphi on ... function AddFontResource(lpszFileName: LPCTSTR): Integer; stdcall;.

load font

https://tipsfordev.com/firemonkey-load-alternative-font

FIREMONKEY - load alternative font

I would like to load an external font in a Delphi Firemonkey application.

Is there any information how to do that?


Not sure if it works for FireMonkey, but this code worked for me when I wanted to load custom fonts to my standard Delphi applications.
 
uses
  Windows, SysUtils, Messages, Classes, Generics.Collections;

type
  { .: TExternalFonts :. }
  TExternalFonts = class sealed(TList<HFONT>);

var
  ExternalFonts: TExternalFonts;

function AddExternalFont(const AFileName: String): HFONT; overload;
function AddExternalFont(const AStream: TStream): HFONT; overload;

implementation

{ .: DoCleanup :. }
procedure DoCleanup();
var
  I: Integer;
begin
  for I := ExternalFonts.Count -1 downto 0 do
  begin
    RemoveFontMemResourceEx(ExternalFonts[I]);
    ExternalFonts.Delete(I);
    //SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
  end;
end;

{ .: AddExternalFont :. }
function AddExternalFont(const AFileName: String): HFONT; overload;
var
  FS: TFileStream;
begin
  Result := 0;

  if not FileExists(AFileName) then
    exit;

  FS := TFileStream.Create(AFileName, fmOpenRead + fmShareExclusive);
  try
    Result := AddExternalFont(FS);
  finally
    FS.Free();
  end;
end;

{ .: AddExternalFont :. }
function AddExternalFont(const AStream: TStream): HFONT; overload;
var
  MS: TMemoryStream;
  Temp: DWORD;
begin
  Result := 0;

  if not Assigned(AStream) then
    exit;

  Temp := 1;
  MS := TMemoryStream.Create();
  try
    MS.CopyFrom(AStream, 0);

    Result := AddFontMemResourceEx(MS.Memory, MS.Size, nil, @Temp);
    if (Result <> 0) then
      ExternalFonts.Add(Result);
    //SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
  finally
    MS.Free();
  end;
end;

initialization
  ExternalFonts := TExternalFonts.Create();

finalization
  DoCleanup();
  ExternalFonts.Free();

end.
 

use external fonts font directly from resources in Delphi Resource Compiler brcc32 MSBuild

 use external fonts font directly from resources in Delphi
AddFontMemResourceEx
https://docs.microsoft.com/zh-tw/windows/win32/api/wingdi/nf-wingdi-addfontmemresourceex?redirectedfrom=MSDN
https://docs.microsoft.com/zh-tw/windows/win32/api/wingdi/nf-wingdi-addfontresourcea?redirectedfrom=MSDN
https://docs.microsoft.com/zh-tw/windows/win32/api/wingdi/nf-wingdi-addfontresourceexa?redirectedfrom=MSDN
https://docs.microsoft.com/zh-tw/windows/win32/api/wingdi/nf-wingdi-addfontmemresourceex?redirectedfrom=MSDN
https://sourceforge.net/projects/jvcl/
 JVCL's TjvDataEmbedded AddFontResource
https://docwiki.embarcadero.com/RADStudio/Sydney/en/Step_3_-_Add_Style-Resources_as_RCDATA_(Delphi)
Step 3 - Add Style-Resources as RCDATA (Delphi)


procedure TForm1.FormCreate(Sender: TObject) ;
begin
  AddFontResource('c:\FONTS\MyFont.TTF') ;
  SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ;
end;

//Before application terminates we must remove our font:
procedure TForm1.FormDestroy(Sender: TObject) ;
begin
  RemoveFontResource('C:\FONTS\MyFont.TTF') ;
  SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ;
end;
https://stackoverflow.com/questions/2984474/embedding-a-font-in-delphi
https://stackoverflow.com/questions/36224624/loading-font-from-resource-file

TResourceStream AddFontResource WM_FONTCHANGE message
   ResStream : tResourceStream;
   FontsCount : integer;
   hFont : tHandle;
 
   ResStream := tResourceStream.Create(hInstance, ResourceName, RT_RCDATA);
   hFont := AddFontMemResourceEx(ResStream.Memory, ResStream.Size, nil, @FontsCount);
   result := (hFont <> 0);
   ResStream.Free();
 

function LoadResourceFontByName( const ResourceName : string; ResType: PChar ) : Boolean;
var
  ResStream : TResourceStream;
  FontsCount : DWORD;
begin
  ResStream := TResourceStream.Create(hInstance, ResourceName, ResType);
  try
    Result := (AddFontMemResourceEx(ResStream.Memory, ResStream.Size, nil, @FontsCount) <> 0);
  finally
    ResStream.Free;
  end;
end;

function LoadResourceFontByID( ResourceID : Integer; ResType: PChar ) : Boolean;
var
  ResStream : TResourceStream;
  FontsCount : DWORD;
begin
  ResStream := TResourceStream.CreateFromID(hInstance, ResourceID, ResType);
  try
    Result := (AddFontMemResourceEx(ResStream.Memory, ResStream.Size, nil, @FontsCount) <> 0);
  finally
    ResStream.Free;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  if LoadResourceFontByName('MyFont1', RT_RCDATA) then
    Label1.Font.Name := 'My Font Name 1';

  if LoadResourceFontByID(2, RT_FONT) then
    Label2.Font.Name := 'My Font Name 2';
end;

LoadResourceFontByName
delphi add font resource file LoadResourceFontByName
[Solved] Embedding a font in delphi - Code Redirect
https://www.sql.ru/forum/1254355/delphi-zagruzit-shrift-iz-resursov

{$R MyNewFont.RES}
...
procedure TForm1.FormCreate(Sender: TObject);
var
  MyResStream: TResourceStream;
begin
  MyResStream:=TResourceStream.Create(hInstance, 'MYFONT', RT_RCDATA);
  MyResStream.SavetoFile('Gen4.ttf');
  AddFontResource(PChar('Gen4.ttf'));
  SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);
  Label1.Font.Charset:=SYMBOL_CHARSET;
  Label1.Font.Size:=24;
  Label1.Font.Name:='Gen4';
end;

MSBuild.exe C:/Project1.dproj /t:Build /p:configutation=Debug /p:platform=Win32

https://docwiki.embarcadero.com/RADStudio/Sydney/en/BRCC32.EXE,_the_Resource_Compiler
Resource Compiler, brcc32.exe

https://delphi.cjcsoft.net/viewthread.php?tid=47317

{$R MyFont.res}
  Res : TResourceStream;
 
  Res := TResourceStream.Create(hInstance, 'MY_FONT', Pchar('ANYOL1'));
  Res.SavetoFile('Bauhs93.ttf');
  Res.Free;
  AddFontResource(PChar('Bauhs93.ttf'));
  SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);
 
  RemoveFontResource(PChar("Bauhs93.ttf"))
  SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);














2021年12月18日 星期六

Custom Controls in Win32 API: Visual Styles Application Manifest assembly xmlns InitCommonControls comctl32.DLL

 https://www.codeproject.com/Articles/620045/Custom-Controls-in-Win-API-Visual-Styles

  https://docs.microsoft.com/en-us/answers/questions/199283/use-common-controls-v6-in-a-dll-compiled-using-vc6.html

https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests

https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/schema-root


Custom Controls in Win32 API: Visual Styles

https://www.codeproject.com/Articles/559385/Custom-Controls-in-Win-API-The-Basics
https://www.codeproject.com/Articles/617212/Custom-Controls-in-Win-API-The-Painting
https://www.codeproject.com/Articles/620045/Custom-Controls-in-Win-API-Visual-Styles

Application Manifest

1 RT_MANIFEST path/to/manifest.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="app name" type="win32"/>
    <description>app description</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
              version="6.0.0.0" processorArchitecture="*"
              publicKeyToken="6595b64144ccf1df" language="*"/>
        </dependentAssembly>
    </dependency>
    <ms_asmv2:trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <ms_asmv2:security>
            <ms_asmv2:requestedPrivileges>
                <ms_asmv2:requestedExecutionLevel level="asInvoker" uiAccess="false"/>
            </ms_asmv2:requestedPrivileges>
        </ms_asmv2:security>
    </ms_asmv2:trustInfo>
</assembly>
 

COMCTL32.DLL   UXTHEME.DLL        USER32.DLL 


Useless IsThemeActive() and IsAppThemed()

UXTHEME.DLL        USER32.DLL   
Function        Fundamental constant        Function        Fundamental constant   
GetThemeSysBool()        TMT_FLATMENUS        SystemParametersInfo()        SPI_GETFLATMENU   
GetThemeSysColor()                 GetSysColor()            
GetThemeSysColorBrush()                 GetSysColorBrush()            
GetThemeSysFont()        TMT_ICONTITLEFONT        SystemParametersInfo()        SPI_GETICONTITLELOGFONT   
the other ones        SPI_GETNONCLIENTMETRICS   
GetThemeSysInt()                 no counterpart            
GetThemeSysSize()                 GetSystemMetrics()            
GetThemeSysString()                 no counterpart

GetThemeBackgroundContentRect OpenThemeData GetWindowTheme GetThemeIntList _WIN32_WINNT_VISTA
Screenshot of Theme Explorer 


embarcadero Customizing the Windows Application Manifest File

Go Up to Types of Multi-Device Applications You Can Create

Go Up to Deploying Applications - Overview

    API (ApplicationName.manifest)

    Applications Options for Desktop Platforms

    MSDN: Application Manifests

    MSDN: Create and Embed an Application Manifest (UAC)

    Delphi Developers Guide 4K.pdf (Solving DPI problems, creating a custom manifest.)

Identity Management Tools



OpenIAM https://www.openiam.com/
Apache Syncope Syncope - Open Source Identity Management https://syncope.apache.org/
Shibboleth Consortium https://www.shibboleth.net/
WSO2 https://wso2.com/identity-and-access-management/
MidPoint https://evolveum.com/midpoint/
Soffid http://www.soffid.com/
Gluu Gluu Server - Identity and Access Management (IAM) platform https://www.gluu.org/
Keycloak https://www.keycloak.org/index.html
FreeIPA https://www.freeipa.org/page/Main_Page
Central Authentication Service (CAS) https://www.apereo.org/projects/cas
OpenDS - Next generation Directory Service
OpenLdap - Implementation of the Lightweight Directory Access Protocol (LDAP)
kratos - Next-gen identity server (think Auth0, Okta, Firebase) with Ory-hardened authentication, MFA, FIDO2, profile management, identity schemas, social sign in, registration, account recovery, service-to-service and IoT auth
Keycloak - Open Source Identity and Access Management For Modern Applications and Services
SSSD - System Security Services Daemon
OpenDJ - LDAPv3 compliant directory service
389 Directory Server - Powerful OpenSource LDAP
FreeIPA - Identity and Access Management for Linux
Apache Fortress - Identity and Access Management
Mandriva - Identity and Network Management
ApacheDS - Apache Directory Project
LSC engine - LDAP Synchronization Connector
AMX Identity Management - An HR driven Identity and Access Management solution
msf - MFS (Minio Federation Service) is a namespace, identity and access management server for Minio Servers
ForgeRock https://en.wikipedia.org/wiki/ForgeRock
OpenAM https://en.wikipedia.org/wiki/OpenAM
OpenIDM https://en.wikipedia.org/wiki/OpenIDM
OpenDJ https://en.wikipedia.org/wiki/OpenDJ
https://en.wikipedia.org/wiki/Category:Identity_management_systems










How to make a Delphi application run as an administrator? Delphi High DPI switch between own scaling and Windows scaling

 https://itqna.net/questions/5331/how-make-delphi-application-run-administrator

  

Tip: To learn more about custom Manifest file you can give   a look at this Embarcadero link : Customizing the Windows   Application Manifest   File

 

https://docwiki.embarcadero.com/RADStudio/Tokyo/en/Customizing_the_Windows_Application_Manifest_File

 Customizing the Windows Application Manifest File

 

YOU CAN USE THIS FILE HERE

If you prefer you can use this ready, just do the following:

Content of the manifest file

  • Create a text file and paste the content below
  • Save in the folder of your project with the name you prefer, as long as you have the .manifest extension, the most common is that the file is named Manifest.manifest
  •  

     

     

    https://en.wikipedia.org/wiki/Manifest_file

     Windows Application Manifest File       name="Microsoft.Windows.Common-Controls"

     

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
     <dependency>
       <dependentAssembly>
         <assemblyIdentity
           type="win32"
           name="Microsoft.Windows.Common-Controls"
           version="6.0.0.0"
           publicKeyToken="6595b64144ccf1df"
           language="*"
           processorArchitecture="*"/>
       </dependentAssembly>
     </dependency>
     <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
       <security>
         <requestedPrivileges>
           <requestedExecutionLevel
             level="asInvoker"
             uiAccess="false"/>
           </requestedPrivileges>
       </security>
     </trustInfo>
    </assembly>

     

    // Set DPI Awareness depending on a registry setting
    with TRegIniFile.create('SOFTWARE\' + SRegName) do
    begin
      setting := readInteger('SETTINGS', 'scale', 0);
      Free;
    end;
    handle := LoadLibrary('shcore.dll');
    if handle <> 0 then
    begin
      setProcessDPIAwareness := GetProcAddress(handle, 'SetProcessDpiAwareness');
      if Assigned(setProcessDPIAwareness) then
      begin
        if setting < 2 then
          // setting <2 means no scaling vs Windows
          setProcessDPIAwareness(0)
        else
          // setting 2: 120%, 3: 140% vs. Windows
          // The actual used scaling factor multiplies by windows DPI/96
          setProcessDPIAwareness(1);
      end;
      FreeLibrary(handle);
      // Get windows scaling as Screen.PixelsPerInch was read before swiching DPI awareness
      // Our scaling routines now work with WinDPI instead of Screen.PixelsPerInch
      WinDPI:= Screen.MonitorFromWindow(application.handle).PixelsPerInch;
    end;
     
     
    Mage.exe (Manifest Generation and Editing Tool) - Microsoft ...
    https://docs.microsoft.com › dotnet › tools
    The Manifest Generation and Editing Tool (Mage.exe) is a command-line tool that supports the creation and editing of application and deployment ...
     文件擴展名首頁 / 所有軟體 / Heaventools Software / Heaventools Application Manifest Wizard

    Heaventools Application Manifest Wizard
    開發者名稱: Heaventools Software
    最新版本: 1.99 R6
    軟體類別: 開發者工具
    軟體子類別: XML 工具
    操作系統: Windows

    軟體概述

    應用程序清單嚮導是一個工具,允許遺留應用程序從Windows XP或Vista的共同控制的華而不實的新面貌受益。這個工具允許除了插入需要管理員級別為它添加UAC清單。這使得提高管理員對Windows 7和Vista的應用程序運行。這使得應用程序的操作行為等同於Windows XP。 

    Pythia 程序是用於在高能碰撞中生成事件的標準工具 物理模型

     Pythia 程序是用於在高能碰撞中生成事件的標準工具,包括一組連貫的物理模型,用於從少體硬過程到復雜的多粒子最終狀態的演化。 它包含一個硬過程庫、初始和最終狀態部分子簇射的模型、硬過程和部分子簇射之間的匹配和合併方法、多部分相互作用、束殘餘、弦碎裂和粒子衰變。 它還具有一組實用程序和多個與外部程序的接口。 Pythia 8.2 是從 Fortran 完全重寫為 C++ 之後的第二個主要版本,現在已經成熟到可以完全替代大多數應用程序,尤其是 LHC 物理研究。 許多新功能應該允許改進數據描述。

    https://pythia.org/

    https://vincia.hepforge.org/
     
    PYTHIA  JETSET   high energy physics event

    http://www.phys.ufl.edu/~rfield/cdf/CDF_minbias.html

    https://en.wikipedia.org/wiki/Event_generator

     

     

    List of event generators
    The major event generators that are used by current experiments are:
    Hadronic event generators[3]
        PYTHIA (formerly Pythia/Jetset)
        HERWIG
        ISAJET
        SHERPA
    Multi-purpose parton level generators
        MadGraph5 (able to run directly on the web site after registration and an email to the author)
        Whizard
     


    https://en.wikipedia.org/wiki/Event_generator

    Event generators are software libraries that generate simulated high-energy particle physics events. They randomly generate events as those produced in particle accelerators, collider experiments or the early universe. Events come in different types called processes as discussed in the Automatic calculation of particle interaction or decay article.

    Doxygen Graphviz Doxygen Flow Graph Code Flowgen Doxygen Graph Python Sphinx UML diagram


    Flow Graph Code
    Flowchart-Based Documentation Framework  
     visual documentation UML activity diagram flowchart annotated sources
     LibClang
    PlantUML Dextool Mutate
    https://en.wikipedia.org/wiki/PlantUML

    Flowgen to the Vincia code
    https://vincia.hepforge.org/
     The VINCIA code is a plugin to the high-energy physics event generator PYTHIA 8.2.
    Starting from PYTHIA 8.3, VINCIA will be distributed as part of the PYTHIA source code, and hence this standalone plugin will not be relevant to PYTHIA 8.3 users.
    VINCIA is based on the dipole-antenna picture of Quantum Chromodynamics (QCD) and focusses on describing jets and jet substructure with high precision.

    https://clang.llvm.org/
    https://clang.llvm.org/get_started.html
    UMLet 14.3
    Free UML Tool for Fast UML Diagrams https://www.umlet.com/

    https://plantuml.com/


    https://github.com/noware/clang-cindex-python3
    This is simply clang's Python bindings (clang.cindex) ported to Python 3.
     Please see http://llvm.org/svn/llvm-project/cfe/trunk/bindings/python/ for the original project.

     

     


    https://en.wikipedia.org/wiki/Category:Free_documentation_generators   Python Sphinx Documentation Generator Documentation Generation

     

    https://www.saashub.com/compare-doxygen-vs-sphinx-documentation-generator

    GitBook - Modern Publishing, Simply taking your books from ideas to finished, polished books.

    Slate API Docs Generator - Create beautiful, intelligent, responsive API documentation.

    MkDocs - Project documentation with Markdown.

    ReadTheDocs - Spend your time on writing high quality documentation, not on the tools to make your documentation work.

    Confluence - Confluence is content collaboration software that changes how modern teams work

    DocFX - A documentation generation tool for API reference and Markdown files!


    Python Sphinx Documentation Generator
    Overview — Sphinx documentation
    https://www.sphinx-doc.org
    Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license. 



    source code generator hierarchy graph Class hierarchy dependency diagram generator



    https://www.sourcetrail.com/ source code generator hierarchy graph Class hierarchy dependency diagram generator
     as in KCachegrind – and evolution visualization – for repository analysis) in KDevelop. https://liveblue.wordpress.com/2009/06/17/visualize-your-code-in-kdevelop/
    https://github.com/shreyasbharath/cpp_dependency_graph
    https://github.com/tomtom-international/cpp-dependencies

    Graphviz is open source graph visualization software. http://www.graphviz.org/

    https://www.doxygen.nl/index.html
    Doxygen + GraphViz (for pictures, doxygen requires GraphViz)

    Code Graph
    Yiubun Auyeung
    https://marketplace.visualstudio.com/items?itemName=YaobinOuyang.CodeAtlas

    JetBrains
    Hierarchy window | ReSharper https://www.jetbrains.com/help/resharper/Reference__Windows__Type_Hierarchy_Window.html#tree

    Is there a control to visualize mesh topology in c#?
    看看ndepend(http://www.ndepend.com/)。除了為程式碼庫計算各種度量之外,它還可以視覺化依賴項。有試用版。
    這是一張截圖(在http://www.ndepend.com/Features.aspx#DependenciesView上),可能正是你想要的:http://www.ndepend.com/Res/DiagramBoxAndArrowGraphBig.jpg
    https://www.ndepend.com/docs/visual-studio-dependency-graph#Call
    https://www.ndepend.com/docs/visual-studio-dependency-graph#Inherit
    https://www.ndepend.com/docs/validating-cqlinq-code-rules-in-visual-studio
    https://www.ndepend.com/docs/customize-ndepend-report#CQLRule

    https://www.scitools.com/ 


    java
    https://github.com/amitjoy/dependency-graph-osgi
    visualize OSGi Dependencies in a graph
        https://bnd.bndtools.org
        http://graphstream-project.org

    source code hierarchy diagram generator Graph doxygen documentation uml create Dependency Graphs for Header Files

     

    --------Cscope   http://cscope.sourceforge.net/cscope_man_page.html   
    screen-oriented tool that allows the user to browse through C source
    is a developer's tool for browsing source code. It has an impeccable Unix pedigree, having been originally developed at Bell Labs back in the days of the PDP-11. Cscope was part of the official AT&T Unix distribution for many years, and has been used to manage projects involving 20 million lines of code!
    In April, 2000, thanks to the Santa Cruz Operation, Inc. (SCO) (since merged with Caldera), the code for Cscope was open sourced under the BSD license.
    --------gtags-cscope is an interactive, screen-oriented tool that allows the user to browse through source files


    GNU global source-code tag system
    Tama Communications Corporation; http://tamacom.com
     GNU Global source code tagging system https://www.tamacom.com/handbook.html
     GNU GLOBAL handbook https://www.tamacom.com/global.html
     
    --------Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and ...
    --------Elvis Text Editor Elvis is an enhanced clone of the vi text editor,
    --------GNU Emacs Emacs is the advanced, extensible, customizable, self-documenting editor. This manual describes how to edit with Emacs and some of the ways to customize it; ...
    --------less less is a terminal pager program on Unix, Windows, and Unix-like systems used to view (but not change) the contents of a text file one screen
     
    Doxygen http://www.stack.nl/~dimitri/doxygen/
    http://www.doxygen.nl
    Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such ...


    Gprof performance analysis tools http://www.gnu.org/manual/gprof-2.9.1/gprof.html. Gprof is a performance analysis tool for Unix applications. It used a hybrid of instrumentation and sampling[1] and was created as an extended version of the older "prof" tool. Unlike prof, gprof is capable of limited call graph collecting and printing


    GNU cflow analyzes a collection of C source files and prints a graph, charting control flow within the program.
    GNU cflow Exuberant Ctags Ctags is a programming tool that generates an index (or tag) file



    Graphviz http://www.graphviz.org/ https://en.wikipedia.org/wiki/Graphviz Graphviz (short for Graph Visualization Software)  








     

    Dynamic Tracing DTrace SystemTap OpenResty XRay stappxx toolkit AddressSanitizer

     Dynamic Tracing 

    DTrace SystemTap

     OpenResty XRay 

    stappxx 

     toolkit AddressSanitizer

     

    Dynamic Tracing DTrace SystemTap OpenResty XRay 

     

     

    https://wiki.st.com/stm32mpu/wiki/Linux_tracing,_monitoring_and_debugging

    https://www.brendangregg.com/perf.html

    https://en.wikipedia.org/wiki/DTrace

    https://en.wikipedia.org/wiki/SystemTap


    https://en.wikipedia.org/wiki/Ktrace

    of BSD Unix and Mac OS X that traces kernel interaction

    strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and ...

    2.5 Code Spelunking | Systems Perfomance Advice for ... https://www.informit.com › articles › article  — ktrace. This is a standard tool on open source operating systems. The name stands for ”kernel trace.” It will give you a listing of all the ...

    2021年12月17日 星期五

    C sample code for PIC micros and Hi-Tech C usb rs232

     C sample code for PIC micros and Hi-Tech C
    https://www.microchipc.com/sourcecode/


    C sample code for PIC micros and Hi-Tech C

    Sample projects for the Microchip PIC micro series of microcontrollers, including the PIC12x, PIC16x, PIC18x, PIC24x, and dsPICx microcontrollers.

    Code is targeted at the Hi-Tech C compiler, from www.htsoft.com, the C18 or C30 compiler from www.microchip.com, or CCS C.

    We want to publish your embedded source code for the benefit on the PIC community. Send it to support@microchipc.comand I will post it on the site, together with recognition of your name and website.

        CRC.
        USB serial port for PIC18F4550.
        MMC card.
        Delay routines in C for PIC16Fx core.
        Delay routines in C for PIC18Fx core.
        UART for PIC16F87x and PIC18Fx.
        Bootloader - PIC16F876.
        Bootloader - PIC18F1320.
        Bootloader - PIC18Fx52.
        Bootloader - PIC17C4x.
        Bootloader - dsPIC (all variants).
        EEPROM.
        A/D.
        D/A.
        SPI.
        LCD.
        PIC12C509 logic replacement nitrogen filler.
        I2C.
        Multitasking and RTOS.
        17C4x bootloader.
        16F84 based pulse monitor.
        TRIAC controller
        Dallas DS1821 thermometer.
        Decimal routines.
        PIC16F84 pulse mon date/time RS232 serial port
        PIC16F84 TRIAC / IGBT 50/60Hz control.

        

        Phase Controller for 2kW heater.
        Dallas DS1821 three-pin digital thermostat.
        Gym Timer.
        LCD and keypad project.
        Heater Project - involves 1-wire routines, serial routines, a P.I.D (Proportional, Integral, Derivative) calculation, ADC, and a interrupt driven burst mode heater control.
        dsPIC30Fx "Hello World" example.
        dsPIC30Fx "RC Pulse" example.
        C driver code project for Samsung KS0713 and PIC micros.
        PIC18LF4550 with LCD and temperature sensor.
        MiniBasic example peripheral code in C, for PIC18, PIC24, PIC32. Examine the C source code to work out how to use any peripheral on a PIC18, PIC24 or PIC32. Very useful.
        Interrupt driven serial with circular FIFO for PIC16x micro.
        Tiny threads example - 1 byte per thread.
        The Dot Factory: An LCD Font and Image Generator
        Embedded PIC Programmer
        Portable LCD driver.
        SimpleRTOS. A tiny, portable multitasking OS.
        Improve your programming with the UVa tutorial.
        ... and much, much more.

    DISKLESS PXE BOOT Kickstart で CentOS7 自動インストール - Qiita

     https://qiita.com/k-koz/items/846a0d064c51f2937b1f

    @k-koz

    posted at 2016-05-08

    updated at 2016-05-09

    Kickstart で CentOS7 自動インストール - Qiita
    Kickstart で CentOS7 自動インストール
    vsftpd
    tftp
    dhcpd
    kickstart
    centos7
    【Kickstart で CentOS7 自動インストール】

        Kickstart 環境を構築し、CentOS7 を自動インストールする手順をまとめる


    [Server: Kickstart 環境の構築]
    1. TFTP server セットアップ
    2. DHCP server セットアップ
    3. FTP Server セットアップ    (TFTP)
    4. Kickstart 設定 (CentOS7インストール用)

    [Client: Kickstart 環境の利用]
    1. CentOS 自動インストール実行手順

    4. Kickstart 設定 (CentOS7インストール用)

    f. PXE ブート設定ファイル配置ディレクトリ作成

    mkdir -p /var/lib/tftpboot/pxeboot/pxelinux.cfg/

    g. PXE ブート設定ファイル作成

    i. kickstart ファイル作成

        オプションの詳細は RHEL7インストールマニュアル/23.3. キックスタート構文の参考資料 を参照
        パスワードは下記コマンドで生成可能

    http://taeisheauton4programming.blogspot.com/2019/05/pxevirtualboxcentos-7.html

     PXEにより、VirtualBoxでCentOS 7のインストーラーを起動した(図で解説あり)
    5月 01, 2019


    VirtualBox Version 5.2.20 r125813 (Qt5.6.3)、CentOS Linux release 7.6.1810 (Core)を用いて、PXEによるインストーラーの起動までを試した。
    PXEサーバー、PXEクライアントともに、VirtualBoxの仮想マシン。
    作業開始時点のPXEサーバーの状態は、Minimal ISOをインストールした直後とする。
    SELinuxはEnforcing、firewalldはstopしないで必要なだけ開放した。
    基本的に、Redhatの公式ドキュメントのやり方を踏襲した。

    PXEについて
    PXEは、ネットワークブートを実現する仕組み。
    OSやインストーラーを、ネットワーク経由で起動できる。
    Kickstartと組み合わせることで、Linux OSのインストールを自動化できる。

    PXEに必要なサーバーは、下記の3つ。

        DHCPサーバー - IPアドレス付与、TFTPサーバーとブートローダーの場所を教える
        TFTPサーバー - ブートローダーを提供、インストールソースの場所を教える
        ファイルサーバー(HTTP、FTP、NFSなど) - インストールソースを提供



    Diskless Windows 10 PC Setup Procedure

     https://audiophilestyle.com/forums/topic/26705-diskless-windows-10-pc-setup-procedure/

     

    https://audiophilestyle.com/forums/topic/26705-diskless-windows-10-pc-setup-procedure/
     Diskless Windows 10 PC Setup Procedure By scan80269,

    Gigabit Ethernet NIC with PXE boot support

    Gigabit Ethernet NIC, with driver for Windows Server  

    DHCP server static IPs

    Contents of iscsi.ipxe (text) file: #!ipxe

    sanboot iscsi:<server IP>::::iqn.1991-05.com.microsoft:<server name>-win10-target boot

    Share iSCSIVirtualDisks folder with rear/write permission for client username

    Create TFTProot folder

    Put ipxe-undionly.kpxe and iscsi.ipxe files in C:\TFTProot

    Download and set up Tiny PXE Server (Tiny PXE Server - reboot.pro)

    Enable iSCSI Service


    Client Connect network via gigabit Ethernet NIC and cable

    Attach local storage (HDD/SSD)

    Install Windows 10 OS into hard disk

    - Copy OS install files into FAT32 formatted USB flash drive to use for OS installation

    Install NIC driver and other device drivers (graphics, audio, etc.) as needed

    Ensure client can properly browse on Internet

     Launch iSCSI Initiator

    - Type "iscsicpl" <Enter> at the Command Prompt window and answer Yes to the prompt

    - This will configure Win10 to auto launch the iSCSI initiator service at OS startup

    Launch Registry Editor (regedit.exe) to set boot flag for LAN driver

    Locate the LAN driver service name under HKLM\SYSTEM\CurrentControlSet\Services

    Example: for motherboards featuring Intel I217V/LM, I218V/LM, I219V/LM LAN the driver service name is: e1dexpress

    Click on the driver service name, locate the Start key (REG_DWORD), double-click it and change its value to 0

    - Repeat this Start key value change to 0 in HKLM\SYSTEM\ControlSet001\Services and HKLM\SYSTEM\ControlSet002\Services

    Close Registry Editor

    Download and run Disk2VHD.exe (from Microsoft Sysinternals: https://technet.microsoft.com/en-us/sysinternals/ee656415.aspx)

    - Ensure "Use Vhdx" and "Use Volume Shadow Copy" checkboxes are checked

    - In "VHD File Name" box, enter "\\<Server IP>\<share name>\Win10.VHDX (e.g. \\192.168.0.100\c\Win10.VHDX)

    - Run Disk2VHD to create VHDX file on server

     
    Server:

    Set up iSCSI target LUN

    Use "existing VHDX"

    Add MAC address of client to iSCSI initiator list

     

     

    Client:

     Launch "iSCSI Initiator"

     On "Discovery" tab, click "Discover Portal" and enter IP address or DNS name of server

     on "Targets" tab, ensure a target appears on "Discovered targets" list

     target name should look like: iqn.1991-05.com.microsoft:<server name>-Win10-target

     Shut down Windows and detach hard disk from client

     Power up client and it should proceed to PXE boot

    - PXE boots to iPXE from server, then chains to iSCSI target LUN to start Windows 10 boot

     

     

     

    Notes:

    A. This procedure sets up a fixed size VHDX on the server. An alternative is to create a new dynamic VHDX (of desired max size) on the server, mount it locally (using iSCSI Initiator running on the server), connect the client disk to the server via USB-to-SATA adapter, then partition copy the client disk to the mounted VHDX. This preserves the dynamic nature of the VHDX file and helps conserve disk space on the server.



     
     

    2021年12月16日 星期四

    delphi fmx 動畫 Animator Animation Interpolation TAnimator AnimateFloat AnimateFloat TAnimationType TInterpolationType

     https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Ani.TAnimator.AnimateFloat

     https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Types.TFmxObject.AnimateFloat

     FMX.Types.TFmxObject.AnimateFloat

     

    https://github.com/PacktPublishing/Delphi-Programming-Projects/blob/master/Chapter05/uFrmMenu.pas

     Delphi Programming Projects: Build a range of exciting projects by exploring ...

     https://codeverge.com/embarcadero.delphi.firemonkey/how-to-make-animation-running-s/2000855

     https://www.coursehero.com/file/97111482/Algoritmo5txt/

     https://www.delphican.com/archive/index.php/thread-5493.html

     

     Lesson 8 – Using Image and Animation Effects
    http://firemonkey.borlandforum.com › attach › e_...
    PDF http%3A%2F%2Ffiremonkey.borlandforum.com%2Fimpboard%2Fattach%2F0000143970%2Fe_learning_series_win_mac_development_coursebook_lesson8.pdf&usg=AOvVaw17vdCnJyJtp5Iybk5US07e

     atIn;. AInterpolation: TInterpolationType = TInterpolationType.itLinear);. // C++ void __fastcall AnimateFloat(const System::UnicodeString.

     

    https://www.youtube.com/watch?v=dTP8MfZ5fe4&ab_channel=MuminjonAbduraimov

    https://github.com/MuminjonGuru/Mastering-FireMonkey-Delphi/tree/master/AnimateFloat

    delphi Navigation Sidebar LIST MENU TCategoryButtons Buttons Category

      delphi Navigation Sidebar LIST MENU

    delphi TCategoryButtons Buttons Category

     https://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.CategoryButtons.TCategoryButtons.ButtonOptions

    https://wiki.freepascal.org/JVCL_Components 

    https://stackoverflow.com/questions/18182284/how-to-create-attractive-side-bar-menus-at-delphi

     

    JvXPCtrls

    Depends on package JvCore and JvStdCtrls.
    Several controls imitating the look and feel of Windows XP.

        JvXPButton and JvXPCheckbox: a button and a checkbox in XP-style
        TJvXPProgressBar: Draws a progressbar in XP-style. The color of the the background and of the blocks is configurable. Doesn't support Marquee-style.
        JvXPBar: a container side-bar with collapsable panels. Similar to TJvRollOut-Panel, but with string items instead of controls. Collapsing/Expanding happens smooth and nicely animated.

    JvXPBarDemo.png

    FMX.Ani.TAnimator.AnimateFloat - RAD Studio API ... AnimateFloat  TAnimationType TInterpolationType   AnimateFloat TAnimationType TInterpolationType

    https://www.youtube.com/watch?v=qZj4J1x1v_g&ab_channel=DelphiCreative
    https://github.com/DelphiCreative/DemoFree/tree/c8e382d27c14c2083951750d96be6669501ae469


    window container control  menu Navigation Sidebar





    delphi procedure TNotifyEvent list dynamic script Tlist dynamic

     https://docwiki.embarcadero.com/RADStudio/XE3/en/Procedural_Types#Method_Pointers

     https://stackoverflow.com/questions/8102255/delphi-dynamically-calling-different-functions

     

    delphi ActionList Component 

     

    blong.com/Articles/Actions/Actions.htm

     Actions, Action Lists And Action Managers 


    www.functionx.com/cppbuilder/topics/actions.htm

     The TContainedAction class is derived from the TBasicAction class, which itself is based on the TComponent class.

    programming language interface for calling natively compiled RunTime library Loading dynamic link libraries

      programming language interface for calling natively compiled RunTime library Loading dynamic link libraries

    https://en.wikipedia.org/wiki/Libffi
    https://dyncall.org/
    https://www.drdobbs.com/a-dynacall-function-for-win32/184416502
    https://docs.python.org/2/library/ctypes.html