From 0f91e55e4eba1bff495e5427f184288fd635e2ac Mon Sep 17 00:00:00 2001 From: WRC Date: Sat, 7 Sep 2024 12:34:18 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E5=92=8C=E8=B0=83=E8=AF=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uiaccess/resource.h | 8 --- uiaccess/resource.rc | 21 ------ uiaccess/test.c | 104 ------------------------------ uiaccess/uiaccess.vcxproj | 7 +- uiaccess/uiaccess.vcxproj.filters | 7 +- 5 files changed, 4 insertions(+), 143 deletions(-) delete mode 100644 uiaccess/resource.h delete mode 100644 uiaccess/resource.rc delete mode 100644 uiaccess/test.c diff --git a/uiaccess/resource.h b/uiaccess/resource.h deleted file mode 100644 index 21ea282..0000000 --- a/uiaccess/resource.h +++ /dev/null @@ -1,8 +0,0 @@ - -#define IDD_MAIN 100 -#define IDC_MAIN_UIACCESS 101 -#define IDC_MAIN_TOP 102 -#define IDC_MAIN_OPEN_TASKMGR 103 -#define IDC_MAIN_LBL_CMD 104 -#define IDC_MAIN_CMD 105 - diff --git a/uiaccess/resource.rc b/uiaccess/resource.rc deleted file mode 100644 index b3fe91a..0000000 --- a/uiaccess/resource.rc +++ /dev/null @@ -1,21 +0,0 @@ -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -#include "winres.h" -#undef APSTUDIO_READONLY_SYMBOLS - -1 RT_MANIFEST MOVEABLE PURE ".manifest" - -IDD_MAIN DIALOGEX 0, 0, 250, 150 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_CAPTION | WS_SYSMENU -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -CAPTION "UIAccess demo" -BEGIN - DEFPUSHBUTTON "&Close",IDOK,200,126,40,14 - CONTROL "&UIAccess",IDC_MAIN_UIACCESS,"Button",BS_3STATE|WS_DISABLED|WS_TABSTOP,10,10,120,16 - CHECKBOX "&Always on top",IDC_MAIN_TOP,10,30,120,16 - PUSHBUTTON "&Open Task Manager",IDC_MAIN_OPEN_TASKMGR,10,50,120,14 - LTEXT "Co&mmand Line:",IDC_MAIN_LBL_CMD,10,70,120,14,0 - EDITTEXT IDC_MAIN_CMD,10,84,230,14,ES_AUTOHSCROLL|ES_READONLY -END - diff --git a/uiaccess/test.c b/uiaccess/test.c deleted file mode 100644 index 7c2f5a5..0000000 --- a/uiaccess/test.c +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include -#include "uiaccess.h" -#include "resource.h" - -static HINSTANCE g_hInstance; -static HWND g_hdlg = NULL; -static BOOL g_fHasUIAccess; -static BOOL g_fAlwaysTop = TRUE; - -static void SetTopmostStatus(BOOL fAlwaysTop) -{ - DWORD dwFlags, dwExStyle; - HWND hwndIns; - - dwFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE; - hwndIns = fAlwaysTop ? HWND_TOPMOST : HWND_NOTOPMOST; - SetWindowPos(g_hdlg, hwndIns, 0, 0, 0, 0, dwFlags); - - dwExStyle = (DWORD)GetWindowLongPtr(g_hdlg, GWL_EXSTYLE); - g_fAlwaysTop = dwExStyle & WS_EX_TOPMOST; - CheckDlgButton(g_hdlg, IDC_MAIN_TOP, g_fAlwaysTop); -} - -static INT_PTR CALLBACK DialogProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam){ - switch (uMsg){ - case WM_COMMAND: - { - UINT id = LOWORD(wParam), code = HIWORD(wParam); - switch (id){ - case IDOK: - case IDCANCEL: - EndDialog(hdlg, id); - break; - - case IDC_MAIN_TOP: - SetTopmostStatus(!g_fAlwaysTop); - break; - - case IDC_MAIN_OPEN_TASKMGR: - ShellExecute(NULL, NULL, TEXT("taskmgr"), NULL, NULL, SW_SHOWDEFAULT); - break; - - } - } - return 0; - - case WM_INITDIALOG: - g_hdlg = hdlg; - CheckDlgButton(hdlg, IDC_MAIN_UIACCESS, g_fHasUIAccess); - SetTopmostStatus(g_fAlwaysTop); - SetDlgItemText(hdlg, IDC_MAIN_CMD, GetCommandLine()); - return TRUE; - - } - return FALSE; -} - -static int InitInstance(HINSTANCE hInstance) -{ - DWORD dwErr; - INT_PTR iResult; - - dbgstart(); - - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); - - dwErr = PrepareForUIAccess(); - if (ERROR_SUCCESS != dwErr) - dbg("UIAccess error: 0x%08X\n", dwErr); - g_fHasUIAccess = ERROR_SUCCESS == dwErr; - - g_hInstance = hInstance; - - iResult = DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc); - g_hdlg = NULL; - - CoUninitialize(); - - dbgend(); - - return (int)iResult; -} - -#ifdef MYTOOLCHAIN -void main(){ - ExitProcess(InitInstance(GetModuleHandle(NULL))); -} - -#else -int APIENTRY _tWinMain( - _In_ HINSTANCE hInstance, - _In_opt_ HINSTANCE hPrevInstance, - _In_ LPTSTR lpCmdLine, - _In_ int nCmdShow -) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - UNREFERENCED_PARAMETER(nCmdShow); - return InitInstance(hInstance); -} -#endif - diff --git a/uiaccess/uiaccess.vcxproj b/uiaccess/uiaccess.vcxproj index 30bc3a2..e779602 100644 --- a/uiaccess/uiaccess.vcxproj +++ b/uiaccess/uiaccess.vcxproj @@ -130,7 +130,7 @@ Windows true true - true + false @@ -147,18 +147,17 @@ Windows true true - true + false - - + diff --git a/uiaccess/uiaccess.vcxproj.filters b/uiaccess/uiaccess.vcxproj.filters index 12d28cd..49595d4 100644 --- a/uiaccess/uiaccess.vcxproj.filters +++ b/uiaccess/uiaccess.vcxproj.filters @@ -20,16 +20,11 @@ - - 源文件 - 源文件 - - 资源文件 - + \ No newline at end of file