tw14553.pp 878 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. { %target=win32,win64 }
  2. unit tw14553;
  3. {$mode objfpc}{$H+}
  4. interface
  5. uses
  6. Classes, SysUtils, ComObj, Variants;
  7. Procedure MI_Connect(H1,H2,H3:String);
  8. Procedure MI_Disconnect;
  9. Var MI1Open,MI2Open,MI3Open:Boolean;
  10. MI1,MI2,MI3:Variant;
  11. implementation
  12. Procedure MI_Connect(H1,H2,H3:String);
  13. Begin
  14. MI1:=CreateOleObject('MapInfo.Application');
  15. MI2:=CreateOleObject('MapInfo.Application');
  16. MI3:=CreateOleObject('MapInfo.Application');
  17. MI1.&do('Set Application Window '+H1);
  18. MI2.&do('Set Application Window '+H2);
  19. MI3.&do('Set Application Window '+H3);
  20. MI1.&do('Set Next Document Parent '+H1+' Style 1');
  21. MI2.&do('Set Next Document Parent '+H2+' Style 1');
  22. MI3.&do('Set Next Document Parent '+H3+' Style 1');
  23. MI1Open:=False;
  24. MI2Open:=False;
  25. MI3Open:=False;
  26. End;
  27. Procedure MI_Disconnect;
  28. Begin
  29. MI1:=UnAssigned;
  30. MI2:=UnAssigned;
  31. MI3:=UnAssigned;
  32. End;
  33. end.