Class: Fzeet::WindowMethods::Long

Inherits:
Object
  • Object
show all
Defined in:
lib/fzeet/Window/WindowMethods.rb

Instance Method Summary collapse

Constructor Details

#initialize(window) ⇒ Long

Returns a new instance of Long.



43
# File 'lib/fzeet/Window/WindowMethods.rb', line 43

def initialize(window) @window = window end

Instance Method Details

#[](c) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/fzeet/Window/WindowMethods.rb', line 45

def [](c)
	Windows.SetLastError(0)

	Windows.GetWindowLong(@window.handle, Fzeet.constant(c, :gwl_, :gwlp_, :dwl_)).tap { |result|
		raise 'GetWindowLong failed.' if result == 0 && Windows.GetLastError() != 0
	}
end

#[]=(c, l) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/fzeet/Window/WindowMethods.rb', line 53

def []=(c, l)
	Windows.SetLastError(0)

	Windows.SetWindowLong(@window.handle, Fzeet.constant(c, :gwl_, :gwlp_, :dwl_), l).tap { |result|
		raise 'SetWindowLong failed.' if result == 0 && Windows.GetLastError() != 0
	}
end