Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/06/22 in all areas

  1. Anders Melander

    Lazy loading progressbar dialog

    https://bitbucket.org/anders_melander/better-translation-manager/src/master/Source/amProgress.API.pas and another, slightly older, version of the same: https://bitbucket.org/anders_melander/dwscriptstudio/src/master/Source/amProgress.pas and even a DWScript wrapper (the second & third screenshots are actually from a DWScript): https://bitbucket.org/anders_melander/dwscriptstudio/src/master/Source/ScriptRTL/amScriptModuleUserInterfaceProgress.pas Displays a non-modal form with a progress bar, a status message, and an optional cancel button. Defer the initial display of the progress form (what you call lazy loading). Default delay is 500 mS. Limit rate of progress update to minimize UI overhead. Default is max 1 update per 100 mS. Selectively pumps message queue to avoid application freeze and enable user to move/cancel progress dialog during use. Progressive or marquee mode. The current implementation uses DevExpress label and button controls but these can just be replaced with regular VCL controls without any loss of functionality. Usage: var Progress := ShowProgress('Hello world', False); Progress.EnableAbort := True; Progress.Progress(psBegin, 0, 100, 'Charging flux capacitor...'); for var i := 0 to 100 do begin Sleep(100); Progress.AdvanceProgress; end; and in Marquee mode: var Progress := ShowProgress('Hello world', False); Progress.EnableAbort := True; Progress.Marquee := True; Progress.UpdateMessage('Charging flux capacitor...'); while (not Progress.Aborted) do begin Sleep(100); Progress.AdvanceProgress; end;
  2. tinyBigGAMES

    Luna Game Toolkit

    New update. Now using SDL backend. Free and open source. Enjoy! https://github.com/tinyBigGAMES/Luna
  3. tinyBigGAMES

    Luna Game Toolkit

    Hey! Created a Facebook group for Luna Game Toolkit, my free and open-source game development library for Delphi. You've been invited to the cookout. Drop by and say hi. Will be posting daily. Hope to see you there. 🤙 https://www.facebook.com/groups/lunagametoolkit
  4. Gord P

    11.2 Patch 1 is out

    Why is it that if I didn't come to the Praxis site, I wouldn't know there was a patch? Which brings me to a point I have wanted to bring up for a while: Is https://blogs.embarcadero.com/ still the site where everyone is supposed to go to see what is going on in the Rad Studio world? There is nothing happening there for months. Nothing on 11.2 let alone a patch. Or is there some other Embarcadero site to keep on top of things?
  5. Yes, this is illustrated in the PemTool sample, on the Certificate Tools tab, select a Windows store and click Display Cert Store. This fills a TMsX509List using the LoadFromStore method, the sample displays the main information for all certificates found, but you can use the Find method to get the certificate with a specific SHA1 digest. If you want the SHA256 digest you'll have to loop checking each. Angus
  6. Run the for-loop from 1 to length.
  7. Relocate the actual work to a secondary thread. At the start of the thread's Execute method use TThread.Queue to pass a method to the main thread that creates the progress dialog. The dialog is not shown immediately, though, it just starts a timer with the delay you want. If the timer fires before the thread has completed its work, show the dialog. The dialog can the either use a timer to check for the thread's progress at intervals to update its display, or the thread can inform the dialog through Synchronized method calls of its progress. When done it can then tell the dialog to close itself, also through a Synchronized method call.
  8. Sherlock

    How to display weather data onto a sphere

    That is basic stuff, perhaps you should consider a Delphi course or reading a book.
  9. https://www.finalbuilder.com/resources/blogs/code-signing-with-usb-tokens
  10. David Heffernan

    Weird code in THttpConnection.ProcessWellKnownDir

    The old code won't stop working. It's unrealistic to expect developers to expend extra time supporting legacy compilers and systems. It's no fun doing that.
  11. Hey! We actually use the following code to get the system serial - maybe that can help: function GetSystemSerial : string; var FSWbemLocator : OLEVariant; FWMIService : OLEVariant; FWbemObjectSet: OLEVariant; FWbemObject : OLEVariant; oEnum : IEnumvariant; iValue : LongWord; begin CoInitialize(nil); try result:=''; FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator'); // ATT: we had a case, where on a Win2016 server, the system service failed to // execute this command. Changing the service to a local user solved the problem. // There has been 2 cases where the WMI service was corrupted or was not running. // -> to check: enter WmiMgmt.msc in the console and right click on the local wmi - control -> Properties // if an error occurs the repository seems to be corrupt // one time it helped to reset and rebuild the repository: // https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-rebuilding-the-wmi-repository/ba-p/373846 try FWMIService := FSWbemLocator.ConnectServer('localhost', 'root\CIMV2', '', ''); except on e : Exception do begin OutputDebugString(PChar('WMI service not properly running: '+e.Message+#13#10+ 'https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmi-rebuilding-the-wmi-repository/ba-p/373846')); raise; end; end; // todo: if we still support winxp this wmi class is not supported?!? FWbemObjectSet:= FWMIService.ExecQuery('SELECT UUID FROM Win32_ComputerSystemProduct','WQL',$00000020 {wbemFlagForwardOnly}); oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant; if oEnum.Next(1, FWbemObject, iValue) = 0 then result:=String(FWbemObject.UUID); finally CoUninitialize; end; end; There is also another place where you could get some unique id: // from http://www.nextofwindows.com/the-best-way-to-uniquely-identify-a-windows-machine with OpenHKLMReadOnly('SOFTWARE\Microsoft\Cryptography', True) do begin AktMachineGuid:=ReadString('', 'MachineGuid', ''); Log('Machine guid: ' + AktMachineGuid); Free; end; hope that helps! kind regards Mike
×