Class: Fzeet::WindowMethods::Long

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

Instance Method Summary collapse

Constructor Details

#initialize(window) ⇒ Long

Returns a new instance of Long.



54
# File 'lib/fzeet/windows/user/Window/WindowMethods.rb', line 54

def initialize(window) @window = window end

Instance Method Details

#[](c) ⇒ Object



56
57
58
59
60
61
62
# File 'lib/fzeet/windows/user/Window/WindowMethods.rb', line 56

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



64
65
66
67
68
69
70
# File 'lib/fzeet/windows/user/Window/WindowMethods.rb', line 64

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