Advertisement
TLama

Untitled

Sep 12th, 2014
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.55 KB | None | 0 0
  1. // note, that PrevCaption and CurrCaption must not be local variables in this scope
  2. PrevCaption := CurrCaption;
  3. CurrCaption := GetWinCaption;
  4.  
  5. if CurrCaption <> PrevCaption then
  6.   ShowMessage('changed')
  7. else
  8.   ShowMessage('not changed');
  9.  
  10. // or better have just one "global" variable holding the last caption
  11. var
  12.   LastCaption: string;
  13.  
  14. procedure UpdateCaption;
  15. var
  16.   S: string;
  17. begin
  18.   S := GetWinCaption;
  19.  
  20.   if S <> LastCaption then
  21.   begin
  22.     LastCaption := S;
  23.     ShowMessage('changed');
  24.   end
  25.   else
  26.     ShowMessage('not changed');
  27. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement