https://www.freepascal.org/~michael/articles/
Writing large Database applications in Delphi
Writing large Database applications in Delphi: Part 2
Large Database applications in Delphi - Part 3: Extending TForm
delphi GLibWMI MiTeC WMI Delphi Code Creator robvanderwoude wmigen
Windows Management Instrumentation
https://www.delphipraxis.net/1351685-post14.html
(* SysUtils, ActiveX, ComObj, Variants; *)
Winapi.Windows,
System.SysUtils,
Winapi.ActiveX,
System.Win.ComObj,
System.Variants;
const
WbemUser ='';
WbemPassword ='';
WbemComputer ='localhost';
wbemFlagForwardOnly = $00000020;
var
FSWbemLocator : OLEVariant;
FWMIService : OLEVariant;
FWbemObjectSet: OLEVariant;
FWbemObject : OLEVariant;
oEnum : IEnumvariant;
iValue : LongWord;
begin;
FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
FWMIService := FSWbemLocator.ConnectServer(WbemComputer, 'root\CIMV2', WbemUser, WbemPassword);
FWbemObjectSet:= FWMIService.ExecQuery('SELECT * FROM CIM_PhysicalMemory','WQL',wbemFlagForwardOnly);
oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant;
while oEnum.Next(1, FWbemObject, iValue) = 0 do
https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/WmiSdk/using-wmi.md
https://github.com/RRUZ/delphi-dev-shell-tools
https://theroadtodelphi.wordpress.com/
https://github.com/RRUZ/wmi-delphi-code-creator
https://github.com/mandiant/flare-wmi
PJConsoleApp.pas
http://delphidabbler.com/software/consoleapp.html
https://searchcode.com/codesearch/view/11776132/
/Sources/WorkstationScanning/WMI/WbemScripting_TLB.pas
03_通常使うプリンタの変更 - WMI を OleVariant 型で扱う
http://mrxray.on.coocan.jp/Delphi/plSamples/017_ChangeDefaultPrinter.htm
https://www.manning.com/books/powershell-and-wmi
https://github.com/daharper/WmiExample
https://github.com/pyscripter/Pcre-Jit-Delphi
https://www.magsys.co.uk/delphi/magwmi.asp
WMISet NTSet TMTShare
https://docs.microsoft.com/zh-tw/windows/win32/api/lmshare/nf-lmshare-netshareenum?redirectedfrom=MSDN
https://docs.microsoft.com/en-us/previous-versions//t9zt39at(v=vs.85)?redirectedfrom=MSDN
FIREFOX Mozilla firefox en Gecko runtimes delphi
Universal Component Library UWP controls
JS electron-builder
https://github.com/electron-userland/electron-builder
Delphi-EmbeddedWB
https://github.com/ghquant/Delphi-EmbeddedWB
https://sourceforge.net/projects/embeddedwb/
How to call Delphi code from scripts running in a TWebBrowser
http://www.delphidabbler.com/articles/article-22
DELPHI WEB BROWSER BASED Cross-Platform
New VCL TEdgeBrowser Component Coming RAD Studio 10.4 Microsoft Edge WebView2
BitBlt CreateCompatibleDC SelectObject CreateCompatib GetMapMode CreateCompatibleBitmap CreateDIBSection
Drawing Transparent Bitmaps
http://delphi.cjcsoft.net//viewthread.php?tid=45232
Title: Drawing Transparent Bitmaps
Question: How to draw a transparent bitmap
hdcTemp := CreateCompatibleDC(dc);
SelectObject(hdcTemp, hBmp); // Select the bitmap
GetObject(hBmp, sizeof(BITMAP), @bm);
ptSize.x := bm.bmWidth; // Get width of bitmap
ptSize.y := bm.bmHeight; // Get height of bitmap
DPtoLP(hdcTemp, ptSize, 1); // Convert from device
// to logical points
// Create some DCs to hold temporary data.
hdcBack := CreateCompatibleDC(dc);
hdcObject := CreateCompatibleDC(dc);
hdcMem := CreateCompatibleDC(dc);
hdcSave := CreateCompatibleDC(dc);
// Create a bitmap for each DC. DCs are required for a number of
// GDI functions.
// Monochrome DC
bmAndBack := CreateBitmap(ptSize.x, ptSize.y, 1, 1, nil);
// Monochrome DC
bmAndObject := CreateBitmap(ptSize.x, ptSize.y, 1, 1, nil);
bmAndMem := CreateCompatibleBitmap(dc, ptSize.x, ptSize.y);
bmSave := CreateCompatibleBitmap(dc, ptSize.x, ptSize.y);
// Each DC must select a bitmap object to store pixel data.
bmBackOld := SelectObject(hdcBack, bmAndBack);
bmObjectOld := SelectObject(hdcObject, bmAndObject);
bmMemOld := SelectObject(hdcMem, bmAndMem);
bmSaveOld := SelectObject(hdcSave, bmSave);
// Set proper mapping mode.
SetMapMode(hdcTemp, GetMapMode(dc));
https://programmerall.com/article/6686314819/
Add('SRCCOPY ');
Add('SRCPAINT ');
Add('SRCAND ');
Add('SRCINVERT ');
Add('SRCERASE ');
Add('NOTSRCCOPY ');
Add('NOTSRCERASE');
Add('MERGECOPY ');
Add('MERGEPAINT ');
Add('PATCOPY ');
Add('PATPAINT ');
Add('PATINVERT ');
Add('DSTINVERT ');
Add('BLACKNESS ');
Add('WHITENESS ');
delphi DIB embarcadero delphi graphics TBitmap Vcl.Graphics.GetDIB Device Independent Bitmaps
https://docs.microsoft.com/zh-tw/windows/win32/gdi/capturing-an-image
http://blog.livedoor.jp/junki560/archives/21910595.html
delphi Navigation Sidebar LIST MENU
Show and Hide Transient Content in Your VCL UI Using TSplitView and C++Builder
TSplitView TCategoryButtons TButtonCategory TButtonItem
TCategoryPanelGroup TCategoryPanel TCategoryButtons
TActionMainMenuBar
JVCL's TJvNavigationPane TJvOutlookBar TJvNavigationPane
TreeViewToMenu
TSearchBox
TSplitView
TDockTabSet
TFlowPanel
TControlList
MS Ribbon Control ActionManager
TreeControl Virtual Treeview VirtualTrees STYLE
https://docs.microsoft.com/en-us/windows/win32/controls/tree-view-controls
Navigator Container
http://docplayer.net/77223250-Windows-controls-last-part.html
MVVM Delphi Architecting Building Model LiveData ViewModel
https://blog.grijjy.com/2018/01/22/mvvm-starter-kit-part-1-of-3/
MVVM Starter Kit (Part 1 of 3)
https://github.com/grijjy/GrijjyFoundation
https://github.com/grijjy/MvvmStarterKit
https://www.youtube.com/watch?v=Ci1HP8ZBJxk&ab_channel=EmbarcaderoTechnologies
http://www.malcolmgroves.com/blog/?p=1340
https://bitbucket.org/sglienke/dsharp/src/master/
https://blog.grijjy.com/2018/01/24/mvvm-starter-kit-part-2-of-3/
Direct3D9.pas DirectInput.pas
DirectDraw.pas
DirectSound
DirectMusic, D2D1.pas
JEDI_Code_Library
Windows Media Format 9 API (WMF9.pas) Prodigy Math Game
Wincodec.pas (podpora TWICImage a tím i třeba Tiff, CR2 a NEF grafické formáty)
cor.pas (.NET unmanaged compiler API - cor.h)
OpenGL.pas
Manipulations.pas - Manipulation SDK
rtti.pas - nové Run Time Type Information
IOUtils.pas - OOP přístup k souborům
Diagnostics.pas - TStopWatch (někdy příště)
"RAD Studio\7.0\source\Win32\vcl\":
Direct2D.pas Direct2D API z Windows 7 (Vista), tj. TDirect2DCanvas
Gestures.pas, GestureMgr.pas, GestureCtrls.pas - Gestures
Keyboard.pas, KeyboardTypes.pas - Klávesnice pro touch
https://delphi.cz/2010/02/default.aspx
https://windwings.wordpress.com/2009/08/13/rad-studio-2010-review-8-and-now-some-feedback-from-us/
https://delphi.cz/post/Graphics32-GR32.aspx
WinAnimationManager: Grid Layout
IUIAnimationManager ID2D1Bitmap IUIAnimationVariable
http://teran.karelia.pro/articles/item_4425.html
IUIAnimationManager ID2D1Bitmap IUIAnimationVariable Win Animation Manager
https://docs.microsoft.com/en-us/windows/win32/uianimation/-main-portal
https://fireblazefmx.wordpress.com/
http://www.bilsen.com/windowsanimation/
https://castle-engine.io/wp/2019/01/02/spritesheet-gui-utility/
https://github.com/valterb/spritesheet-utility
https://www.bverhue.nl/delphisvg/author/bverhue/
https://castle-engine.io/wp/
1) Delphi has no support for any Excel natively. It is all done with hands-tuned OCX import, and you can make your own import any time you need it!
Delphi Menu: Component / Import COmpionent / Type Library / excel.exe
2) but if you talk about Delphi XE2 it containsthat hand-tuned c:\RAD Studio\9.0\OCX\Servers\pas2010\Excel2010.pas for you
And thus Delphi has 3 design-time packages for you:
2010160.bpl2K160.bplxp160.bplhttps://winsoft.sk/officecs.htm
https://sourceforge.net/directory/?q=delphi%20excel%20components
https://torry.net/pages.php?id=551
https://edn.embarcadero.com/article/40813
https://delphi.fandom.com/wiki/3rd_Party_Components
https://github.com/sergio-hcsoft/Delphi-SpreadSheets
https://github.com/shukomiya/skregexp
shukomiya/skregexp: Regex library for Delphi 2005 later
https://github.com › shukomiya › skregexp
Regex library for Delphi 2005 later. Contribute to shukomiya/skregexp development by creating an account on GitHub.
"Delphi 2005 以降で利用可能な SkRegExp (小宮さん作 SkRegExp
https://ht-deko.com/tech053.html#DFMCONV
Delphi XE から標準搭載された TPerlRegEx
VBScript の TRegExp (正規表現クラス) の練習ツールです。
http://mrxray.on.coocan.jp/Delphi/plXLSOut/index.htm
Excel 出力コンポーネント
Excel Creator Ver3.0 ( アドバンスソフトウェア製 )
ExcelCreator Ver3.0 は,ExcelCreator 2007 に収録されている製品
http://mrxray.on.coocan.jp/Delphi/plExcelEx/index.htm
エクセル操作フォームEx
Microsoft Office Document Imaging (MODI) OCR
regsvr32.exe mdivwctl.dll,
MDIVWCTL.DLL is part of MS office 2003.
OCR MODI Library (MDIVWCTL.DLL) is freely available
regsvr32.exe "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\mdivwctl.dll"
OFFICE2007 Files\Common Files\Microsoft Shared\MODI\12.0 MDIVWCTL.dll
C:\Program Files\Common Files\Microsoft Shared\MODI\11.0, 21MB
Install MODI for use with Microsoft Office
https://support.microsoft.com/en-us/topic/install-modi-for-use-with-microsoft-office-2010-4fbd3076-6d01-9cb7-c574-3bbabc9eead9
Microsoft Office Document Imaging 11.0 Type Library
CreateObject("MODI.Document")
miDoc.Images(0).OCR miLANG_CHINESE_SIMPLIFIED, True, True '
strLayoutInfo = _
"Language: " & modiLayout.Language & vbCrLf & _
"Number of characters: " & modiLayout.NumChars & vbCrLf & _
"Number of fonts: " & modiLayout.NumFonts & vbCrLf & _
"Number of words: " & modiLayout.NumWords & vbCrLf & _
"Beginning of text: " & Left(modiLayout.Text, 50) & vbCrLf & _
"First word of text: " & modiLayout.Words(0).Text
MsgBox strLayoutInfo, vbInformation + vbOKOnly, "Layout Information"
Set modiLayout = Nothing
Set miDoc = Nothing
uses ...
ComObj, MODI_TLB
doc := CreateOleObject('MODI.Document') as IDocument;
CoCreateInstance(CLASS_Document,
NIL,
CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER,
IDocument,
doc);
Var
doc :IDocument;
Img :IImage;
Layout :ILayout;
begin
doc := IDispatch(CreateOleObject('MODI.Document')) as IDocument;
doc.create(FileName); // just put here the filename of an image
doc.OCR(miLANG_ENGLISH,true,true);
Img := IDispatch(doc.Images[0]) as IImage;
Layout := IDispatch(Img.Layout) as ILayout;
Memo1.Lines.Add(Layout.Text);
MiDocView1.Document := doc;
doc.Close(false);
Img := nil;
Layout := nil;
Screen.MousePointer = vbDefault
https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2003/aa202819(v=office.11)
try
if CoCreateInstance(CLASS_Document,
NIL,
CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER,
IDocument,
fMODIdoc)<>S_OK then
begin
Application.MessageBox(sNoMODIDocIntf,sMODI,MB_OK+MB_ICONSTOP);
Exit;
end;
fMODIdoc.Create(WideString(ImgName));
try
if ( xxxxx ) then LangID:=miLANG_HUNGARIAN else LangID:=miLANG_ENGLISH;
(fMODIdoc.Images[0] as IImage).OCR(LangID,FALSE,FALSE);
for i:=0 to (fMODIdoc.Images[0] as IImage).Layout.Words.Count-1 do
begin
aWord:=(fMODIdoc.Images[0] as IImage).Layout.Words[i] as IWord;
nRects:=aWord.Rects;
for j:=0 to nRects.Count-1 do
begin
aRect:=nRects.Item[j] as IMiRect;
if (p.X>=aRect.Left) and
(p.X<=aRect.Right) and
(p.Y>=aRect.Top) and
(p.Y<=aRect.Bottom) then
begin
Result:=aWord.Text;
Exit;
end;
end;
end;
finally
fMODIdoc.Close(FALSE);
end;
except
end;
var
modi: olevariant;
fname: TFileName; //MDIVWCTL.DLL http://www.microsoft.com/ru-ru/download/confirmation.aspx?id=21581
i: integer;
s: string;
begin
fname:= '1.tif';
modi:= CreateOLEObject('MODI.Document');
modi.Create(fname);
modi.OCR();
s:= '';
for i:= 0 To modi.Images.Count - 1 do
s:= s+ modi.Images(i).Layout.Text;
showmessage(s);
//showmessage(modi.images.item(0).layout.text);
modi.close;
modi:= UnAssigned;
end;
https://social.msdn.microsoft.com/Forums/en-US/29093b50-1f09-4b5e-9f41-c0f4a540852f/using-modi-microsoft-office-document-imaging-how-to-get-images-and-table-in-text-file?forum=worddev
using MODI (Microsoft Office Document Imaging) how to get images and table in text file
MODI and OpenXML SDK
http://www.codeproject.com/KB/office/OCRSampleApplication.aspx
&
This sample project demonstrates how to export, delete and replace the images in a document by using Open XML SDK
http://code.msdn.microsoft.com/CSManipulateImagesInWordDoc-312da7ef
I hope this helps.
https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2003/aa167607(v=office.11)?redirectedfrom=MSDN
Using the Microsoft Office Document Imaging 2003 Object Model
| // CCMD_OCRView.cpp : implementation of the CCCMD_OCRView class |
// CCMD_OCRView.cpp : implementation of the CCCMD_OCRView class
//
#include "stdafx.h"
#include "CCMD_OCR.h"
#include "CCMD_OCRDoc.h"
#include "CCMD_OCRView.h"
#include "../class/global.h"//
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "mdivwctl.h"
enum MiLANGUAGES
{ miLANG_CHINESE_SIMPLIFIED = 2052,
miLANG_CHINESE_TRADITIONAL = 1028,
miLANG_CZECH = 5,
miLANG_DANISH = 6,
miLANG_DUTCH = 19,
miLANG_ENGLISH = 9,
miLANG_FINNISH = 11,
miLANG_FRENCH = 12,
miLANG_GERMAN = 7,
miLANG_GREEK = 8,
miLANG_HUNGARIAN = 14,
miLANG_ITALIAN = 16,
miLANG_JAPANESE = 17,
miLANG_KOREAN = 18,
miLANG_NORWEGIAN = 20,
miLANG_POLISH = 21,
miLANG_PORTUGUESE = 22,
miLANG_RUSSIAN = 25,
miLANG_SPANISH = 10,
miLANG_SWEDISH = 29,
miLANG_SYSDEFAULT = 2048,
miLANG_TURKISH = 31
};
enum MiFILE_FORMAT
{ miFILE_FORMAT_DEFAULTVALUE = -1,
miFILE_FORMAT_TIFF = 1,
miFILE_FORMAT_TIFF_LOSSLESS = 2,
miFILE_FORMAT_MDI = 4
};
enum MiCOMP_LEVEL
{ miCOMP_LEVEL_LOW = 0,
miCOMP_LEVEL_MEDIUM = 1,
miCOMP_LEVEL_HIGH = 2
};
/////////////////////////////////////////////////////////////////////////////
// CCCMD_OCRView
IMPLEMENT_DYNCREATE(CCCMD_OCRView, CFormView)
BEGIN_MESSAGE_MAP(CCCMD_OCRView, CFormView)
//{{AFX_MSG_MAP(CCCMD_OCRView)
ON_WM_PAINT()
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
interface
type
TNodeFunction = function(AInput: String): String;
implementation
function Func1(AInput: String): String;
begin
result := AInput;
end;
function Func2(AInput: String): String;
begin
result := 'Fooled You';
end;
function Func3(AInput: String): String;
begin
result := UpperCase(AInput);
end;
procedure Demonstration;
var
SomeFunc, SomeOtherFunc: TNodeFunction;
begin
SomeOtherFunc = Func3;
SomeFunc := Func1;
SomeFunc('Hello'); // returns 'Hello'
SomeFunc := Func2;
SomeFunc('Hello'); // returns 'Fooled You'
SomeOtherFunc('lower case'); // returns 'LOWER CASE'
end;
JclDebug.pas
function FileByLevel(const Level: Integer = 0): string;
function ModuleByLevel(const Level: Integer = 0): string;
function ProcByLevel(const Level: Integer = 0): string;
function LineByLevel(const Level: Integer = 0): Integer;
uses System.Classes, System.SysUtils, System.Rtti;
procedure GetEIP(); stdcall;
function GetCurrentFuncName(const frm: TObject): string;
implementation
var
g_CurrentFuncEIP: NativeUInt;
procedure GetEIP(); stdcall;
asm
{$IFDEF WIN32}
POP EAX;
MOV g_CurrentFuncEIP,EAX;
PUSH EAX;
{$ELSE}
POP RAX;
MOV g_CurrentFuncEIP,RAX;
PUSH RAX;
{$ENDIF}
end;
function cmpint(List: TStringList; Index1, Index2: Integer): Integer;
begin
Index1 := StrToIntDef(List[Index1], 0);
Index2 := StrToIntDef(List[Index2], 0);
Result := Index1 - Index2;
end;
function CheckEIP(const intEIP: Cardinal; const frm: TObject): string;
type
PMethodInfo = ^TMethodInfo;
TMethodInfo = record
strAddress: ShortString;
strFunName: ShortString;
end;
var
rc : TRttiContext;
rt : TRttiType;
rm : TRttiMethod;
sl : TStringList;
pmi : PMethodInfo;
intIndex: Integer;
III : Integer;
begin
rc := TRttiContext.Create;
sl := TStringList.Create;
try
sl.Sorted := False;
rt := rc.GetType(frm.ClassInfo);
for rm in rt.GetMethods do
begin
pmi := AllocMem(SizeOf(TMethodInfo));
pmi^.strAddress := ShortString(Format('%d', [Cardinal(rm.CodeAddress)]));
pmi^.strFunName := ShortString(Format('%s', [rm.ToString]));
sl.AddObject(String(pmi.strAddress), TObject(pmi));
end;
{ 加到列表中 }
sl.Append(IntToStr(intEIP));
{ 按整數排序 }
sl.CustomSort(cmpint);
{ 檢索剛加入的在什麼位置 }
intIndex := sl.IndexOf(IntToStr(intEIP));
{ 返回函式名稱 }
if intIndex = 0 then
Result := string(PMethodInfo(sl.Objects[intIndex 1])^.strFunName)
else
Result := string(PMethodInfo(sl.Objects[intIndex - 1])^.strFunName);
{ 釋放記憶體 }
for III := 0 to sl.Count - 1 do
begin
FreeMem(PMethodInfo(sl.Objects[III]));
end;
finally
sl.Free;
rc.Free;
end;
end;
function GetCurrentFuncName(const frm: TObject): string;
begin
Result := CheckEIP(g_CurrentFuncEIP, frm);
end;
end.呼叫方法:
uses untGetFuncName;
procedure TForm1.btn1Click(Sender: TObject);
begin
GetEIP;
btn1.Caption := GetCurrentFuncName(Self);
end;
https://capecodgunny.blogspot.com/2013/07/complete-list-of-delphi-code-examples.html
function MessageBoxTimeOut(
hWnd: HWND; lpText: PChar; lpCaption: PChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
function MessageBoxTimeOutA(
hWnd: HWND; lpText: PChar; lpCaption: PChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
function MessageBoxTimeOutW(
hWnd: HWND; lpText: PWideChar; lpCaption: PWideChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
implementation
// this const is not defined in Windows.pas
const
MB_TIMEDOUT = 32000;
function MessageBoxTimeOut; externaluser32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutA; external user32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutW; external user32 name 'MessageBoxTimeoutW';
var
iResult: Integer;
iFlags: Integer;
begin
// Define a MessagBox with an OK button and a timeout of 2 seconds
iFlags := MB_OK or MB_SETFOREGROUND or MB_SYSTEMMODAL or MB_ICONINFORMATION;
iResult := MessageBoxTimeout(
Application.Handle,
'Test a timeout of 2 seconds.',
'MessageBoxTimeout Test', iFlags, 0, 2000);
// iResult will = 1 (IDOK)
ShowMessage(IntToStr(iRet));
// Define a MessageBox with a Yes and No button and a timeout of 5 seconds
iFlags := MB_YESNO or MB_SETFOREGROUND or MB_SYSTEMMODAL or MB_ICONINFORMATION;
iResult := MessageBoxTimeout(
Application.Handle,
'Test a timeout of 5 seconds.',
'MessageBoxTimeout Test', iFlags, 0, 5000);
// iResult = MB_TIMEDOUT if no buttons clicked, otherwise
// iResult will return the value of the button clicked
case iResult of
IDYES: // Pressed Yes button
ShowMessage('Yes');
IDNO: // Pressed the No button
ShowMessage('No');
MB_TIMEDOUT: // MessageBox timed out
ShowMessage('TimedOut');
end;
end;