| 268 | } |
| 269 | |
| 270 | void SetThisThreadName(const QString& s) |
| 271 | { |
| 272 | using SetThreadDescriptionType = HRESULT(HANDLE hThread, PCWSTR lpThreadDescription); |
| 273 | |
| 274 | static SetThreadDescriptionType* SetThreadDescription = [] { |
| 275 | SetThreadDescriptionType* p = nullptr; |
| 276 | |
| 277 | env::LibraryPtr kernel32(LoadLibraryW(L"kernel32.dll")); |
| 278 | if (!kernel32) { |
| 279 | return p; |
| 280 | } |
| 281 | |
| 282 | p = reinterpret_cast<SetThreadDescriptionType*>( |
| 283 | GetProcAddress(kernel32.get(), "SetThreadDescription")); |
| 284 | |
| 285 | return p; |
| 286 | }(); |
| 287 | |
| 288 | if (SetThreadDescription) { |
| 289 | SetThreadDescription(GetCurrentThread(), s.toStdWString().c_str()); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | char shortcutChar(const QAction* a) |
| 294 | { |