Class: Fzeet::Windows::ShellItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fzeet/windows/shell/Common.rb

Instance Method Summary collapse

Instance Method Details

#pathObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/fzeet/windows/shell/Common.rb', line 83

def path
  result = nil

  FFI::MemoryPointer.new(:pointer) { |pwcs|
    next unless GetDisplayName(SIGDN_FILESYSPATH, pwcs) == S_OK

    wcs = pwcs.read_pointer

    begin
      result = Windows.WCSTOMBS(wcs)
    ensure
      Windows.CoTaskMemFree(wcs)
    end
  }

  result
end