+ tIPCMsg_CreateWin *info = (void*)Msg->Data;
+ tWindow *newwin, *parent;
+
+ ASSERT(Msg->ID == IPCMSG_CREATEWIN);
+
+ // - Sanity checks
+ // > +1 is for NULL byte on string
+ if( Msg->Size < sizeof(*info) + 1 ) {
+ _SysDebug("IPC_Msg_CreateWin: Size check 1 failed");
+ return -1;
+ }
+ if( info->Renderer[Msg->Size - sizeof(*info) - 1] != '\0' ) {
+ _SysDebug("IPC_Msg_CreateWin: Size check 2 failed");
+ _SysDebug("info = {");
+ _SysDebug(" .NewWinID = %i", info->NewWinID);
+ _SysDebug(" .RendererArg = %i", info->RendererArg);
+ _SysDebug(" .Renderer = '%.*s'", Msg->Size - sizeof(*info), info->Renderer);
+ _SysDebug("}");
+ return -1;
+ }
+
+ // - Get the parent window ID
+ parent = IPC_int_GetWindow(Client, Msg->Window);
+
+ // Catch creating a window with an existing ID
+ if( IPC_int_GetWindow(Client, info->NewWinID) )
+ return 1;
+
+ // - Create the new window, and save its pointer
+ newwin = WM_CreateWindow(parent, Client, info->NewWinID, info->RendererArg, info->Renderer);
+ IPC_int_SetWindow(Client, info->NewWinID, newwin);
+
+ return 0;
+}
+
+int IPC_Msg_SetWindowTitle(tIPC_Client *Client, tAxWin_IPCMessage *Msg)
+{
+ tWindow *win;
+
+ ASSERT(Msg->ID == IPCMSG_SETWINTITLE);
+
+ if( Msg->Size < 1 ) return -1;
+ if( Msg->Data[ Msg->Size-1 ] != '\0' ) return -1;
+
+ win = IPC_int_GetWindow(Client, Msg->Window);
+ if(!win) return 1;
+
+ WM_SetWindowTitle(win, Msg->Data);
+
+ return 0;
+}
+
+int IPC_Msg_ShowWindow(tIPC_Client *Client, tAxWin_IPCMessage *Msg)
+{
+ tIPCMsg_Boolean *info = (void*)Msg->Data;
+ tWindow *win;
+
+ ASSERT(Msg->ID == IPCMSG_SHOWWINDOW);
+
+ if( Msg->Size < sizeof(*info) ) return -1;
+
+ win = IPC_int_GetWindow(Client, Msg->Window);
+ if(!win) return 1;
+
+ WM_ShowWindow(win, !!info->Value);
+
+ return 0;
+}
+
+int IPC_Msg_DecorateWindow(tIPC_Client *Client, tAxWin_IPCMessage *Msg)
+{
+ tIPCMsg_Boolean *info = (void*)Msg->Data;
+ tWindow *win;
+
+ if( Msg->Size < sizeof(*info) ) return -1;
+
+ win = IPC_int_GetWindow(Client, Msg->Window);
+ if(!win) return 1;
+
+ WM_DecorateWindow(win, !!info->Value);
+ return 0;
+}
+
+int IPC_Msg_FocusWindow(tIPC_Client *Client, tAxWin_IPCMessage *Msg)
+{
+ tWindow *win;
+
+ ASSERT(Msg->ID == IPCMSG_FOCUSWINDOW);
+
+ // Don't allow the focus to be changed unless the client has the focus
+ if(!gpWM_FocusedWindow) return 1;
+ if(gpWM_FocusedWindow->Client != Client) return 1;
+
+ win = IPC_int_GetWindow(Client, Msg->Window);
+ if(!win) return 1;
+
+ WM_FocusWindow(win);
+
+ return 0;
+}
+
+int IPC_Msg_SetWinPos(tIPC_Client *Client, tAxWin_IPCMessage *Msg)
+{
+ tIPCMsg_SetWindowPos *info = (void*)Msg->Data;
+ tWindow *win;
+
+ ASSERT(Msg->ID == IPCMSG_SETWINPOS);
+
+ if(Msg->Size < sizeof(*info)) return -1;
+
+ win = IPC_int_GetWindow(Client, Msg->Window);
+ if(!win) return 1;
+
+ _SysDebug("info = {..., bSetPos=%i,bSetDims=%i}", info->bSetPos, info->bSetDims);
+
+ if(info->bSetPos)
+ WM_MoveWindow(win, info->X, info->Y);
+ if(info->bSetDims)
+ WM_ResizeWindow(win, info->W, info->H);
+
+ return 0;