comparison src/GvimExt/gvimext.cpp @ 2972:bdc3335bd72e v7.3.258

updated for version 7.3.258 Problem: MS-Windows: The edit with existing vim context menu entries can be unwanted. Solution: Let a registry entry disable them. (Jerome Vuarand)
author Bram Moolenaar <bram@vim.org>
date Wed, 20 Jul 2011 17:27:25 +0200
parents b9bc9c5df131
children 37a54a85413e
comparison
equal deleted inserted replaced
2971:f3b689420c86 2972:bdc3335bd72e
584 584
585 // InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL); 585 // InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
586 586
587 // Initialize m_cntOfHWnd to 0 587 // Initialize m_cntOfHWnd to 0
588 m_cntOfHWnd = 0; 588 m_cntOfHWnd = 0;
589 // Retrieve all the vim instances 589
590 EnumWindows(EnumWindowsProc, (LPARAM)this); 590 HKEY keyhandle;
591 bool showExisting = true;
592
593 // Check whether "Edit with existing Vim" entries are disabled.
594 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
595 KEY_READ, &keyhandle) == ERROR_SUCCESS)
596 {
597 if (RegQueryValueEx(keyhandle, "DisableEditWithExisting", 0, NULL,
598 NULL, NULL) == ERROR_SUCCESS)
599 showExisting = false;
600 RegCloseKey(keyhandle);
601 }
602
603 // Retrieve all the vim instances, unless disabled.
604 if (showExisting)
605 EnumWindows(EnumWindowsProc, (LPARAM)this);
591 606
592 if (cbFiles > 1) 607 if (cbFiles > 1)
593 { 608 {
594 InsertMenu(hMenu, 609 InsertMenu(hMenu,
595 indexMenu++, 610 indexMenu++,