X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/73c04bcfe1096173b00431f0cdc742894b15eef0..4f1e1a09ce4daed860e35d359ce2fceccb0764e8:/icuSources/samples/layout/layout.cpp?ds=sidebyside diff --git a/icuSources/samples/layout/layout.cpp b/icuSources/samples/layout/layout.cpp index 332e03d9..009a055d 100644 --- a/icuSources/samples/layout/layout.cpp +++ b/icuSources/samples/layout/layout.cpp @@ -1,7 +1,13 @@ /* ******************************************************************************* * - * Copyright (C) 1999-2005, International Business Machines + * © 2016 and later: Unicode, Inc. and others. + * License & terms of use: http://www.unicode.org/copyright.html#License + * + ******************************************************************************* + ******************************************************************************* + * + * Copyright (C) 1999-2007, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -146,7 +152,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) context->height = 400; context->paragraph = Paragraph::paragraphFactory("Sample.txt", font, guiSupport); - SetWindowLong(hwnd, 0, (LONG) context); + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) context); windowCount += 1; ReleaseDC(hwnd, hdc); @@ -157,7 +163,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_SIZE: { - context = (Context *) GetWindowLong(hwnd, 0); + context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA); context->width = LOWORD(lParam); context->height = HIWORD(lParam); @@ -214,7 +220,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetScrollInfo(hwnd, SB_VERT, &si, TRUE); GetScrollInfo(hwnd, SB_VERT, &si); - context = (Context *) GetWindowLong(hwnd, 0); + context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (context->paragraph != NULL && si.nPos != vertPos) { ScrollWindow(hwnd, 0, context->paragraph->getLineHeight() * (vertPos - si.nPos), NULL, NULL); @@ -239,7 +245,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) firstLine = si.nPos; - context = (Context *) GetWindowLong(hwnd, 0); + context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (context->paragraph != NULL) { surface->setHDC(hdc); @@ -295,7 +301,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) Paragraph *newParagraph = Paragraph::paragraphFactory(szFileName, font, guiSupport); if (newParagraph != NULL) { - context = (Context *) GetWindowLong(hwnd, 0); + context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (context->paragraph != NULL) { delete context->paragraph; @@ -332,7 +338,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { - context = (Context *) GetWindowLong(hwnd, 0); + context = (Context *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (context != NULL && context->paragraph != NULL) { delete context->paragraph;