| 1.5 int CALLBACK ModalDlgProc(HWND hwnd, UINT message, | | 2.5 WPARAM wParam, LPARAM lParam) | | 3.5 static HDC hDC; | | 4.5 PAINTSTRUCT psPaint; | | 5.5 RECT rect; | | 6.5 static HBRUSH hBlackBrush=(HBRUSH)GetStockObject(BLACK_BRUSH), | | 7.5 g_hbrBackground = CreateSolidBrush(RGB(255, 255, 255)); | | 8.5 static HPEN hBlackPen = (HPEN)GetStockObject(BLACK_PEN), | | 9.5 hBlackThickPen = CreatePen(PS_SOLID, 5, RGB(0,0,0)), | | 10.5 hWhitePen = CreatePen(PS_SOLID, (int)0.5, RGB(255, 255, 255)), | | 11.5 hGreyPen = CreatePen(PS_SOLID, (int)0.5, RGB(200, 200, 200)), | | 12.5 hPinkPen = CreatePen(PS_SOLID, (int)0.5, RGB(255, 150, 150)), | | 13.5 hBluePen = CreatePen(PS_SOLID, 1, RGB(0, 0, 255)); | | 14.5 static HFONT fontPotential, fontCaption; | | 15.5 static LOGFONT lf, lf2; | | 16.5 strcpy_s(lf.lfFaceName, "MS Sans Serif"); | | 17.5 lf.lfHeight = 8; | | 18.5 strcpy_s(lf2.lfFaceName, "Century"); | | 19.5 lf2.lfHeight = 18; | | 20.5 lf2.lfWeight = FW_MEDIUM; | | 21.5 char caption = "A simulation model of the motion of charged∖ | | 22.5 particles in the electrostatic field of an immersion lens"; | | 23.5 char bufferLB3, buffer500; | | 24.5 Particle temp; | | 25.5 switch(message) | | 26.5 case WM_INITDIALOG: | | 27.5 hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) | | 28.5 &ThreadProc, NULL, CREATE_SUSPENDED, 0); | | 29.5 if(hThread == NULL) | | 30.5 MessageBox(0,"Error Creating Thread","Message",MB_OK); | | 31.5 return 1; | | 32.5 | | 33.5 hModalDlg = hwnd; | | 34.5 hModelessDlg = CreateDialog(0, "MODELESS_DIALOG", 0, | | 35.5 (DLGPROC)ModelessDlgProc); | | 36.5 SendMessage(GetDlgItem(hwnd, IDC_UpDown), UDM_SETBUDDY, | | 37.5 (WPARAM)GetDlgItem(hwnd,IDC_EDIT_ParticleModelessBox), 0); | | 38.5 SendMessage(GetDlgItem(hwnd,IDC_UpDown), | | 39.5 UDM_SETRANGE, 0, 100); | | 40.5 SendMessage(GetDlgItem(hwnd, IDC_UpDown),UDM_SETPOS,0, 0); | | 41.5 int pLB; | | 42.5 sprintf_s(buffer, "%.2f", temp.W0); | | 43.5 SetDlgItemText(hwnd, IDC_EDIT_W0, buffer); | | 44.5 sprintf_s(buffer, "%.2f", temp.kVy); | | 45.5 SetDlgItemText(hwnd, IDC_EDIT_kVy, buffer); | | 46.5 sprintf_s(buffer, "%d", 0); | | 47.5 SetDlgItemText(hwnd, IDC_EDIT_PartNum, buffer); | | 48.5 SendMessage(GetDlgItem(hwnd, IDC_Trackbar), TBM_SETRANGE, | | 49.5 TRUE, MAKELONG(0, 1000)); | | 50.5 SendMessage(GetDlgItem(hwnd, IDC_Trackbar), TBM_SETPOS, | | 51.5 TRUE, 200); | | 52.5 sleep = SendMessage(GetDlgItem(hwnd, IDC_Trackbar), | | 53.5 TBM_GETPOS, 0, 0); | | 54.5 sprintf_s(buffer, "%d", sleep); | | 55.5 SetDlgItemText(hwnd, IDC_EDIT_Sleep, buffer); | | 56.5 break; |
|