Browse Source

FIX: Bug [0000811] "Random annoying access violation messages, prompts for exit or ignore (attached err)"

Alexander Koblov 11 years ago
parent
commit
a1df9245ec
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/platform/win/uTotalCommander.pas

+ 12 - 1
src/platform/win/uTotalCommander.pas

@@ -3,7 +3,7 @@
     -------------------------------------------------------------------------
     -------------------------------------------------------------------------
     Creates Total Commander fake window (some plugins don't work without it)
     Creates Total Commander fake window (some plugins don't work without it)
 
 
-    Copyright (C) 2009  Koblov Alexander (A[email protected])
+    Copyright (C) 2009-2014 Alexander Koblov (a[email protected])
 
 
     This program is free software; you can redistribute it and/or modify
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     it under the terms of the GNU General Public License as published by
@@ -35,6 +35,9 @@ procedure CreateTotalCommanderWindow(hWindow: HWND);
 
 
 implementation
 implementation
 
 
+uses
+  LCLVersion, Forms, JwaDbt, uDebug;
+
 var
 var
   wcFakeWndClass: TWndClassEx;
   wcFakeWndClass: TWndClassEx;
   //hMainWindow,
   //hMainWindow,
@@ -57,6 +60,14 @@ begin
   }
   }
   //SendMessage(hMainWindow, uiMsg, wParam, lParam);
   //SendMessage(hMainWindow, uiMsg, wParam, lParam);
 
 
+  {$IF (lcl_fullversion >= 1020000)}
+  if (uiMsg = WM_DEVICECHANGE) and (wParam = DBT_DEVNODES_CHANGED) and (lParam = 0) then
+  begin
+    Screen.UpdateMonitors; // Refresh monitor list
+    DCDebug('WM_DEVICECHANGE:DBT_DEVNODES_CHANGED');
+  end;
+  {$ENDIF}
+
   {$IFDEF DEBUG}
   {$IFDEF DEBUG}
   WriteLn(uiMsg);
   WriteLn(uiMsg);
   {$ENDIF}
   {$ENDIF}