#define CERNLIB_QFMSOFT #define CERNLIB_QXCAPT #define type_of_call _stdcall #include #include #include #include #include #include #include "ix_win32.h" #include "iw_text.h" #ifdef CERNLIB_QX_NC #define igxmes igxmes_ #define ixopnwi ixopnwi_ #endif #ifdef CERNLIB_QXCAPT #define igxmes type_of_call IGXMES #define ixopnwi type_of_call IXOPNWI #endif static BOOL open = {FALSE}; int lenocc(char *c,int l) { int i; for (i=l-1;i>=0 && c[i] == " ";i--); return i+1; } /*_______________________________________________________________*/ /* This is a pool of routines to present text in Windows/NT */ #ifndef CERNLIB_QFMSOFT void igxmes(ix, iy, nc, n, chmess, chtit, chopt, chmess_len, chtit_len, chopt_len) #else void igxmes(ix, iy, nc, n, chmess, chmess_len, chtit, chtit_len, chopt, chopt_len) #endif int *ix, *iy, *nc, *n; char *chmess, *chtit, *chopt; int chmess_len; int chtit_len; int chopt_len; { char *title; static HWND hwnd, hwndEdit; struct CREATEHIGZWINDOW WinThr; static RECT FmtRect; char *temp; int i,j,k, sw; sw=0; for(i=0;ititle,WinThr->lentit), /*address of window name */ //= WS_OVERLAPPED | WS_VISIBLE | //= WS_THICKFRAME, WS_OVERLAPPEDWINDOW, // | WS_VSCROLL | WS_HSCROLL, /* Window style */ WinThr->x, WinThr->y, // *x, *y, WinThr->w, WinThr->h, // *w, *h, NULL, /*handle of parent of owner window */ hmenu, /*handle of menu, or child-window identifier */ text_display.hInstance, /*handle of application instance */ NULL); /*address of window-creation data */ return hwndHIGZ; } /*_______________________________________________________________*/ LRESULT APIENTRY WndText(hwnd, uMsg, wParam, lParam) HWND hwnd; UINT uMsg; WPARAM wParam; LPARAM lParam; { static HWND hwndEdit; switch (uMsg) { case WM_CREATE: hwndEdit = CreateWindow( "EDIT", /* Predefined class */ NULL, /* no window title */ WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL, 0,0,0,0, /* set size in WM_SIZE message */ hwnd, /* parent window */ (HMENU) ID_EDITCHILD , /* edit control ID */ (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE), NULL); /* pointer not need */ SetWindowLong(hwnd,0, hwndEdit); break; case WM_COMMAND: switch (wParam) { case IDM_EDCOPY: SendMessage(hwndEdit, WM_COPY, 0, 0); break; default: return DefWindowProc(hwnd,uMsg,wParam,lParam); } break; case WM_SETFOCUS: SetFocus(hwndEdit); break; case WM_SIZE: /* * Make the edit control the size of the window's * client area */ MoveWindow(hwndEdit, 0,0, /* Starting x- and y-coordinates */ LOWORD(lParam), /* width of client area */ HIWORD(lParam), /* height of client area */ TRUE); /* repaint window */ break; case WM_DESTROY: open = FALSE; break; default: break; } return DefWindowProc(hwnd,uMsg,wParam,lParam); }