Resizes the specified window.

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


A unique window ID, returned by a function such as ctrx_get_window_id_by_order.

widthSpecifies the new width of the window.
heightSpecifies the new height of the window.
CTRX_LASTA marker that indicates the end of the argument list.
  • 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 is not available for this function.


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);