Jump to content

Martin Wienold

Members
  • Content Count

    14
  • Joined

  • Last visited

  • Days Won

    1

Martin Wienold last won the day on June 5 2019

Martin Wienold had the most liked content!

Community Reputation

16 Good

Technical Information

  • Delphi-Version
    Delphi 10.1 Berlin

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Martin Wienold

    Is this deliberate?

    That looks like GNU Gettext to me,
  2. Martin Wienold

    Your RAD Studio 10.4 Sydney issues

    This thread should not be used to report your errors but only to post links to the Quality Portal for issues you want others to be aware of.
  3. This is more an FYI, instead of hardcasting a Pointer, you could use Variant Parts in Records to get the illusion of typesafety.
  4. Or you could just have a scheduled task call shutdown on weekends.
  5. You could check your BIOS if it supports timed power on events. I did setup my computer at work to wake up on a workday at a specific time, which is just fine for my workflow. Only downside is, on a vacation day I have to remote in to shut it down again.
  6. Martin Wienold

    Best practices for handling a Stalled thread

    The difference is that terminating a process does not affect your current process from which you are calling the termination. Terminating a thread has the posibility to do just that, it may corrupt the process memory you are running it in. (This heavily depends on what is going on in the thread you are terminating and your gues is as good as mine) As this thread asked for best practice for what to do with a stalled thread: Do nothing, let it finish or try to build in a way for it to eventually finish without terminating it. If this is not a possibility and you just have to have a way to end it forcefully, let it run in a different process, isolated from your own.
  7. Martin Wienold

    Best practices for handling a Stalled thread

    Do not terminate a Thread as it may lead to all kind of strange behaviour. MSDN: TerminateThread function You could explore refactoring the logic of your thread into a small exe and call this instead, if this one stalls you can terminate its process.
  8. Martin Wienold

    Good design for "file was just saved" message

    You can design a more native looking dialog using TTaskDialog. Here is an short example and a few more tweaks can be found here Inofficial TTaskDialog Documentation, Andreas Rejbrand, 2011-02-13 with TTaskDialog.Create(Self) do try Caption := 'File info'; Title := 'File created'; Text := 'c:\temp\Projections_Q3.csv'; VerificationText := 'Do not show message when creating files'; MainIcon := tdiInformation; CommonButtons := [tcbClose]; DefaultButton := tcbClose; with Buttons.Add() as TTaskDialogButtonItem do begin Caption := 'Open file'; ModalResult := 1000; end; with Buttons.Add() as TTaskDialogButtonItem do begin Caption := 'Locate file'; ModalResult := 1001; end; if Execute then case ModalResult of 1000: ShowMessage('Open file'); 1001: ShowMessage('Locate file'); else ShowMessage('Cancel'); end; finally Free; end;
  9. Indy Callbacks are declared with of object modifier, that means you have to have a method in an object and not a standalone procedure. TCallback1 = procedure (const Arg1: Integer); TCallback2 = procedure (const Arg1: Integer) of object; TCallback3 = reference to procedure (const Arg1: Integer); TCallback1 is used with standalone procedures. TCallback2 is used with methods from objects. TCallback3 can be used with anonymous methods.
  10. Martin Wienold

    Version Control System

    I'm using Git Extensions as a GUI at work, in Version 2.x though as the 3.0 is rather new and I like to wait at least one minor version.
  11. The difference is allocting memory for a new string. Calling SetLength or Delete will try to reuse the existing memory for the string if it is possible (ie. not shared with another place). I think string.Join or TrimEnd will always create a new string, allocating memory.
  12. I don't have a compiler at hand, I can't check for errors but this should work: var s: string; begin s := 'Hello World'; Writeln(s); Delete(s, Length(s), 1); Writeln(s); Readln; end;
  13. Martin Wienold

    Block windows access

    For what it's worth, limiting Keyboard and Mouse input can be done by using low level keyboard and mouse hooks. Beware that debugging these kind of projects can be quite .. interesting as you have your keyboard and mouse hooked and therefore - depending on your application logic - blocked. Basically you have to have a host application and a library. The host application loads the library which implements the hooks you defined. For more information look here: LowLevelKeyboardProc callback function LowLevelMouseProc callback function ⚠️ CTRL+ALT+DEL can't be hooked/blocked, maybe Kiosk mode is realy what you need.
×