This commit is contained in:
恍兮惚兮 2024-12-26 01:10:17 +08:00
parent 163d3321ff
commit 6c9e4e1243
2 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,7 @@ target_link_libraries(winsharedutils tinymp3 rapidfuzz wil webview2 Mfplat mfuui
target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mmdevapi.dll") target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mmdevapi.dll")
target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mfplat.dll") target_link_options(winsharedutils PRIVATE "/DELAYLOAD:Mfplat.dll")
else() else()
target_link_libraries(winsharedutils tinymp3 wil) target_link_libraries(winsharedutils tinymp3)
endif() endif()
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set_target_properties(winsharedutils PROPERTIES OUTPUT_NAME "winsharedutils64") set_target_properties(winsharedutils PROPERTIES OUTPUT_NAME "winsharedutils64")

View File

@ -1,6 +1,7 @@
 #ifndef WINXP
#include <wil/com.h> #include <wil/com.h>
#include <uiautomation.h> #include <uiautomation.h>
#endif
DECLARE_API void showintab(HWND hwnd, bool show, bool tool) DECLARE_API void showintab(HWND hwnd, bool show, bool tool)
{ {
// WS_EX_TOOLWINDOW可以立即生效WS_EX_APPWINDOW必须切换焦点才生效。但是WS_EX_TOOLWINDOW会改变窗口样式因此只对无边框窗口使用。 // WS_EX_TOOLWINDOW可以立即生效WS_EX_APPWINDOW必须切换焦点才生效。但是WS_EX_TOOLWINDOW会改变窗口样式因此只对无边框窗口使用。
@ -160,6 +161,7 @@ DECLARE_API bool check_window_viewable(HWND hwnd)
DECLARE_API void GetSelectedText(void (*cb)(const wchar_t *)) DECLARE_API void GetSelectedText(void (*cb)(const wchar_t *))
{ {
#ifndef WINXP
CoInitialize(nullptr); CoInitialize(nullptr);
try try
{ {
@ -213,4 +215,5 @@ DECLARE_API void GetSelectedText(void (*cb)(const wchar_t *))
printf(e.what()); printf(e.what());
} }
CoUninitialize(); CoUninitialize();
#endif
} }