cdrapi.cpp 641 B

123456789101112131415161718192021222324252627
  1. #include <windows.h>
  2. #include "cdrapi.h"
  3. void BeginOpt(corel *cdr)
  4. {
  5. auto name = _bstr_t("Undo");
  6. cdr->EventsEnabled = false;
  7. cdr->ActiveDocument->BeginCommandGroup(name);
  8. cdr->ActiveDocument->Unit = cdrMillimeter;
  9. cdr->Optimization = true;
  10. }
  11. void EndOpt(corel *cdr)
  12. {
  13. cdr->EventsEnabled = true;
  14. cdr->Optimization = false;
  15. cdr->EventsEnabled = true;
  16. cdr->ActiveDocument->ReferencePoint = cdrBottomLeft;
  17. cdr->Application->Refresh();
  18. cdr->ActiveDocument->EndCommandGroup();
  19. }
  20. void Active_CorelWindows(HWND hDlg)
  21. {
  22. // 将焦点返回到父窗口 关闭对话框窗口
  23. SetFocus(GetParent(hDlg));
  24. }