Forum > Operating Systems

How To Form OnNotifyEvent TMessage Parse For Change Directory and Files

(1/1)

samurat2000:
procedure TForm1.OnNotifyEvent(var AMessage: TMessage);
begin
   ....
   ....
end;

In above code, how to TMessage parse to detail change directory and files.

ASerge:
You mean cross-platform behavior like Windows.FindFirstChangeNotification?

samurat2000:
http://stackoverflow.com/questions/31168116/how-to-get-notified-when-disk-free-space-changes

In this link code below.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit Unit1; interface uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, ShlObj, ActiveX; const   SHCNRF_INTERRUPTLEVEL     = $0001;  SHCNRF_SHELLLEVEL         = $0002;  SHCNRF_RECURSIVEINTERRUPT = $1000;  SHCNRF_NEWDELIVERY        = $8000; type  TSHChangeNotifyEntry = record    pidl: PItemIdList;    fRecursive: BOOL;  end;   TForm1 = class(TForm)    procedure FormCreate(Sender: TObject);    procedure FormDestroy(Sender: TObject);  private    procedure OnNotifyEvent(var AMessage:TMessage); message WM_USER;  end; var  Form1: TForm1;  Hand: THandle; function SHChangeNotifyRegister(OwnerHwnd:HWND; fSources:Integer; fEvents:DWord; wMsg:UINT;         cEntries:Integer; var pshcne:TSHChangeNotifyEntry):ULONG; stdcall; external 'shell32.dll'; function SHChangeNotifyDeregister(ulID:ULONG):BOOL; stdcall; external 'shell32.dll'; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject);var Desktop:IShellFolder;    pidl:PItemIdList;    Path:String;    Eaten,attr,Events,Sources:DWord;    cnPIDL:TSHChangeNotifyEntry;begin if Succeeded(SHGetDesktopFolder(Desktop)) then begin  Path:='D:\Test';  if Succeeded(Desktop.ParseDisplayName(0, nil, PWideChar(Path), Eaten, pidl, attr)) then begin   Caption:=Path;   cnPIDL.pidl:=pidl;   cnPIDL.fRecursive:=true;   Sources:=SHCNRF_INTERRUPTLEVEL or SHCNRF_SHELLLEVEL or SHCNRF_NEWDELIVERY or SHCNRF_RECURSIVEINTERRUPT;   Events:=SHCNE_FREESPACE;   Hand:=SHChangeNotifyRegister(Handle, Sources, Events, WM_USER, 1, cnPIDL);;   CoTaskMemFree(pidl);  end; end;end; procedure TForm1.FormDestroy(Sender: TObject);begin SHChangeNotifyDeregister(Hand);end; procedure TForm1.OnNotifyEvent(var AMessage: TMessage);begin if AMessage.Msg = WM_USER then Caption:=Caption+' x';end; end. 
This procedure;

procedure TForm1.OnNotifyEvent(var AMessage: TMessage);
begin
 if AMessage.Msg = WM_USER then Caption:=Caption+' x';
end;

How to AMessage parse for change detail (folder change detail, file change detil ? which file (full path) and which change?


--- Code: SQL  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----- phpMyAdmin SQL Dump-- version 5.1.4-- https://www.phpmyadmin.net/---- Host: klienci.home.pl-- Czas generowania: 09 Lut 2020, 16:21-- Wersja serwera: 10.6.15-db-log-- Wersja PHP: 8.0.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";START TRANSACTION;SET time_zone = "+00:00";  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;/*!40101 SET NAMES utf8mb4 */; ---- Baza danych: `zdrowo_katalog`-- -- -------------------------------------------------------- ---- Struktura tabeli dla tabeli `klienci`-- CREATE TABLE `klienci` (  `id` INT(11) NOT NULL,  `nazwa` VARCHAR(255) NOT NULL DEFAULT '',  `adres` VARCHAR(255) NOT NULL DEFAULT '0',  `telefon` INT(16) NOT NULL DEFAULT 0,  `email` VARCHAR(255) NOT NULL,  `NIP` BIGINT(32) DEFAULT NULL,  `PESEL` BIGINT(32) DEFAULT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin2 COLLATE=latin2_general_ci; ---- Zrzut danych tabeli `klienci`-- INSERT INTO `klienci` (`id`, `nazwa`, `adres`, `telefon`, `email`, `NIP`, `PESEL`) VALUES(1, 'Tomasz Stroik', 'Orląt Lwowskich 2a, 53-605 Wrocław', 713724731, 'tomasz.stroik@prominet.wroc.pl', 8991125007, 11071699130),(2, 'Małgorzata Piekielniak ', 'Gubińska 6/15, 54-434 Wrocław', 713741521, '', 0, 60020204769),(3, 'Zbigniew Matusiak', 'ul. Zemska 9/25, 54438 Wrocław', 604396390, 'zbig56@poczta.onet.pl', 0, 60020202231),(4, 'Jakub Janas', 'ul Baczyńskiego 7, 58- 500 Jelenia Góra', 713221936, 'jakub_vilbana@poczta.onet.pl', 0, 83042704596),(5, 'Przemysław Trzewiczek ', 'ul Babiego lata 13A/3A, 53-026 Wrocław', 601159066, 'jozef1210@gmail.com', 0, 79101200197),(6, 'Maciej Stefaniak', 'Ujejskiego 29/1, 51-141 Wrocław', 501408970, 'profosol@aol.com', 0, 77110307295),(7, 'Radosław Krupka  ', 'Nowy Targ 20/7, 50-143 Wrocław', 602300984, 'r.krupka@wp.pl', 0, 39072698309),(8, 'Magda Walec', 'Inżynierska 66/27 Wrocław', 713632063, 'iod@lpsa.pl', 0, 74051413672),(9, 'Władysław Kumas', 'Grabiszyńska 315/59 Wrocław', 713433123, 'szkola@airproducts.com', 0, 95070558032),(10, 'Stefan Karp', 'Grabiszyńska 10/11 Wrocław', 713725918, 'info@carpland.pl', 0, 8942546996),(11, 'Igor Łęcki', 'Bydgoska 12/4 Wrocław', 713433123, 'sklep@vikingcarpfishing.pl', 0, 73010206340),(12, 'Bolesław Bach', 'Bolesławiecka 18/20 m.9 Wrocław', 690013769, 'SERWISTV.WROCLAW@WP.PL', 0, 75062633853),(13, 'Zenon Kowalski', 'Bolesławiecka 10/29 Wrocław', 608333301, 'serwis-tv@wp.pl', 3816470846, 88030946064),(14, 'Jan Graf', 'Grabiszyńska 50, 53-504 Wrocław', 713430539, 'grawelektronik@o2.pl', 1235255217, 66071175784),(15, 'Robert Podsiadlo', 'Młyńska 2, 55-020 Węgry', 713114620, 'serwis.tvkomp@wp.pl', 8218224488, 66093077734),(16, 'Robert Podsiadło', 'Drukarska 28/1, 53-312 Wrocław', 601572738, 'rpsklep.serwislcd@gmail.com', 9141030798, 76031241295),(17, 'Tęcza Edward', 'Buska 6/22, 53-326 Wrocław', 513489175, '', 5110899702, 14052004844),(18, 'Dominika Majchrowska', 'Gajowicka 166/5a, 53-150 Wrocław', 574334579, 'szczesciewszczesciu@gmail.com', 1138999060, 50052706881),(19, 'Damian Majchrowski', 'Gajowicka 166/5a, 53-150 Wrocław', 570656897, '', 7570478021, 91102705799),(20, 'Marcin Spurtacz', 'Kwiatowa 20, 55-140 Żmigród', 663553975, 'med.korazon@gmail.com', 1223643735, 17021191936),(21, 'Tomek Komor', 'Różana 11a/10, 11-400 Wrocław', 888703196, 'k-m-r1@wp.pl', 3928443642, 18271119723),(22, 'Marek Janowski', 'Kowale ul Wieluńska 59', 713277981, 'marekj@e-systemy.com', 8389977444, 59102059171),(23, 'Monika Wiwulska', 'Kuźnicza 48/3 Wrocław', 717926673, 'swiatgosi2@gmail.com', 0, 96052301022),(24, 'Stafania Kowal', 'Krzywoustego 325/217 Wrocław', 713457643, 'iod@cte-i.pl', 0, 31070478879),(25, 'Tomasz Stroik', 'Wita Stwosza 3, 50-148 Wrocław', 605422363, 'tomasz.stroik@prominet.wroc.pl', 0, 81040227864),(26, 'Staefan Kim', 'Lelewela 1/9 Wrocław', 503995553, '', 0, 54052559999),(27, 'Helena Zybbi', 'Mielecka 12/5 Wrocław', 713382208, '', 0, 45112758661),(28, 'Roman Magielski', 'Nowy Targ 18/7 Wrocław', 713417646, '', 0, 48062067681),(29, 'Heniek Wąs', 'Obornicka 4/21 Wrocław', 503923485, 'katarzyna.talkowska-szewczyk@uwr.edu.pl', 0, 61080255935),(30, 'Izabela Wodecka', 'Powstańców Śl. 192/33 Wrocław', 713372482, '', 0, 74012640370),(31, 'Róża Wiśniewska', 'Rodzinna 10/8 Wrocław', 717158508, 'iod@wif.wroclaw.pl', 0, 28091514387),(32, 'Dariusz Tulewski', 'Rogowska 124/12 Wrocław', 71570804, '', 0, 18241782955),(33, 'Adam Maj', 'Rutkiewicz 1/8 Wrocław', 503843510, '', 0, 72090128274),(34, 'Kuba Benecki', 'Szczęśliwa 23/1 Wrocław', 508085265, '', 0, 74063009829),(35, 'Anna Besso', 'Szybowcowa 50/22 Wrocław', 501430875, 'biuro@domowanaprawatv.pl', 0, 46041751587),(36, 'Stanisław Zosiński', 'Sliczna 32/18 Wrocław', 713611771, '', 0, 66111204076),(37, 'Benedykt Widelski', 'Wejherowska 23/28 Wrocław', 609432005, '', 0, 80082788665),(38, 'Mirosław Milewski', 'Wietrzna 85, 53-024 Wrocław', 713398229, '', 0, 86031213174),(39, 'Jadwiga Stys', 'Zielińskiego 34/33 Wrocław', 713384815, '', 0, 76091271467),(40, 'Małgorzata Baranowska', 'Żelazna 78/45 Wrocław', 713381045, '', 0, 31013186023),(41, 'Ewa Helena Głos', 'Krucza 12/14 Wrocław', 793137755, '', 0, 54030205548),(42, 'Szymon Bobatów', 'ul. Wrocławska 5,  55-010 Żerniki Wrocławskie', 501484447, 'sajmonito@gmail.com', 8942546996, 84111378089),(43, 'Simon Bosz', 'ul. Wrocławska 119 a, 55-010 Radwanice', 501687087, 'hurt@mzcb.pl', 8951435061, 36102603470),(44, 'Paweł Biełous', 'ul. Świdnicka 5/12, 50-064 Wrocław', 603602690, 'bielous@o2.pl', 8971709188, 70021401096),(45, 'Artur Choynacki-Piotrowski', 'ul. Słonimskiego 14/7d 50-304 Wrocaw', 790389315, 'artur.choynackipiotrowski@viessmann.com', 0, 90051076033),(46, 'Piotr Wierzbicki', 'Siemianowicka 5/44 Wrocław', 792670706, 'wierzbp@airproducts.com', 0, 74062118553),(47, 'Wierzbicka', 'Siemianowicka 5/44 Wrocław', 603223460, '', 0, 60072329685),(48, 'Katarzyna Talkowska-Szewczyk', 'Jana Matejki 1 B/ 7, 50-333 WROCŁAW', 696013546, 'katarzyna.talkowska@vp.pl', 8982162871, 53010210554),(49, 'Susana Milla San Juan', 'Dembowskiego 40, Wrocław', 603602690, 'wrohome@wp.pl', 0, 29040688177),(50, 'Maja Lipnicka', 'Rynek 52 m 1 Wrocław', 601182836, 'majalipnicka@yahoo.com', 0, 79032103106),(51, 'Jacek Kowalski', 'ul. Karmelicka 100, 34-100 Wadowice', 501430875, 'octopus@si.pl', 5512563246, 22301386032),(52, 'Tomasz Mul', 'Inżynierska 12/3, Wrocław', 533611199, '', 0, 88010153233),(53, 'Radosław Karolczak', 'Piastów 12, Wrocław', 724510814, '', 0, 93013001131),(54, 'Marek Buba ', 'ul. Komuny Paryskiej 24-26/12, 50-451 Wrocław', 502175735, '', 0, 33082596170),(55, 'Dorota Nizińska ', 'ul Szybowcowa 16/39, 54-130 Wrocław', 505303840, 'dorota.nizinska@interia.pl', 0, 76090138343),(56, 'Magdalena de Burlet ', 'Rynek 52 m 14  Wrocław', 713550001, 'magdalena.de.burlet@gmail.com', 0, 20042518624),(57, 'Chuchla Marek ', 'Rynek 52 m 12 Wrocław', 713556955, 'urologia@mcz.pl', 0, 83010180715),(58, 'MAŁGORZATA MARIA PIEKIELNIAK', 'Rynek 52/6, 50-333 Wrocław', 600238155, 'iod@cte-i.pl', 0, 60020204769),(59, 'GRZEGORZ ADAM BORYSŁAWSKI', 'Rynek 52/8, Wrocław', 512621744, 'iod@lpsa.pl', 0, 73100808919),(60, 'JONATHAN STEFANOU', 'Rynek 52/1, Wrocław', 0, '', 0, 84030226474),(61, 'KRYSTYNA STEFANIAK', 'RYNEK 52 /2, Wrocław', 0, '', 0, 53021811045),(62, 'JAKUB KONRAD JANAS', 'Rynek 52/3, Wrocław', 0, '', 0, 83042704596),(63, 'WIOLETTA BUCZKOWSKA PAKOS', 'Rynek 52/7, Wrocław', 0, '', 0, 76042409882),(64, 'Adam Janowski', 'Inżynierska 12/3 Wrocław', 533611199, '', 0, 95030238482); ---- Indeksy dla zrzutów tabel-- ---- Indeksy dla tabeli `klienci`--ALTER TABLE `klienci`  ADD PRIMARY KEY (`id`),  ADD KEY `nazwa` (`nazwa`); ---- AUTO_INCREMENT dla zrzuconych tabel-- ---- AUTO_INCREMENT dla tabeli `klienci`--ALTER TABLE `klienci`  MODIFY `id` INT(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=103;COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 

ASerge:
See Processing non-user messages in your window in http://wiki.lazarus.freepascal.org/Win32/64_Interface

Navigation

[0] Message Index

Go to full version