Share this page

# ctrx_window_resize_by_id

Example

Resizes the specified window.

`int ctrx_window_resize_by_id(long window_id, long width, long height, CTRX_LAST )`

window_id | A unique window ID, returned by a function such as ctrx_get_window_id_by_order.
width | Specifies the new width of the window.
height | Specifies the new height of the window.
CTRX_LAST | A marker that indicates the end of the argument list.

Note:
- Do not use this function with a window that cannot be resized. If you attempt to resize a window that cannot be resized, you receive a timeout error.
- Known issue: If you specify a width and height that are too big (bigger than the display) or too small (smaller than the minimum possible size for the specified window), you may receive a timeout error, or the function may fail to resize the window but the replay logs will show a false report that the window was resized.

## Return Values

If the function succeeds, it returns E_OK. Otherwise, it returns E_GENERAL_ERROR or E_DISCONNECTED.

## Parameterization

Parameterization is not available for this function.

## Example

In the following example, the ctrx_get_window_id_by_order function searches for the topmost window in the stack (in position 0). It returns the numeric identifier of the window. The ctrx_window_resize_by_id function resizes the window randomly ten times.

Copy code

    long windowID,x,y,nx,ny;
    int i=0;

    ctrx_get_window_size_by_id(windowID, &x,&y);

    for (i=0;i<10;i++)

    {
        nx = rand() % 133 + 467;
        ny = rand() % 640 + 160;

        lr_log_message("i: %i, nx: %i, ny: %i", i, nx, ny);

        ctrx_get_window_size_by_id(windowID, &x,&y);

        ctrx_window_resize_by_id(windowID, nx, ny);

        ctrx_get_window_size_by_id(windowID, &x,&y);

        lr_think_time(2);
    }

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: