WndProc (Part 2)
By SalimMeghani
- 248 reads
cell=scell+pvalue;
type=stype+pvalue;
*type='F';
*cell=(char *) calloc((unsigned long) 65536, sizeof(char));
clr_str(*cell);
strcpy(*cell,nwdll);
}
}
}
InvalidateRect(hWnd, NULL, FALSE);
}
break;
case 2:
if (wmEvent==BN_CLICKED)
{
SetFocus(hWnd);
repfrmx=column;
repfrmy=row;
InvalidateRect(hWnd, NULL, FALSE);
}
break;
case 3:
if (wmEvent == BN_CLICKED)
{
SetFocus(hWnd);
if (gene == 0) gene = 1; else gene = 0;
InvalidateRect(hWnd, NULL, FALSE);
}
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_CREATE:
hGlobalMemory=GlobalAlloc(0, 0x9F64L);
hGlobalMemory2=GlobalAlloc(0, 0x9F64L);
hGlobalMemory3=GlobalAlloc(0, 0x9F64L);
hGlobalMemory4=GlobalAlloc(0, 0x9F64L);
cell=(char* *)GlobalLock (hGlobalMemory);
scell=cell;
numeric=(double* *)GlobalLock(hGlobalMemory2);
snumeric=numeric;
type=(char *)GlobalLock(hGlobalMemory3);
stype=type;
rtype=(char *)GlobalLock(hGlobalMemory4);
srtype=rtype;
SetScrollRange(hWnd, SB_VERT, 1,100,FALSE);
SetScrollPos(hWnd,SB_VERT, nVscrollPos,TRUE);
SetScrollRange(hWnd, SB_HORZ, 1,100,FALSE);
SetScrollPos(hWnd,SB_HORZ, nHscrollPos,TRUE);
//
// Set all the cells types to Empty.
for(i=1;i<=100;i++)
for(a=1;a<=100;a++)
{
pvalue=0;
pvalue=((i-1)*100)+a;
type=stype+pvalue;
*type='E';
rtype=srtype+pvalue;
*rtype='F';
}
//
cxChar=LOWORD(GetDialogBaseUnits());
cyChar=HIWORD(GetDialogBaseUnits());
ButtonP = CreateWindow(TEXT("button"), TEXT("Strt"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
cxChar,4,5*cxChar,7*cyChar/4,hWnd,(HMENU) 0,
((LPCREATESTRUCT) lParam)->hInstance, NULL);
//
ButtonX = CreateWindow(TEXT("button"), TEXT("End"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
cxChar*6,4,5*cxChar,7*cyChar/4,hWnd,(HMENU) 1,
((LPCREATESTRUCT) lParam)->hInstance, NULL);
ButtonY = CreateWindow(TEXT("button"), TEXT("Form"),
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
cxChar*12,4,5*cxChar,7*cyChar/4,hWnd,(HMENU) 2,
&nb
- Log in to post comments