From: <kr_...@us...> - 2004-05-08 09:46:17
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23232/src/cbits/Win32 Modified Files: Frame.c Util.c Log Message: Change the way in which the AppName is evaluated from AppTitle Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Frame.c 7 May 2004 14:23:48 -0000 1.25 --- Frame.c 8 May 2004 09:46:00 -0000 1.26 *************** *** 108,113 **** case WM_CREATE: { - int nLen; - pData = (FrameData *) malloc(sizeof(FrameData)); if (!pData) return -1; --- 108,111 ---- *************** *** 119,134 **** pData->pMenuHandlesMap = newMenuHandlesMap(); - nLen = GetWindowTextLength(hWnd); - if (nLen > 0) - { - pData->lpszAppName = malloc(nLen+1); - if (!pData->lpszAppName) - { - free(pData); - return -1; - } - GetWindowText(hWnd,pData->lpszAppName,nLen+1); - } - pData->hLeftBar = CreateWindow("HDOCKBAR", NULL, --- 117,120 ---- Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Util.c 7 May 2004 14:23:48 -0000 1.30 --- Util.c 8 May 2004 09:46:00 -0000 1.31 *************** *** 45,49 **** extern WNDPROC DefCheckListBoxProc; ! void osInit(char *appName, char *appVersion, int DocumentInterface) { if (!ghModule) --- 45,86 ---- extern WNDPROC DefCheckListBoxProc; ! static void parseAppNameVersion(char *appTitle,char *appVersion) ! { ! FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! int appNameLen; ! char *s; ! ! s = appVersion; ! while (*s != ' ' && *s != 0) s++; ! ! if (*s == ' ') ! { ! appNameLen = s-appVersion; ! pFrameData->lpszAppName = malloc(appNameLen+1); ! memcpy(pFrameData->lpszAppName, appVersion, appNameLen); ! pFrameData->lpszAppName[appNameLen] = 0; ! ! while (*s == ' ') s++; ! pFrameData->lpszAppVersion = strdup(s); ! } ! else ! { ! pFrameData->lpszAppName = strdup(appTitle); ! pFrameData->lpszAppVersion = strdup(appVersion); ! } ! ! s = pFrameData->lpszAppName; ! appNameLen = 0; ! while (*s) ! { ! if (isalnum(*s)) ! pFrameData->lpszAppName[appNameLen++] = *s++; ! else ! s++; ! } ! pFrameData->lpszAppName[appNameLen] = 0; ! } ! ! void osInit(char *appTitle, char *appVersion, int DocumentInterface) { if (!ghModule) *************** *** 200,204 **** { ghWndFrame = CreateWindow ( "HSDIFRAME", ! appName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, --- 237,241 ---- { ghWndFrame = CreateWindow ( "HSDIFRAME", ! appTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, *************** *** 213,217 **** { ghWndFrame = CreateWindow ( "HMDIFRAME", ! appName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, --- 250,254 ---- { ghWndFrame = CreateWindow ( "HMDIFRAME", ! appTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT, *************** *** 224,231 **** } ! { // Store appVersion for future usage ! FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! pFrameData->lpszAppVersion = strdup(appVersion); ! } RestoreWindowState(ghWndFrame, SW_NORMAL); --- 261,265 ---- } ! parseAppNameVersion(appTitle,appVersion); RestoreWindowState(ghWndFrame, SW_NORMAL); |