int DeskTopWindow::CreateDeskTopWindow( ULONG _flStyle, /* Window style. */ LONG _nx, /* Width of window, in window coordinates. */ LONG _ny, /* Height of window, in window coordinates. */ PVOID pCtlData, /* Pointer to control data. */ PVOID pPresParams) /* Presentation parameters. */ { int rc; FPM_Window *dw = new FPM_Window(); /* Viking: Is this really right? Added it because CreateFPM_Window was called without a valid instance! */ rc = dw->CreateFPM_Window(NULL,"DeskTop","Desktop text", _flStyle,0L,0L,_nx,_ny,NULL,NULL,0, pCtlData, pPresParams); return rc; }
/* Create general Window */ extern "C" HWND APIENTRY Win32CreateWindow(HWND hwndParent, PCSZ pszClass, PCSZ pszName, ULONG flStyle, LONG x, LONG y, LONG nx, LONG ny, HWND hwndOwner, HWND hwndInsertBehind, ULONG id, PVOID pCtlData, PVOID pPresParams) { HAB iHab; HWND hwnd=NULL; FPM_Window *pw; int len,rc; iHab = _hab.GetCurrentHAB(); if(iHab < 0) { //_hab.SetError(ihab - bad! , PMERR_INVALID_HAB); debug(3, 0)("WARNING: __FUNCTION__: bad ihab %x\n",iHab); _fatal("Thread don't initialized to FreePM"); return NULL; } //create hwndClient rc = F_SendCmdToServer(client_obj, F_CMD_WINCREATE_HWND, iHab); if(rc) { if(rc == ERROR_BROKEN_PIPE) { /* todo: attempt to reconnect till timeout */ } debug(3, 0)("WARNING:__FUNCTION__:SendCmdToServer Error: %s\n",rc); _fatal("SendCmdToServer Error\n"); } rc = F_RecvDataFromServer(client_obj, &hwnd, &len, sizeof(HWND)); if(rc) { if(rc == ERROR_BROKEN_PIPE) { /* todo: attempt to reconnect till timeout */ } debug(3, 0)("WARNING:__FUNCTION__:RecvDataFromServer Error: %s\n",rc); _fatal("RecvDataFromServer Error\n"); } pw = new FPM_Window(); pw->CreateFPM_Window(hwndParent, /* Parent-window handle. */ pszClass, /* Registered-class name. */ pszName, /* Window text. */ flStyle, /* Window style. */ x, /* x-coordinate of window position. */ y, /* y-coordinate of window position. */ nx, /* Width of window, in window coordinates. */ ny, /* Height of window, in window coordinates. */ hwndOwner, /* Owner-window handle. */ hwndInsertBehind, /* Sibling-window handle. */ id, /* Window resource identifier. */ pCtlData, /* Pointer to control data. */ pPresParams);/* Presentation parameters. */ // _hab.AddHwnd(hwnd,iHab, pw); return hwnd; }