1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #define WIN32_LEAN_AND_MEAN
15 extern "C" __declspec(dllexport
) UINT __stdcall
SortTree(MSIHANDLE
)
17 // Sort items (languages) in SelectionTree control, fdo#46355
19 HWND hwndMSI
= FindWindowW(L
"MsiDialogCloseClass", nullptr);
20 if (hwndMSI
== nullptr)
22 OutputDebugStringW(L
"SortTree: MsiDialogCloseClass not found\n");
25 HWND hwndTV
= FindWindowExW(hwndMSI
, nullptr, L
"SysTreeView32", nullptr);
26 if (hwndTV
== nullptr)
28 OutputDebugStringW(L
"SortTree: SysTreeView32 not found\n");
31 HTREEITEM optional
= TreeView_GetRoot(hwndTV
);
32 if (optional
== nullptr)
34 OutputDebugStringW(L
"SortTree: Optional Components branch not found\n");
37 HTREEITEM dicts
= TreeView_GetChild(hwndTV
, optional
);
40 OutputDebugStringW(L
"SortTree: Dictionaries branch not found\n");
43 TreeView_SortChildren(hwndTV
, dicts
, TRUE
);
44 HTREEITEM langs
= TreeView_GetNextSibling(hwndTV
, optional
);
47 OutputDebugStringW(L
"SortTree: Additional UI Languages branch not found\n");
50 TreeView_SortChildren(hwndTV
, langs
, TRUE
);
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */