def METHOD_NAME(self, action):
    from ctypes import WINFUNCTYPE, windll
    from ctypes.wintypes import BOOL, DWORD
    kernel32 = windll.LoadLibrary('kernel32')
    # <http://msdn.microsoft.com/en-us/library/ms686016.aspx>
    PHANDLER_ROUTINE = WINFUNCTYPE(BOOL, DWORD)
    SetConsoleCtrlHandler = (
        self._SetConsoleCtrlHandler
    ) = kernel32.SetConsoleCtrlHandler
    SetConsoleCtrlHandler.argtypes = (PHANDLER_ROUTINE, BOOL)
    SetConsoleCtrlHandler.restype = BOOL
    if action is None:
        action = lambda: None
    self.action = action
    @PHANDLER_ROUTINE
    def handle(event):
        if event == 0:  # CTRL_C_EVENT
            action()
            # Typical C implementations would return 1 to indicate that
            # the event was processed and other control handlers in the
            # stack should not be executed.  However, that would
            # prevent the Python interpreter's handler from translating
            # CTRL-C to a `KeyboardInterrupt` exception, so we pretend
            # that we didn't handle it.
        return 0
    self.handle = handle