1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
long fnWndProc_OnCreate(lpWEA wea) //this is pretty much where it all starts.
{
TCHAR szSetup[256],szClassName[16],szTmp[16];
MAINWINDOWDATA* pMainWindowData;
INITCOMMONCONTROLSEX icx;
unsigned int iReturn=0;
HINSTANCE hInstance;
HWND hWnd,hEdit;
HANDLE hHeap;
WNDCLASS wc;
GridData gd;
FILE* fp1;
RECT rc;
#if defined(MYDEBUG)
fp=_tfopen(_T("\\C_DRIVE\\Silvah\\Output.txt"),_T("w"));
_ftprintf(fp,_T("Output.txt Opened During fnWndProc_OnCreate()\n"));
_ftprintf(fp,_T("MYDEBUG Is Defined!\n"));
#endif
//Get hInstance
wea->hInst=((LPCREATESTRUCT)wea->lParam)->hInstance;
hInstance=LoadLibrary(_T("dllSilvd.dll"));
//Set up pMainWindowData
hHeap=GetProcessHeap();
pMainWindowData=(MAINWINDOWDATA*)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(MAINWINDOWDATA));
if(pMainWindowData)
{
memset(pMainWindowData,NULL,sizeof(MAINWINDOWDATA));
SetWindowLong(wea->hwnd,0,(long)pMainWindowData);
pMainWindowData->hMainWnd=wea->hwnd;
#if defined(MYDEBUG)
_ftprintf(fp,_T("pMainWindowData=%u\r\n"),pMainWindowData);
#endif
.....
.....
.....
}
hWnd=CreateWindow(_T("button"),_T("Reg"),WS_CHILD|WS_VISIBLE,280,176,36,18,wea->hwnd,(HMENU)IDC_REGEN,wea->hInst,0);
hWnd=CreateWindow(_T("button"),_T("Gps"),WS_CHILD|WS_VISIBLE,280,196,36,18,wea->hwnd,(HMENU)IDC_GPS,wea->hInst,0);
hWnd=CreateWindow(_T("button"),_T("Pre. Plt"),WS_CHILD|WS_VISIBLE,210,176,60,18,wea->hwnd,(HMENU)IDC_PREVIOUS,wea->hInst,0);
hWnd=CreateWindow(_T("button"),_T("Next Plt"),WS_CHILD|WS_VISIBLE,210,196,60,18,wea->hwnd,(HMENU)IDC_NEXT,wea->hInst,0);
#if defined(MYDEBUG)
_ftprintf(fp,_T("Leaving fnWndProc_OnCreate()\n\n"));
#endif
return 0;
}
|