Module: AMS::Window

Defined in:
Documentation/ams/window.rb

Overview

Note:

Windows only!

The Window namespace contains functions that are associated with Windows window.

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.adjust_rect(rect, style, style_ex, b_menu) ⇒ Array<Fixnum>

Adjust window rect.

Parameters:

  • rect (Array<Fixnum>)
  • style (Fixnum)
  • style_ex (Fixnum)
  • b_menu (Boolean)

    Whether window contains a menu.

Returns:

  • (Array<Fixnum>)

    New rect: [x1,y1, x2,y2].

See Also:

Since:

  • 2.0.0


282
283
# File 'Documentation/ams/window.rb', line 282

def adjust_rect(rect, style, style_ex, b_menu)
end

.bring_to_top(handle) ⇒ Boolean

Bring window to the top of Z order. If window is a top-level window, it is activated. If window is a child window, the top-level parent window associated with the child window is activated.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 3.0.0


141
142
# File 'Documentation/ams/window.rb', line 141

def bring_to_top(handle)
end

.client_to_screen(handle, x, y) ⇒ Array<Fixnum>

Convert client coordinates to screen coordinates.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • x (Fixnum)
  • y (Fixnum)

Returns:

  • (Array<Fixnum>)

    Converted point: [x,y]

See Also:

Since:

  • 3.0.0


596
597
# File 'Documentation/ams/window.rb', line 596

def client_to_screen(handle, x, y)
end

.close(handle) ⇒ Boolean

Note:

This function behaves the same way as clicking the 'X' button.

Close window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


365
366
# File 'Documentation/ams/window.rb', line 365

def close(handle)
end

.draw_menu_bar(handle) ⇒ Boolean

Update menu bar of a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


483
484
# File 'Documentation/ams/window.rb', line 483

def draw_menu_bar(handle)
end

.enable_input(handle, b_state) ⇒ Boolean

Enable/Disable keyboard and mouse input to a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • b_state (Boolean)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


417
418
# File 'Documentation/ams/window.rb', line 417

def enable_input(handle, b_state)
end

.find_child_window_by_caption(parent_handle, caption, include_sub_childs = false, full_match = true, case_sensitive = true) ⇒ Fixnum?

Find handle to a child window with a specific caption.

Parameters:

  • parent_handle (Fixnum)

    Handle to a valid parent window.

  • caption (String)

    Text to match.

  • include_sub_childs (Boolean) (defaults to: false)

    Whether to include windows descending from the child windows.

  • full_match (Boolean) (defaults to: true)

    Whether to match full (true) or part (false) of the window text.

  • case_sensitive (Boolean) (defaults to: true)

    Whether to consider uppercased/lowercased letters.

Returns:

  • (Fixnum, nil)

    Handle to the first found window if any.

Since:

  • 3.0.0


561
562
# File 'Documentation/ams/window.rb', line 561

def find_child_window_by_caption(parent_handle, caption, include_sub_childs = false, full_match = true, case_sensitive = true)
end

.find_child_window_by_class_name(parent_handle, class_name, include_sub_childs = false, full_match = true, case_sensitive = true) ⇒ Fixnum?

Find handle to a child window with a specific class name.

Parameters:

  • parent_handle (Fixnum)

    Handle to a valid parent window.

  • class_name (String)

    Text to match.

  • include_sub_childs (Boolean) (defaults to: false)

    Whether to include windows descending from the child windows.

  • full_match (Boolean) (defaults to: true)

    Whether to match full (true) or part (false) of the window class name.

  • case_sensitive (Boolean) (defaults to: true)

    Whether to consider uppercased/lowercased letters.

Returns:

  • (Fixnum, nil)

    Handle to the first found window if any.

Since:

  • 3.0.0


586
587
# File 'Documentation/ams/window.rb', line 586

def find_child_window_by_class_name(parent_handle, class_name, include_sub_childs = false, full_match = true, case_sensitive = true)
end

.find_window_by_caption(caption, full_match = true, case_sensitive = true) ⇒ Fixnum?

Find handle to a window with a specific caption.

Parameters:

  • caption (String)

    Text to match.

  • full_match (Boolean) (defaults to: true)

    Whether to match full (true) or part (false) of the window text.

  • case_sensitive (Boolean) (defaults to: true)

    Whether to consider uppercased/lowercased letters.

Returns:

  • (Fixnum, nil)

    Handle to the first found window if any.

Since:

  • 3.0.0


547
548
# File 'Documentation/ams/window.rb', line 547

def find_window_by_caption(caption, full_match = true, case_sensitive = true)
end

.find_window_by_class_name(class_name, full_match = true, case_sensitive = true) ⇒ Fixnum?

Find handle to a window with a specific class name.

Parameters:

  • class_name (String)

    Text to match.

  • full_match (Boolean) (defaults to: true)

    Whether to match full (true) or part (false) of the window class name.

  • case_sensitive (Boolean) (defaults to: true)

    Whether to consider uppercased/lowercased letters.

Returns:

  • (Fixnum, nil)

    Handle to the first found window if any.

Since:

  • 3.0.0


572
573
# File 'Documentation/ams/window.rb', line 572

def find_window_by_class_name(class_name, full_match = true, case_sensitive = true)
end

.get_activeFixnum

Get active window.

Returns:

  • (Fixnum)

    A handle to an active window.

See Also:

Since:

  • 2.0.0


77
78
# File 'Documentation/ams/window.rb', line 77

def get_active
end

.get_ancestor(handle, flag) ⇒ Fixnum?

Get window ancestor.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • flag (Fixnum)

    An ancestor:

    1. parent window

    2. root window

    3. root owner window

Returns:

  • (Fixnum, nil)

    A handle to the ancestor window if any.

See Also:

Since:

  • 3.0.0


131
132
# File 'Documentation/ams/window.rb', line 131

def get_ancestor(handle, flag)
end

.get_caption(handle) ⇒ String

Get window text.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (String)

See Also:

Since:

  • 3.0.0


232
233
# File 'Documentation/ams/window.rb', line 232

def get_caption(handle)
end

.get_child_windows(parent_handle, include_sub_childs = false, include_hidden = true) ⇒ Array<Fixnum>

Get all child windows belonging to a parent window.

Parameters:

  • parent_handle (Fixnum)

    Handle to a valid parent window.

  • include_sub_childs (Boolean) (defaults to: false)

    Whether to include child window descendants.

  • include_hidden (Boolean) (defaults to: true)

    Whether to include hidden windows.

Returns:

  • (Array<Fixnum>)

    An array of window handles.

Since:

  • 3.0.0


536
537
# File 'Documentation/ams/window.rb', line 536

def get_child_windows(parent_handle, include_sub_childs = false, include_hidden = true)
end

.get_class_long(handle, index) ⇒ Fixnum

Get class long.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • index (Fixnum)

Returns:

  • (Fixnum)

    Window long.

See Also:

Since:

  • 3.6.0


197
198
# File 'Documentation/ams/window.rb', line 197

def get_class_long(handle, index)
end

.get_class_name(handle) ⇒ String

Get class name of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (String)

See Also:

Since:

  • 2.0.0


148
149
# File 'Documentation/ams/window.rb', line 148

def get_class_name(handle)
end

.get_client_rect(handle) ⇒ Array<Fixnum>

Get upper-left and lower-right coordinates of the window's client area in client coordinates, relative to the upper-left corner of the window's client area. Because coordinates are relative to the upper-left corner of the client area, the coordinates of the upper-left corner are (0,0).

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Array<Fixnum>)

    An array of four numeric values, representing upper-left and lower-right coordinates: [x1,y1, x2,y2].

See Also:

Since:

  • 2.0.0


272
273
# File 'Documentation/ams/window.rb', line 272

def get_client_rect(handle)
end

.get_executable_name(handle) ⇒ String?

Get executable name of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (String, nil)

Since:

  • 3.1.0


641
642
# File 'Documentation/ams/window.rb', line 641

def get_executable_name(handle)
end

.get_executable_path(handle) ⇒ String?

Get full executable path of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (String, nil)

Since:

  • 3.1.0


634
635
# File 'Documentation/ams/window.rb', line 634

def get_executable_path(handle)
end

.get_keyboard_focusFixnum?

Get window containing keyboard focus.

Returns:

  • (Fixnum, nil)

    A handle to a window with keyboard focus.

See Also:

Since:

  • 3.6.0


91
92
# File 'Documentation/ams/window.rb', line 91

def get_keyboard_focus
end

.get_layered_attributes(handle) ⇒ Array<(Array<Fixnum>, Fixnum, Fixnum)>

Get layered attributes of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Array<(Array<Fixnum>, Fixnum, Fixnum)>)

    An array of three values: [rgb_color, opacity, flags]

Since:

  • 3.0.0


491
492
# File 'Documentation/ams/window.rb', line 491

def get_layered_attributes(handle)
end

.get_long(handle, index) ⇒ Fixnum

Get window long.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • index (Fixnum)

Returns:

  • (Fixnum)

    Window long.

See Also:

Since:

  • 2.0.0


179
180
# File 'Documentation/ams/window.rb', line 179

def get_long(handle, index)
end

.get_menu(handle) ⇒ Fixnum?

Get window menu.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum, nil)

    A handle to the menu. If the specified window has no menu, the return value is nil.

See Also:

Since:

  • 2.0.0


215
216
# File 'Documentation/ams/window.rb', line 215

def get_menu(handle)
end

.get_module_hanlde(handle) ⇒ Fixnum?

Get module instance handle of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum, nil)

Since:

  • 3.1.0


627
628
# File 'Documentation/ams/window.rb', line 627

def get_module_hanlde(handle)
end

.get_origin(handle) ⇒ Array<Fixnum>

Get coordinates of the upper-left corner of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Array<Fixnum>)
    x,y

Since:

  • 2.0.0


371
372
# File 'Documentation/ams/window.rb', line 371

def get_origin(handle)
end

.get_parent(handle) ⇒ Fixnum?

Get parent window of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum, nil)

    If the window is a child window, the return value is a handle to the parent window. If the window is a top-level window with the WS_POPUP style, the return value is a handle to the owner window. Otherwise, the return value is nil.

See Also:

Since:

  • 2.0.0


109
110
# File 'Documentation/ams/window.rb', line 109

def get_parent(handle)
end

.get_placement(handle) ⇒ Array<(Fixnum, Fixnum, Fixnum, Array<Fixnum>, Array<Fixnum>, Array<Fixnum>)>

Get window placement.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Array<(Fixnum, Fixnum, Fixnum, Array<Fixnum>, Array<Fixnum>, Array<Fixnum>)>)

    An array of six objects representing window placement: +[length, flags, show_cmd, min_pt, max_pt, rect]+.

See Also:

Since:

  • 2.0.0


291
292
# File 'Documentation/ams/window.rb', line 291

def get_placement(handle)
end

.get_process_id(handle) ⇒ Fixnum

Get process identifier of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum)

See Also:

Since:

  • 2.0.0


171
172
# File 'Documentation/ams/window.rb', line 171

def get_process_id(handle)
end

.get_process_windows(process_id, include_hidden = true) ⇒ Array<Fixnum>

Get all windows belonging to a process.

Parameters:

  • process_id (Fixnum)
  • include_hidden (Boolean) (defaults to: true)

    Whether to include hidden windows.

Returns:

  • (Array<Fixnum>)

    An array of window handles.

Since:

  • 3.0.0


518
519
# File 'Documentation/ams/window.rb', line 518

def get_process_windows(process_id, include_hidden = true)
end

.get_rect(handle) ⇒ Array<Fixnum>

Get upper-left and lower-right coordinates of a window in screen coordinates, relative to the upper-left corner of the screen.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Array<Fixnum>)

    An array of four numeric values, representing upper-left and lower-right coordinates: [x1,y1, x2,y2].

See Also:

Since:

  • 2.0.0


250
251
# File 'Documentation/ams/window.rb', line 250

def get_rect(handle)
end

Get related window of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • command (Fixnum)

    See link below for existing commands.

Returns:

  • (Fixnum, nil)

    A handle to a related window if any.

See Also:

Since:

  • 3.0.0


157
158
# File 'Documentation/ams/window.rb', line 157

def get_related(handle, command)
end

.get_size(handle) ⇒ Array<Fixnum>

Get size of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Array<Fixnum>)
    width, height

Since:

  • 2.0.0


386
387
# File 'Documentation/ams/window.rb', line 386

def get_size(handle)
end

.get_thread_id(handle) ⇒ Fixnum

Get thread identifier of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum)

See Also:

Since:

  • 2.0.0


164
165
# File 'Documentation/ams/window.rb', line 164

def get_thread_id(handle)
end

.get_thread_windows(thread_id, include_hidden = true) ⇒ Array<Fixnum>

Get all windows belonging to a thread.

Parameters:

  • thread_id (Fixnum)
  • include_hidden (Boolean) (defaults to: true)

    Whether to include hidden windows.

Returns:

  • (Array<Fixnum>)

    An array of window handles.

Since:

  • 3.0.0


526
527
# File 'Documentation/ams/window.rb', line 526

def get_thread_windows(thread_id, include_hidden = true)
end

.get_windows(include_hidden = true) ⇒ Array<Fixnum>

Get all windows.

Parameters:

  • include_hidden (Boolean) (defaults to: true)

    Whether to include hidden windows.

Returns:

  • (Array<Fixnum>)

    An array of window handles.

Since:

  • 3.0.0


510
511
# File 'Documentation/ams/window.rb', line 510

def get_windows(include_hidden = true)
end

.is_active?(handle) ⇒ Boolean

Determine whether window is active.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

Since:

  • 2.0.0


18
19
# File 'Documentation/ams/window.rb', line 18

def is_active?(handle)
end

.is_child?(handle, parent_handle) ⇒ Boolean

Determine whether window is a child window of a specific parent window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • parent_handle (Fixnum)

    Handle to a valid parent window.

Returns:

  • (Boolean)

See Also:

Since:

  • 3.0.0


62
63
# File 'Documentation/ams/window.rb', line 62

def is_child?(handle, parent_handle)
end

.is_input_enabled?(handle) ⇒ Boolean

Determine whether keyboard and mouse input is enabled in a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

See Also:

Since:

  • 2.0.0


425
426
# File 'Documentation/ams/window.rb', line 425

def is_input_enabled?(handle)
end

.is_maximized?(handle) ⇒ Boolean

Determine whether window is maximized.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

See Also:

Since:

  • 2.0.0


40
41
# File 'Documentation/ams/window.rb', line 40

def is_maximized?(handle)
end

.is_minimized?(handle) ⇒ Boolean

Determine whether window is minimized.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

See Also:

Since:

  • 2.0.0


47
48
# File 'Documentation/ams/window.rb', line 47

def is_minimized?(handle)
end

.is_resizeable?(handle) ⇒ Boolean

Determine whether window is resizeable.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

Since:

  • 2.0.0


401
402
# File 'Documentation/ams/window.rb', line 401

def is_resizeable?(handle)
end

.is_restored?(handle) ⇒ Boolean

Determine whether window is restored; not maximized nor minimized.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

Since:

  • 2.0.0


53
54
# File 'Documentation/ams/window.rb', line 53

def is_restored?(handle)
end

.is_unicode?(handle) ⇒ Boolean

Determine whether window is unicode.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

See Also:

Since:

  • 3.0.0


33
34
# File 'Documentation/ams/window.rb', line 33

def is_unicode?(handle)
end

.is_valid?(handle) ⇒ Boolean

Determine whether handle is a reference to a valid window.

Parameters:

  • handle (Fixnum)

    A handle to be tested.

Returns:

  • (Boolean)

See Also:

Since:

  • 2.0.0


12
13
# File 'Documentation/ams/window.rb', line 12

def is_valid?(handle)
end

.is_visible?(handle) ⇒ Boolean

Determine whether window is visible.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

See Also:

Since:

  • 2.0.0


25
26
# File 'Documentation/ams/window.rb', line 25

def is_visible?(handle)
end

.lock_update(handle) ⇒ Boolean

Note:

This method is usually called before and after setting window styles, followed by set_pos to update setting.

Lock window update.

Examples:

Removing caption from an active window.

handle = AMS::Window.get_active
long = AMS::Window.get_long(handle, -16)
AMS::Window.lock_update(handle)
AMS::Window.set_long(handle, -16, long & ~0x00C00000)
AMS::Window.lock_update(nil)
AMS::Window.set_pos(handle, 0, 0, 0, 0, 0, 0x0277)

Adding caption to an active window.

handle = AMS::Window.get_active
long = AMS::Window.get_long(handle, -16)
AMS::Window.lock_update(handle)
AMS::Window.set_long(handle, -16, long | 0x00C00000)
AMS::Window.lock_update(nil)
AMS::Window.set_pos(handle, 0, 0, 0, 0, 0, 0x0277)

Parameters:

  • handle (Fixnum, nil)

    Handle to a valid window to be locked. If this parameter is nil, current locked window is unlocked.

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


327
328
# File 'Documentation/ams/window.rb', line 327

def lock_update(handle)
end

.map_point(handle_from, handle_to, x, y) ⇒ Array<Fixnum>

Convert (map) a point from a coordinate space relative to one window to a coordinate space relative to another window.

Parameters:

  • handle_from (Fixnum)

    Handle to a valid window from which point is converted.

  • handle_to (Fixnum)

    Handle to a valid window to which point is converted.

  • x (Fixnum)
  • y (Fixnum)

Returns:

  • (Array<Fixnum>)

    Converted point: [x,y]

See Also:

Since:

  • 3.0.0


620
621
# File 'Documentation/ams/window.rb', line 620

def map_point(handle_from, handle_to, x, y)
end

.move(handle, x, y, width, height, b_repaint = true) ⇒ Boolean

Move window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • x (Fixnum)
  • y (Fixnum)
  • width (Fixnum)
  • height (Fixnum)
  • b_repaint (Boolean) (defaults to: true)

    Whether to repaint the window.

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


352
353
# File 'Documentation/ams/window.rb', line 352

def move(handle, x, y, width, height, b_repaint = true)
end

.peek_message(handle, msg_filter_min, msg_filter_max, remove_flag) ⇒ Array?

Peek message of a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • msg_filter_min (Fixnum, Bignum)
  • msg_filter_max (Fixnum, Bignum)
  • remove_flag (Fixnum, Bignum)

Returns:

  • (Array, nil)

    An array containing peeked message data or nil if no messages are available.

See Also:

Since:

  • 3.5.0


458
459
# File 'Documentation/ams/window.rb', line 458

def peek_message(handle, msg_filter_min, msg_filter_max, remove_flag)
end

.peek_message2(handle, msg_filter_min, msg_filter_max, remove_flag) ⇒ Boolean

Peek message of a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • msg_filter_min (Fixnum, Bignum)
  • msg_filter_max (Fixnum, Bignum)
  • remove_flag (Fixnum, Bignum)

Returns:

  • (Boolean)

    True if a message is available; false if not.

See Also:

Since:

  • 3.5.0


469
470
# File 'Documentation/ams/window.rb', line 469

def peek_message2(handle, msg_filter_min, msg_filter_max, remove_flag)
end

.post_message(handle, message, wParam, lParam) ⇒ Boolean

Post message to a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • message (Fixnum, Bignum)
  • wParam (Fixnum, Bignum)
  • lParam (Fixnum, Bignum)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 3.0.0


446
447
# File 'Documentation/ams/window.rb', line 446

def post_message(handle, message, wParam, lParam)
end

.refresh(handle) ⇒ Boolean

Refresh window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


358
359
# File 'Documentation/ams/window.rb', line 358

def refresh(handle)
end

.screen_to_client(handle, x, y) ⇒ Array<Fixnum>

Convert screen coordinates to client coordinates.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • x (Fixnum)
  • y (Fixnum)

Returns:

  • (Array<Fixnum>)

    Converted point: [x,y]

See Also:

Since:

  • 3.0.0


606
607
# File 'Documentation/ams/window.rb', line 606

def screen_to_client(handle, x, y)
end

.send_message(handle, message, wParam, lParam) ⇒ Fixnum

Send message to a specific window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • message (Fixnum, Bignum)
  • wParam (Fixnum, Bignum)
  • lParam (Fixnum, Bignum)

Returns:

  • (Fixnum)

    Message processing result.

See Also:

Since:

  • 2.0.0


435
436
# File 'Documentation/ams/window.rb', line 435

def send_message(handle, message, wParam, lParam)
end

.set_active(handle) ⇒ Fixnum

Set active window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum)

    A handle to an original active window.

See Also:

Since:

  • 2.0.0


84
85
# File 'Documentation/ams/window.rb', line 84

def set_active(handle)
end

.set_background_color(handle, color, b_activate = true) ⇒ Boolean

Set window background color.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • color (Sketchup::Color)

    Background color

  • b_activate (Boolean) (defaults to: true)

    Whether to activate the window.

Returns:

  • (Boolean)

    success

Since:

  • 3.6.0


650
651
# File 'Documentation/ams/window.rb', line 650

def set_background_color(handle, color, b_activate = true)
end

.set_caption(handle, caption) ⇒ Boolean

Set window text.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • caption (String)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 3.0.0


241
242
# File 'Documentation/ams/window.rb', line 241

def set_caption(handle, caption)
end

.set_class_long(handle, index, long) ⇒ Fixnum

Set class long.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • index (Fixnum)
  • long (Fixnum)

Returns:

  • (Fixnum)

    Previous window long.

See Also:

Since:

  • 3.6.0


207
208
# File 'Documentation/ams/window.rb', line 207

def set_class_long(handle, index, long)
end

.set_icon(handle, full_path) ⇒ Boolean

Modify window icon.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • full_path (String)

    Icon location.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


476
477
# File 'Documentation/ams/window.rb', line 476

def set_icon(handle, full_path)
end

.set_keyboard_focus(handle) ⇒ Fixnum

Set keyboard focus to a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

Returns:

  • (Fixnum)

    A handle to an original window with keyboard focus.

See Also:

Since:

  • 3.6.0


99
100
# File 'Documentation/ams/window.rb', line 99

def set_keyboard_focus(handle)
end

.set_layered_attributes(handle, color, opacity, flags) ⇒ Boolean

Set layered attributes of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • color (Fixnum, Bignum, Array<Fixnum>)

    A number or an array representing color in RGB form. Note: An array is not acceptible in library versions prior to 3.0.0.

  • opacity (Fixnum)

    A value between 0 (transparent) and 255 (opaque).

  • flags (Fixnum)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


503
504
# File 'Documentation/ams/window.rb', line 503

def set_layered_attributes(handle, color, opacity, flags)
end

.set_long(handle, index, long) ⇒ Fixnum

Set window long.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • index (Fixnum)
  • long (Fixnum)

Returns:

  • (Fixnum)

    Previous window long.

See Also:

Since:

  • 2.0.0


188
189
# File 'Documentation/ams/window.rb', line 188

def set_long(handle, index, long)
end

.set_menu(handle, menu_handle) ⇒ Boolean

Set window menu.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • menu_handle (Fixnum, nil)

    A handle to the new menu. If this parameter is nil, the window's current menu is removed.

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


224
225
# File 'Documentation/ams/window.rb', line 224

def set_menu(handle, menu_handle)
end

.set_origin(handle, x, y, b_activate = true) ⇒ Boolean

Set coordinates of the upper-left corner of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • x (Fixnum)
  • y (Fixnum)
  • b_activate (Boolean) (defaults to: true)

    Whether to activate the window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


380
381
# File 'Documentation/ams/window.rb', line 380

def set_origin(handle, x, y, b_activate = true)
end

.set_parent(handle, parent_handle) ⇒ Fixnum?

Set parent window of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • parent_handle (Fixnum)

    Handle to a valid parent window.

Returns:

  • (Fixnum, nil)

    If the functions succeeds, the return values is a handle to the previous parent window. Otherwise, the return value is nil.

See Also:

Since:

  • 2.0.0


119
120
# File 'Documentation/ams/window.rb', line 119

def set_parent(handle, parent_handle)
end

.set_placement(handle, flags, show_cmd, min_pt, max_pt, rect) ⇒ Boolean

Set Window Placement.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • flags (Fixnum)
  • show_cmd (Fixnum)
  • min_pt (Array<Fixnum>)

    (x,y)

  • max_pt (Array<Fixnum>)

    (x,y)

  • rect (Array<Fixnum>)

    (x1,y1, x2,y2)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


303
304
# File 'Documentation/ams/window.rb', line 303

def set_placement(handle, flags, show_cmd, min_pt, max_pt, rect)
end

.set_pos(handle, handle_insert_after, x, y, cx, cy, flags) ⇒ Boolean

Set window position.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • handle_insert_after (Fixnum)
  • x (Fixnum)
  • y (Fixnum)
  • cx (Fixnum)
  • cy (Fixnum)
  • flags (Fixnum)

Returns:

  • (Boolean)

    success

See Also:

Since:

  • 2.0.0


340
341
# File 'Documentation/ams/window.rb', line 340

def set_pos(handle, handle_insert_after, x, y, cx, cy, flags)
end

.set_rect(handle, x1, y1, x2, y2, b_activate = true) ⇒ Boolean

Set upper-left and lower-right coordinates of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • x1 (Fixnum)
  • y1 (Fixnum)
  • x2 (Fixnum)
  • y2 (Fixnum)
  • b_activate (Boolean) (defaults to: true)

    Whether to activate the window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


261
262
# File 'Documentation/ams/window.rb', line 261

def set_rect(handle, x1, y1, x2, y2, b_activate = true)
end

.set_resizeable(handle, b_state, b_activate = true) ⇒ Boolean

Set window resizeable.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • b_state (Boolean)
  • b_activate (Boolean) (defaults to: true)

    Whether to activate the window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


409
410
# File 'Documentation/ams/window.rb', line 409

def set_resizeable(handle, b_state, b_activate = true)
end

.set_size(handle, w, h, b_activate = true) ⇒ Boolean

Set size of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • w (Fixnum)

    Window width in pixels.

  • h (Fixnum)

    Window height in pixels.

  • b_activate (Boolean) (defaults to: true)

    Whether to activate the window.

Returns:

  • (Boolean)

    success

Since:

  • 2.0.0


395
396
# File 'Documentation/ams/window.rb', line 395

def set_size(handle, w, h, b_activate = true)
end

.show(handle, state) ⇒ Boolean

Set show state of a window.

Parameters:

  • handle (Fixnum)

    Handle to a valid window.

  • state (Fixnum)

Returns:

  • (Boolean)

    True if window was previously visible; false if window was previously hidden.

See Also:

Since:

  • 2.0.0


71
72
# File 'Documentation/ams/window.rb', line 71

def show(handle, state)
end