def return_enum
      lambda do |api, *args, &block|
        WinGui.enforce_count( args, api.prototype, -1)
        handles = []
        cb = if block
          callback('LP', 'I', &block)
        else
          callback('LP', 'I') do |handle, message|
            handles << handle
            true
          end
        end
        args[api.prototype.find_index('K'), 0] = cb # Insert callback into appropriate place of args Array
        api.call *args
        handles
      end
    end
def return_enum
      lambda do |api, *args, &block|
        WinGui.enforce_count( args, api.prototype, -1)
        handles = []
        cb = if block
          callback('LP', 'I', &block)
        else
          callback('LP', 'I') do |handle, message|
            handles << handle
            true
          end
        end
        args[api.prototype.find_index('K'), 0] = cb # Insert callback into appropriate place of args Array
        api.call *args
        handles
      end
    end
Procedure that calls api function expecting a callback. If runtime block is given
 it is converted into actual callback, otherwise procedure returns an array of all
 handles pushed into callback by api enumeration