Tom F 83 Posted June 29, 2022 I've been using the freeware Cromis.DirectoryWatch for many years. I recently grabbed a much more recent version (from 2018) from here: https://github.com/CPsoftBE/BackupOfCromis. And reworked my code to use it on Windows 10, Delphi 11.2. It works great, except when I hit CTRL-ALT-DEL, when I get the range error shown below. I confess to being a total "script kiddie" when it comes to this kind of deep OS code. It appears the "if Assigned()"-code block is only done when a user enters CTRL-ALT-DEL. Perhaps this error deliberately caused by Microsoft when someone does CTRL-ALT-DELETE? I don't want to just ignore this problem, but don't have any idea how to safely fix it. Any suggestions? Share this post Link to post
Stefan Glienke 2002 Posted June 29, 2022 The WParam of TMessage is ultimately of type NativeUInt while the WParam parameter is of type Longint. Since Delphi 11 the default Debug config has Range and Overflow checks enabled which causes any signed to unsigned or vice versa assignment to possibly raise a range check error. Strictly speaking any assignment of signed to unsigned and vice versa is a potential defect - you can reveal them by turning W1071 on with {$WARN IMPLICIT_INTEGER_CAST_LOSS ON} 1 Share this post Link to post
Fr0sT.Brutal 900 Posted June 30, 2022 Change arg declaration to WParam: WPARAM; LParam: LPARAM; 1 Share this post Link to post