/* ioSizeOfWindowSetxy: args are int windowIndex, int w & h for the
 * width / height to make the window. Return the actual size the OS
 * produced in (width<<16 | height) format or -1 for failure as above. */
sqInt ioSizeOfWindowSetxy(sqInt windowIndex, sqInt w, sqInt h) {
  HWND hwnd = (windowIndex == 1 ? stWindow : ((HWND)windowIndex));
  RECT boundingRect;
  int wsize;
 
  if ((GetWindowRect(hwnd, &boundingRect)) == 0)return -1;

  if (MoveWindow(hwnd,
		 boundingRect.left,
		 boundingRect.top,
		 w,
		 h,
		 TRUE)==0) return -1;
  wsize = ioSizeOfWindow(windowIndex);
  return wsize;
}
/* ioSizeOfWindowSetxy: args are int windowIndex, int w & h for the
 * width / height to make the window. Return the actual size the OS
 * produced in (width<<16 | height) format or -1 for failure as above. */
int ioSizeOfWindowSetxy(int windowIndex, int w, int h)
{
 HWND hwnd = (HWND)windowIndex;
 RECT boundingRect;
 int wsize;
 
 if ((GetWindowRect(hwnd, &boundingRect)) == 0)return -1;

 if (MoveWindow(hwnd,
            boundingRect.left,
            boundingRect.top,
            w,
            h,
            TRUE)==0) return -1;
 wsize = ioSizeOfWindow(windowIndex);
 return (wsize);
 
}
Beispiel #3
0
int ioSizeOfWindowSetxy(wIndexType windowIndex, int x, int y)
{
	void * giLocker;
	int return_value=0;
	if (windowHandleFromIndex(windowIndex) == nil)
		return -1;
	giLocker = interpreterProxy->ioLoadFunctionFrom("getUIToLock", "");
	if (giLocker != 0) {
		sqInt *foo;
		foo = malloc(sizeof(sqInt)*7);
		foo[0] = 4;
		foo[1] = (sqInt) SizeWindow;
		foo[2] = (sqInt) windowHandleFromIndex(windowIndex);
		foo[3] = x;
		foo[4] = y;
		foo[5] = true;
		foo[6] = 0;
		((sqInt (*) (void *)) giLocker)(foo);
		return_value = interpreterProxy->positive32BitIntegerFor(foo[6]);
		free(foo);
	}
	setWindowTrackingRgn(windowIndex);
	return ioSizeOfWindow(windowIndex);
}