如果在你调用"TouchCalibrate"后编译出错或者调用不成功的话可以自己收到加载此函数如:
typedef BOOL (WINAPI *_TouchCalibrate)(); HINSTANCE hinstance = LoadLibrary(_T("coredll.dll")); if (hinstance == NULL) { return; } //定义一个函数指针 _TouchCalibrate TouchCalibrate = NULL; //获取函数入口地址 TouchCalibrate = (_TouchCalibrate)GetProcAddress(hinstance , L"TouchCalibrate"); if (TouchCalibrate == NULL) { return; } TouchCalibrate (); FreeLibrary(hinstance );
static void TouchCalibrateDrawScreenText( HDC hdc, int cLines, UINT IdStringBase ) { int VertSpacing = 0; TCHAR buf[C_CALIBRATION_MSG_BUF_CHARS]; int cChars; int xText, yText; SIZE Size; int i; // Clear the screen. Rectangle(hdc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); //-----加载位图-----lanyzh-Str----------------------------------------- HDC hdcImage = CreateCompatibleDC(hdc); HBITMAP hbm = NULL; hbm = SHLoadDIBitmap(L"\\Nand flash\\APP\\UI\\BT_Background.bmp"); if (hbm != NULL && hdcImage != NULL) { BITMAP bm; SelectObject(hdcImage, hbm); GetObject(hbm, sizeof(bm), &bm); StretchBlt(hdc, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), hdcImage, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); DeleteObject(hbm); hbm = NULL; DeleteObject(hdcImage); hdcImage = NULL; } //-------------------End----------------------------------------- // Display each line of instructions. for ( i = 0; i < cLines; i++ ) { if ( LoadString(s_hinst, IdStringBase+i, buf, C_CALIBRATION_MSG_BUF_CHARS) == 0 ) { continue; } cChars = _tcslen(buf); // Figure text position. TextSize(hdc, buf, cChars, &Size); xText = GetSystemMetrics(SM_CXSCREEN)/2 - Size.cx/2; // Center horizontally // If first pass through, figure vertical spacing, // else just skip to the next line. if ( VertSpacing == 0 ) { VertSpacing = Size.cy + Size.cy/10; yText = VertSpacing; // Skip a line at the top } else { yText += VertSpacing; } // Draw this line. ExtTextOut( hdc, xText, yText, NULL, NULL, // rectangle options buf, cChars, NULL); } return; }