Compare commits

..

72 Commits

Author SHA1 Message Date
Justin Miller
f185623343 t 2025-06-19 16:59:12 -07:00
Eric Kohl
15e69dbf34 [DEVMGR] Fix the device manager
- Revert changes to the wine debug macros.
- Enable grayed the Resource By Type menu items.
2025-06-19 23:08:25 +02:00
Eric Kohl
87d2179956 [DEVMGR] Implement the Resources By Type view
TODO:
- Add resource type icon
- Fix the context menu
2025-06-19 22:32:28 +02:00
Whindmar Saksit
59e556f3f3 [SHELL32] Implement DragDropHandlers shell extension context menus (#8143)
CORE-11240 CORE-11238
2025-06-19 20:54:28 +02:00
Timo Kreuzer
06414ac85a [KERNEL32_VISTA] Implement IsValidLocaleName 2025-06-19 17:36:40 +00:00
Timo Kreuzer
a8987adb67 [KERNEL32_VISTA] Move GetLocaleInfoEx from locale.c into a separate file
This allows to have it in kernel32_vista
2025-06-19 17:36:40 +00:00
Timo Kreuzer
c37310b4e0 [KERNEL32_APITEST] Add tests for GetLocaleInfoEx 2025-06-19 17:36:40 +00:00
Timo Kreuzer
5225c75d3b [KERNEL32_VISTA] Move EnumSystemLocalesEx from locale.c into a separate file
This allows to have it in kernel32_vista
2025-06-19 17:36:40 +00:00
Timo Kreuzer
48ec990a49 [KERNEL32_VISTA] Implement LCIDToLocaleName 2025-06-19 17:36:40 +00:00
Timo Kreuzer
7c1b7ee87d [KERNEL32_VISTA] Implement LocaleNameToLCID 2025-06-19 17:36:40 +00:00
Timo Kreuzer
fa79aaa0f3 [KERNEL32_APITEST] Add tests for LocaleNameToLCID 2025-06-19 17:36:40 +00:00
Timo Kreuzer
be1cd6987b [KERNEL32_APITEST] Add a test for LCMapString 2025-06-19 17:36:40 +00:00
Timo Kreuzer
e83eccee31 [KERNEL32] Zero out CPINFO in GetCPInfo 2025-06-19 17:36:40 +00:00
Timo Kreuzer
2bec8c9d4c [KERNEL32_APITEST] Add tests for GetCPInfo 2025-06-19 17:36:40 +00:00
Timo Kreuzer
c495e0d727 ]HIVESYS] Add missing NLS files to registry 2025-06-19 17:36:40 +00:00
Timo Kreuzer
189ce2a5a6 [KERNEL32_VISTA] Implement GetUserDefaultLocaleName 2025-06-19 17:36:40 +00:00
Timo Kreuzer
d5286af2e1 [NTDLL_VISTA] Export RtlLcidToLocaleName and RtlLocaleNameToLcid 2025-06-19 17:36:40 +00:00
Timo Kreuzer
942d362ff8 [NTDLL_APITEST] Add another test for RtlLocaleNameToLcid 2025-06-19 17:36:40 +00:00
Serge Gautherie
9832737843 [NTDLL_WINETEST][NTOS:PS] Fix a few NtQueryInformationProcess(Process*) handling cases (#8136)
* [NTDLL_WINETEST] `test_query_process_debug_object_handle()`: one WINESYNC

Cherry-pick WineTest part of:
52d733b5c4
server: Implement retrieving the debug object of a process.
by: Alexandre Julliard <julliard@winehq.org>

* [NTOS:PS] Fix `NtQueryInformationProcess(ProcessDebugObjectHandle)`

Close the retrieved `DebugPort` on failure.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] Optimize `NtQueryInformationProcess(ProcessWow64Information)` on 32-bit.

No need to do the ExAcquire/ReleaseRundownProtection rigamarole since
we aren't retrieving the `Process->Wow64Process` on 32-bit builds.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] Fix `NtQueryInformationProcess(ProcessExecuteFlags)`

s/return/break/ on a failure case.
Addendum to commit 1e172203a (r55734).

* [NTOS:PS] NtQueryInformationProcess(): Optimize `*ReturnLength` assignment

Enter the SEH block only if we know we'll have to set `*ReturnLength` on return.
Addendum to commit 2278c2914 (r23175).
2025-06-19 18:47:31 +02:00
Hermès Bélusca-Maïto
b8c5e9c209 [WINLOGON] Check whether error popups should be shown if loading user profile fails (#8139)
Respect the `"NoPopupsOnBoot"` REG_DWORD value in `HKLM\System\CurrentControlSet\Control\Windows`
https://www.visualautomation.com/comprod/secure6/nopopups.htm
2025-06-19 16:09:31 +02:00
Hermès Bélusca-Maïto
cbf3e61d63 [USERENV] Implement error reporting via error dialog (#8139)
This feature is used to report errors when `LoadUserProfile()` fails.
It is also meant to be used by other functions in the future.

The error dialog is shown only when the `PI_NOUI` flag is _NOT_ set
in `PROFILEINFO::dwFlags`.

- Add support for retrieving USERENV-specific registry policies,
  in a systematic way.

- Add support for "timed" dialogs that automatically close after
  a given timeout has elapsed.
  The default timeout is controlled by the `"ProfileDlgTimeOut"` policy:
  https://www.visualautomation.com/comprod/secure6/profile_.htm
  https://www.infania.net/misc/kbarchive/kb/196/Q196284/index.html

- TODO for the future: report the error in the event log.

- `LoadUserProfileW()`: Reset `ret` to `FALSE` after the call to
  `CreateUserProfileW()`; this allows to return failure in case
  any other function calls down the line fails. (`ret` is set to
  `TRUE` only when everything has succeeded.)
2025-06-19 16:09:30 +02:00
Katayama Hirofumi MZ
3a96c90c54 [NTUSER][USER32] Re-implement WM_POPUPSYSTEMMENU message (#8144)
This PR resolves a bug of #8094. #8094
correctly validates the flags. TPM_SYSTEM_MENU is an internal flag
and not a valid flag for TrackPopupMenu.
Thus, calling TrackPopupMenu.TPM_SYSTEM_MENU
in User32DefWindowProc was wrong.
This caused failure of taskbar context
menu.

JIRA issue: CORE-20238

- Move WM_POPUPSYSTEMMENU
  message handling of user32 into
  win32k.sys!IntDefWindowProc.
- Use win32k.sys!IntTrackPopupMenuEx
  instead of user32!TrackPopupMenu
  in handling of WM_POPUPSYSTEMMENU.
2025-06-19 22:59:27 +09:00
Eric Kohl
9853869a79 [SETUPAPI] Implement CM_Get_Device_Interface_Alias_ExA 2025-06-19 12:48:55 +02:00
Serge Gautherie
4f7e9dc2ed [NTOS:PS] Fix NtQueryInformationProcess(ProcessImageInformation) (#8134)
Do not overwrite Status failure value.

Addendum to commit bf493b93a (r59859).
2025-06-19 12:23:32 +02:00
Eric Kohl
44da696ad7 [UMPNPMGR] Fix PNP_GetInterfaceDeviceAlias
Pass Parameters to NtPlugPlayControl.
2025-06-19 11:49:56 +02:00
Eric Kohl
0b1a448150 [NTOS:PNP] Implement NtPlugPlayControl.PlugPlayControlGetInterfaceDeviceAlias 2025-06-19 11:06:20 +02:00
Adam Słaboń
81a4d8344b [NTOS:SE] SeValidSecurityDescriptor: Use relative security descriptor header size for length calculation (#8127)
Fixes Win2k3 ntfs.sys on x64
2025-06-18 23:55:27 +02:00
Dmitry Borisov
b5f763447c [COMCTL32] Fix product verison (#7854)
Specify the correct comctl version to fix tooltips in SIV software.
2025-06-18 20:54:44 +02:00
Whindmar Saksit
8ff8f676b3 [SYSDM][BROWSEUI][SHELL32][SDK] Added Advanced Performance Options property sheets (#8029) 2025-06-18 17:46:38 +02:00
Carl J. Bialorucki
bf734eb002 [APPHELP_APITEST] Fix test failures on Vista, 7, 8.1 x86 and x64 (#8122)
* Disable most apphelp:env and some apphelp:db tests on x64 due to structure differences breaking these tests.
* Add new tag lists for Windows 8.1 and Windows 10 in apphelp:apphelp test.
* Make a few changes to accept either Windows 10 or Windows 8.1 and older behavior in apphelp:apphelp test.
* Create new shimdata structures for Windows 8 and Windows Vista.
* Add attribute size definitions for Vista, 8.1, and 10.
* Create new shim data validation functions for Vista and 8.1.
* Use local time instead of UTC time for shim db version. This fixes test failures when the day in local time and the day in UTC are different.
2025-06-17 11:18:32 -06:00
Mikhail Tyukin
ae4d4544d9 [MSWSOCK] Fix integer overflow (#8141)
Fix integer overflow in mswsock which could result in a crash in ws2_32.dll when using x64 builds.
2025-06-17 16:45:44 +02:00
Katayama Hirofumi MZ
13e7f56754 [INDICDLL] Don't use WH_KEYBOARD_LL but WH_KEYBOARD (#8142)
- Replace WH_KEYBOARD_LL hook and
  handler with WH_KEYBOARD and
  adapted KeyboardProc.
- Update key-state checks to use
  HIWORD(lParam) flags and
  GetKeyState.
2025-06-17 18:44:15 +09:00
Katayama Hirofumi MZ
e26ad0de12 [MSCTF] Translate ITfDocumentMgr into C++ (#8120)
Implementing missing features...
JIRA issue: CORE-19361
- Delete documentmgr.c and add
  documentmgr.cpp.
- Make ITfDocumentMgr and
  IEnumTfContexts C++ code.
2025-06-17 07:08:42 +09:00
Eric Kohl
44d99fa60f [UMPNPMGR][NDK] Implement PNP_GetInterfaceDeviceAlias 2025-06-16 23:51:12 +02:00
Vitaly Orekhov
26368a1ead [PSDK] Enumerate WPA3 algorithms in DOT11_AUTH_ALGORITHM (#8129)
Reference: https://learn.microsoft.com/en-us/windows/win32/nativewifi/dot11-auth-algorithm

CORE-6905
2025-06-16 21:57:48 +02:00
Serge Gautherie
824fae4cb1 [SYSSETUP] wizard.c!UnattendSetup: Fix Theme page order (#8098)
Especially, unskip DateTime page.

Addendum to commit fc1f0c2088 (r75495).
CORE-15848
2025-06-16 21:55:57 +02:00
Whindmar Saksit
a3b032b118 [SHELL32] Fix IShellExecuteHookW (#8097) 2025-06-16 21:47:45 +02:00
Timo Kreuzer
c0b4a2cab0 [NTDLL_APITEST] Fix unreliable test for NtContinue
Some EFLAGS bits depend on the hardware / OS environments.
2025-06-16 16:47:41 +00:00
Hermès Bélusca-Maïto
82a57e41e1 [WINLOGON] Correctly reset LogonState in case logon or shutdown fails (#8133)
CORE-18351 CORE-18237 CORE-17137 CORE-16567
CORE-15360 CORE-5071 CORE-3804

Reset `LogonState` back to `STATE_LOGGED_OFF` before invoking
`WlxDisplaySASNotice()` when:
- in `STATE_LOGGED_OFF_SAS` state, `HandleLogon()` failed;
- or when an attempted shutdown operation failed.

This fixes the resulting inconsistent `LogonState` that happened if
any of these operations failed due to legitimate reasons. For example,
a corrupted user profile that caused the login attempt to abort, or,
an ongoing shutdown attempt being aborted as well.

One of the user-visible effects of this inconsistency, was the inability
to access the familiar Logged-Out SAS dialog by pressing Ctrl-Alt-Del at
the invite (SAS notice) dialog, because the `LogonState` was incorrectly
left into the `STATE_LOGGED_OFF_SAS` state, instead of being reset to
`STATE_LOGGED_OFF`.

----

Typical scenario:
The "Administrator" user, who is auto-logged-in by default after the
installation, gets a corrupted ntuser.dat profile registry hive if the
2nd-stage installation is aborted at the end by force-restarting ReactOS.
After reboot, ReactOS tries to log into the account, but fails, and goes
back to the Ctrl-Alt-Del invite dialog.
Before this fix, the user couldn't go into the Logged-Out SAS dialog to
enter new login credentials and attempt login to another account.
This is now fixed.
2025-06-16 14:16:47 +02:00
Hermès Bélusca-Maïto
545f9cebb2 [WINLOGON] Allow workstation (un)locking only if we are in the correct LogonState (#8132)
- Locking (`WLX_SAS_ACTION_LOCK_WKSTA`) is allowed only if `LogonState`
  is either `STATE_LOGGED_ON` or `STATE_LOGGED_ON_SAS`, i.e., either the
  user invokes the `user32:LockWorkStation()` API or presses Win-L, or,
  opens the Logged-On SAS dialog then clicks on the "Lock Workstation" button.

- Unlocking (`WLX_SAS_ACTION_UNLOCK_WKSTA`) is allowed only if
  `LogonState` is either `STATE_LOCKED` or `STATE_LOCKED_SAS`,
  i.e., the workstation is locked and we are either on the Locked-
  notice or on the SAS dialog that asks for the user credentials.

Additionally:

- Fix the invocation order of `LockHandler`/`UnlockHandler` notifications:
  * the `LockHandler` is invoked on the Winlogon desktop, just before
    displaying the Locked-notice dialog;
  * the `UnlockHandler` is invoked on the Winlogon desktop, just before
    switching back to the user's desktop.

- If we are on the Logged-On SAS dialog and the user presses Win-L to
  lock the workstation (instead of pressing the corresponding dialog
  button), the `DoGenericAction(WLX_SAS_ACTION_LOCK_WKSTA)` handler is
  invoked asynchronously while the SAS dialog is still being displayed.
  We thus need to ensure all the existing dialogs are closed before
  displaying the Locked-notice dialog, in order to avoid stray dialogs
  being shown concurrently.
2025-06-16 14:11:42 +02:00
Hermès Bélusca-Maïto
b0fbeb6801 [WINLOGON][MSGINA] Improve WLX_SAS_ACTION_TASKLIST handling in logged-on/logged-on SAS states (#8131)
CORE-13478
Addendum to commit 46dcab7ab.

The `WLX_SAS_ACTION_TASKLIST` action can be invoked in three scenarii to
open the Task-Manager:

1. from the logged-on state (`LogonState == STATE_LOGGED_ON`), when the
   user presses Ctrl-Shift-Esc while being on its own desktop (usual case);

2. from the Logged-On SAS dialog (`LogonState == STATE_LOGGED_ON_SAS`),
   when the user presses the "Task-Manager" button: here Winlogon should
   switch back to the user's desktop, restoring `STATE_LOGGED_ON` and
   start the TaskMgr;

3. or when the user presses Ctrl-Shift-Esc **while being on the Logged-On
   SAS dialog**: in this case, the Task-Manager is started on the
   currently-hidden user's desktop (and so, will be hidden), but the SAS
   dialog stays open. The user will see the opened TaskMgr once (s)he
   closes the SAS dialog and Winlogon switches back to the user's desktop.

In order to support these scenarii, the `WLX_SAS_ACTION_TASKLIST` action
handling is reworked:

- `SASWindowProc(WM_HOTKEY, IDHK_CTRL_SHIFT_ESC)` always invokes the
  `DoGenericAction(WLX_SAS_ACTION_TASKLIST)`: this allows centralizing
  inside `DoGenericAction()` the condition checks for starting TaskMgr.

- `DoGenericAction(WLX_SAS_ACTION_TASKLIST)` just starts the Task-Manager
  only if the Winlogon's `LogonState` is either `STATE_LOGGED_ON` or
  `STATE_LOGGED_ON_SAS`. It doesn't attempt there to switch desktops nor
  change the `LogonState` value, in order to support scenarii 2 and 3.

- The switch from/to Winlogon/user's desktops when going to the
  `LogonState: STATE_LOGGED_ON -> STATE_LOGGED_ON_SAS` change is done
  in `DispatchSAS()`, just before invoking the GINA's `WlxLoggedOnSAS()`
  (see below for more details) and just after it returns, only in the
  necessary cases.

----

[MSGINA] The WlxLoggedOnSAS() dialog shouldn't switch the desktops itself.

This behaviour can be observed on Windows with Winlogon debugging + tracing
enabled. It is Winlogon instead that does the desktop switch itself, as for
all the other SAS dialogs, in addition to changing its internal `LogonState`.

Fix for commit 7aecedf79 (r58785).
2025-06-16 14:04:33 +02:00
Hermès Bélusca-Maïto
a8c5f55315 [WINLOGON] Invoke NtShutdownSystem() with an adequate shutdown action (#8130)
Specify a shutdown action value corresponding to the
`WLX_SAS_ACTION_SHUTDOWN_*` ones.
2025-06-16 14:02:55 +02:00
Hermès Bélusca-Maïto
b3e56c95ef [WINLOGON] WlxSwitchDesktopToUser/Winlogon(): ensure the calling thread is assigned the specified desktop (#8130)
Invoke SetThreadDesktop() after a successful SwitchDesktop() call.
2025-06-16 14:02:55 +02:00
Hermès Bélusca-Maïto
14894f2e27 [WINLOGON] DefaultWlxWindowProc(WLX_WM_SAS): return an adequate WLX_DLG_* value (#8130)
For more details, see:
https://learn.microsoft.com/en-us/windows/win32/api/winwlx/nc-winwlx-pwlx_dialog_box_indirect_param#return-value
2025-06-16 14:02:49 +02:00
Katayama Hirofumi MZ
24b2c4be8c [INF] intl.inf: Add [KbdLayoutIds] section (#8115)
Win2K internat.exe uses this section.
WinXP and Win2k3 have this section.
JIRA issue: CORE-19268
- Add [KbdLayoutIds] section and add values to intl.inf.
- Add some missing "Layout Id" for "SYSTEM\
  CurrentControlSet\Control\Keyboard Layouts" of
  hivesys.inf.
2025-06-16 17:16:19 +09:00
Katayama Hirofumi MZ
1ece139178 [SHLWAPI][SHLWAPI_APITEST][SDK] Support MayExecForward + MayQSForward (#8125)
Follow-up of #8124. Implementing missing features...
JIRA issue: CORE-19278
- Implement MayExecForward and MayQSForward
  functions.
- Modify these prototypes in <shlwapi_undoc.h>.
- Add tests to shlwapi_apitest IsQSForward.
2025-06-16 07:31:47 +09:00
Eric Kohl
37cc1e2fd6 [NTOS:IO] Move location paths code because they are not stored in the registry 2025-06-15 23:36:53 +02:00
Oleg Dubinskiy
42aaad43db [OLEAUT32][OLEAUT32_WINETEST] Import LPSAFEARRAY user marshal interface marshaling support from Wine (#8121)
Import the following Wine commits:
oleaut32: Implement LPSAFEARRAY user marshal interface marshaling.
a1f2b44a1b
oleaut32/tests: Add tests for LPSAFEARRAY user marshal interface marshaling.
b2574278f7
containing the implementation itself and a test for it.
Fixes:
1) improperly displayed comboboxes with OS type and version selection,
2) failure to save/load virtual machine settings in/from XML file
in VirtualBox 3.0.0 - 4.0.36 versions and
3) improperly displayed comboboxes in 3DMark2001.
As result, this also allows to create and start a virtual machine(s) in VirtualBox up to 3.0.8 version. For newer VirtualBox versions, another fix is required.
CORE-8418, CORE-11254, CORE-14507, CORE-17980, CORE-18496, CORE-20015
2025-06-15 16:08:51 +02:00
Katayama Hirofumi MZ
4e7702a6a9 [EXPLORER] Add fullscreen handling (#8105)
Adds support for handling fullscreen
applications (a.k.a. “rude apps”) so
the taskbar can hide or show
appropriately.

JIRA issue: CORE-11242, CORE-15681,
CORE-16056, CORE-16063, CORE-16131,
CORE-16132, CORE-16192, CORE-16196,
CORE-16249, CORE-16290, CORE-16313,
CORE-16320, CORE-16322, CORE-16347,
CORE-16584, CORE-19795, CORE-9862,
CORE-16230, CORE-10738, 
and CORE-12263.

- Removes legacy pulse/timer logic in
  the tray window and adds a fullscreen
  notification workflow.
- Implements fullscreen detection
  across monitors in the task switcher,
  using a sequence of validation timers.
- Defines a new ITrayWindow::
  NotifyFullScreenToAppBars interface
  method to broadcast fullscreen state
  to appbars.
2025-06-15 21:20:45 +09:00
Ethan Rodensky
7ec3a7e98b [UXTHEME] Implement various Vista+ functions, mostly from WINE 2025-06-14 18:33:39 -07:00
Katayama Hirofumi MZ
01a6c4874a [MSCTF] CRange: Follow-up of #8096; Fix crash on tests (#8126)
Fix CRASH of msctf:inputprocessor tests.
JIRA issue: CORE-19361
- Implement Range_Constructor and
  TF_SELECTION_to_TS_SELECTION_ACP functions.
- Adapt CRange to these changes.
2025-06-15 09:26:30 +09:00
Katayama Hirofumi MZ
3b73f625b8 [SHLWAPI_APITEST] Follow-up of #8124; Fix IsQSForward testcase
JIRA issue: CORE-19278
2025-06-15 08:14:35 +09:00
Katayama Hirofumi MZ
80381b0578 [SHLWAPI][SHLWAPI_APITEST][SDK] Implement IsQSForward (#8124)
Implementing missing features...
JIRA issue: CORE-19278
- Implement IsQSForward function.
- Modify IsQSForward prototype in <shlwapi_undoc.h>
- Add IsQSForward testcase to shlwapi_apitest.
2025-06-14 20:57:33 +09:00
Katayama Hirofumi MZ
b39cb1229a [SHLWAPI] Implement SHCreateShellPalette (#8123)
Implementing missing features...
JIRA issue: CORE-19278
Implement SHCreateShellPalette function.
2025-06-14 20:27:23 +09:00
Katayama Hirofumi MZ
62ad2403a0 [USER32][COMCTL32] Edit: Optimize EDIT_SetCaretPos for speed (#8113)
The caret move on IME was slow until this PR.
JIRA issue: CORE-19268
- Don't use ImmIsIME but use IS_IME_HKL(hKL) in
  EDIT_SetCaretPos function. This change improves
  the caret speed.
- Prohibit display of composition window for Korean
  in the handling of WM_IME_SETCONTEXT and
  WM_IME_STARTCOMPOSITION, because Korean
  doesn't want it.
2025-06-14 20:26:05 +09:00
Timo Kreuzer
d0ca0f41f7 [MSVCRT_WINETEST] Skip 2 hanging pipe tests on ReactOS 2025-06-14 10:48:15 +00:00
Timo Kreuzer
1fef0ce8de [MSVCRT_WINETEST] Improve msvcrt_winetest
- Reduce diff to wine
- Enable todo_wine
2025-06-14 10:48:15 +00:00
Timo Kreuzer
17289faf7f [WINETEST] Allow to use USE_WINE_TODOS with win_skip 2025-06-14 10:48:15 +00:00
Katayama Hirofumi MZ
c894716295 [MSCTF][SDK] Add CDisplayAttributeMgr stubs (#8116)
Implementing missing features...
JIRA issue: CORE-19361
- Delete displayattributemgr.c and
  add displayattributemgr.cpp.
- Add CDisplayAttributeMgr class
  as stubs.
2025-06-13 05:31:01 +09:00
Katayama Hirofumi MZ
d809cd0f7f [BOOTDATA][NTUSER] Add DontLoadCTFIME and use it (#8110)
Improve CTF IME customization.
Use the proper names for CTF IME.
JIRA issue: CORE-19268
- In the registry key "HKLM\SOFTWARE\Microsoft\
  Windows NT\CurrentVersion\IMM", add
  DontLoadCTFIME value and set it to 1.
- Delete LoadCTFIME value to avoid user
  confusing.
- Rename UserIsCiceroEnabled function
  as UserIsCTFIMEEnabled.
- Rename SRVINFO_CICERO_ENABLED
  flag as SRVINFO_CTFIME_ENABLED.
2025-06-12 13:55:49 +09:00
Katayama Hirofumi MZ
474212939d [KBSWITCH] Handle IME Menu default items (#8101)
Finishing IME menu work. The IME menu of the system
pen icon has to append the default items if DMI_LEFT and
RDMI_RIGHT are not specified.
JIRA issue: CORE-20142
- Add IsRegImeToolbarShown and ShowImeToolbar
  helper functions.
- Add more code into KbSwitch_OnPenIconMsg function
  to handle IME menu default items.
- Add some resource strings.
2025-06-12 09:33:23 +09:00
Doug Lyons
70732b0ca4 [TASKMGR] Work around memory leak in performance tab of taskmgr (#8017)
* [TASKMGR] Work around Taskmgr memory leak by changing heap allocation methodology.
CORE-18014
2025-06-10 18:04:11 -05:00
Katayama Hirofumi MZ
3c35117f97 [NTUSER][USER32_APITEST] TrackPopupMenuEx: Check flags (#8094)
Validate flags.
JIRA issue: CORE-3247
- In NtUserTrackPopupMenuEx function, validate the flags.
- If validation failed, then set last error and return FALSE.
- Add SAL annotations to NtUserTrackPopupMenuEx.
- Keep reference to menu in the function.
- Add TrackPopupMenuEx testcase to user32_apitest.
2025-06-10 21:25:14 +09:00
Katayama Hirofumi MZ
4cf350a716 [IMM32] Use ANSI_NULL and UNICODE_NULL (#8109)
Coding style fix.
JIRA issue: CORE-19268
- Use ANSI_NULL for '\0'.
- Use UNICODE_NULL for L'\0'.
2025-06-10 20:45:23 +09:00
Katayama Hirofumi MZ
5b94656442 [MSCTF][SDK] Add stubs for CRange (#8096)
This PR is just a step, but a slightly
great one for OS development history.
JIRA issue: CORE-19361
- Add IAnchor interface into textstor.idl.
- Fix ITfRangeAnchor interface (that
  was wrong).
- Delete range.c.
- Add range.cpp.
- Add CRange class as stubs.
2025-06-09 23:51:17 +09:00
Katayama Hirofumi MZ
2c124893ec [KBSWITCH] Update indicdll/res/*.ico
CORE-20142
2025-06-09 08:39:55 +09:00
Mikhail Tyukin
b6925bdd6f [RICHED20] Sync to Wine-10.0 (#8078)
[RICHED20] Sync to Wine-10.0
Sync wine/rbtree.h to Wine-10.0 as changes in riched20 require this. Also added a define to allow directx code to compile.
Sync riched20 to Wine-10.0 and its tests using the script.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 9f72c5601173728c52626342a1ec6c9a4c70670f by Francois Gouget <fgouget@free.fr>

Update WINESYNC.txt

Update precomp.h

fix build

[WINESYNC]: riched20 is now in sync with wine-staging wine-10.0

[WINESYNC] riched20: Only call ME_SendRequestResize when control is in-place active.

Prevent GetClientRect from being called when not in-place active.

wine commit id e61db557ab8473a490c84301dbb4b4665b6c9c9f by Charlotte Pabst <cpabst@codeweavers.com>

[WINESYNC] riched20: Exit from editor_ensure_visible when control is not in-place active.

According to microsoft documentation, ScrollWindowEx, SetScrollPos and SetScrollRange may only
be called while the control is in-place active.

This fixes a segmentation fault in an application.

wine commit id dafaadcb4addd9af334433666a4bc2e7aa6eb9ff by Charlotte Pabst <cpabst@codeweavers.com>

[WINESYNC] riched20/tests: Test that ScrollWindowEx and GetClientRect are only called when control is in-place active.

wine commit id f1301cedbea51be107017bb8545956bcfd02b610 by Charlotte Pabst <cpabst@codeweavers.com>

Update editor.c

[WINESYNC] riched20: Release IME input context when done using it.

wine commit id 3f51fb96c162e8d3314627b3db25564fa7d9d419 by Zhiyi Zhang <zzhang@codeweavers.com>

[WINESYNC] riched20: In para_set_fmt protect against out of bound cTabStop values.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56730

wine commit id 7b2ff977739df25252d46552d2447af50c23040e by Fabian Maurer <dark.shadow4@web.de>

Update editor.c

[WINESYNC] riched20: Don't write past end of buffer.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>

wine commit id 5cbe3a6cb186cffed20e3fea5f88abd0880d3914 by Eric Pouech <epouech@codeweavers.com>

[WINESYNC] riched20: Don't crash when no OLE obj is present.

This was generating a lot of crashes in riched20 tests.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>

wine commit id 015aae30cf2217164f631d1c03abfc9ea63bb43d by Eric Pouech <epouech@codeweavers.com>

Update editor.c

[WINESYNC] riched20: Use CRT allocation functions.

wine commit id 42579f1dcd2f14e765e2f53ceb5b46fff5623f10 by Alex Henrie <alexhenrie24@gmail.com>

[WINESYNC] riched20/tests: Make the editor paste test failures more informative and unique.

Knowing the content of the edit field is more useful than knowing the
strcmp() result. The text field may contain carriage returns and
linefeeds so use wine_dbgstr_a() so they are clearly visible in the
failure message.
Also prefix the ok messages with a unique string to indicate which
test_WM_PASTE() test failed.

wine commit id b8950d04e439f649f2167477a36ee453ad8b81ef by Francois Gouget <fgouget@codeweavers.com>

[WINESYNC] riched20: Don't call wrap_marked_paras_dc() before the editor is fully initialized.

Today, CreateTextServices() sometimes triggers an assertion failure in
select_style().

When ME_MakeEditor() calls ME_MakeFirstParagraph(), the editor
(ME_TextEditor) is not in a fully initialized state.  For example, the
font cache (pFontCache) is not fully initialized, which sometimes makes
select_style() believe that the cache slots are fully occupied.

Fix this by delaying the call to wrap_marked_paras_dc() until the editor
is fully initialized.

Also, delay the call to ITextHost::TxReleaseDC() until after
wrap_marked_paras_dc(), since we need the device context a bit longer.

Fixes: b70eb32c5f3e506181d9e1e9fbef62e9baf3674d

wine commit id 548d7179e3b2b9961321a4df50644c9b3874a295 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Factor out device context acquisition from ME_MakeFirstParagraph.

This lets ME_MakeEditor() reuse the device context throughout the editor
initialization process.

wine commit id 03036f42e1afa9c79246dcee6b9fe876286b1aa4 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Don't call ME_UpdateRepaint inside set_selection().

This partially reverts c5daf6a30f21 (riched20: Call ME_UpdateRepaint
instead of editor_ensure_visible in set_selection.)

Fixes: c5daf6a30f21acd20263692b278acba49e014cc1

wine commit id ac5110131493b8b05795e8825285e41ca40ab6f1 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Add tests for change notifications caused by EM_SETSEL{,EX}.

wine commit id c35926e49825f7a3d48ba826085fe1ae3d2a7e27 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Wrap marked paragraphs at Text Services initialization.

Today, CreateTextServices() returns an Rich Edit object without row
start and end marks, which are expected to exist by many Rich Edit
operations as well as EM_* message handlers.

This leads to a crash when certain messages (e.g., EM_SCROLLCARET) are
sent to the Rich Edit object via ITextServices::TxSendMessage(), unless
ME_WrapMarkedParagraphs() has been called beforehand.

Fix this by calling wrap_marked_paras_dc() early in the initialization
process.

This is not a problem for windowed Rich Edit controls, which already
calls ME_WrapMarkedParagraphs() before the user or application starts
interacting with it.

wine commit id b70eb32c5f3e506181d9e1e9fbef62e9baf3674d by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Use nameless unions/structs.

wine commit id 26826d3af8b1969de389f3d6702d7c8b805126e1 by Alexandre Julliard <julliard@winehq.org>

Update editor.h

[WINESYNC] riched20: Remove DECLSPEC_HIDDEN usage.

wine commit id c04ab166498b5841ecde620a9bd0b74969b01596 by Alistair Leslie-Hughes <leslie_alistair@hotmail.com>

[WINESYNC] riched20: Call ME_UpdateRepaint instead of editor_ensure_visible in set_selection.

To prevent cases where ME_WrapMarkedParagraphs has not been called causing a NULL
pointer when editor_ensure_visible tries to get the row from the cursor.

wine commit id c5daf6a30f21acd20263692b278acba49e014cc1 by Santino Mazza <smazza@codeweavers.com>

[WINESYNC] riched20: Update paragraph position in marked tree.

nCharOfs is the key for paragraphs added to the marked tree
If it is updated, re-add the entry to update its position

wine commit id f1aa3f37ef326b7cbf8fc94e982c9f0b398181c4 by Daniel Lehman <dlehman25@gmail.com>

Update editor.c

[WINESYNC] riched20: Update the editor IME position on GCS_RESULTSTR.

So that a GCS_RESULTSTR followed by GCS_COMPSTR, without interruping the
composition, begins inserting the new composition text after the result
instead of before it.

wine commit id de45bc33a73eac5dbc3502b4a43cd48399507c73 by Rémi Bernon <rbernon@codeweavers.com>

[WINESYNC] riched20/tests: Fix a typo in a comment.

wine commit id 145e3c758b9594596835e291b2fcb3c80e4c0479 by Francois Gouget <fgouget@free.fr>

[WINESYNC] riched20/tests: Don't specify DT_WORDBREAK in _check_txgetnaturalsize().

Today, test_TxGetNaturalSize() creates a pop-up window with a fixed size
(extent) of 100 x 100.  The test function then proceeds to compute the
natural size of rich edit control that fits the sample text
"TestSomeText" and compare it to the RECT calculated by DrawText.

Apparently, this test fails if the width of the sample text
"TestSomeText" exceeds the width of the test window's client area.  In
this case, DrawText() with DT_WORDBREAK breaks the text into the two
lines due to text wrapping; however, Rich Edit's
ITextServices::TxGetNaturalSize implementation does not seem to perform
text wrapping on overflow.  This results in extent mismatch.

(Note that the test may either succeed or fail depending on the current
font used for DEFAULT_GUI_FONT, which defaults to Tahoma according to
Microsoft's documentation.  To reproduce this failure, it may be
necessary to switch fonts or change the width of the pop-up window.)

Fix this by omitting the DT_WORDBREAK flag for the DrawText() call in
_check_txgetnaturalsize().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54637

wine commit id f54a1dac64c89aea3fe02ae8c0d6eef43a0aa117 by Jinoh Kang <jinoh.kang.kr@gmail.com>

Update editstr.h

[WINESYNC] riched20: Implement ITextDocument::Freeze and ITextDocument::Unfreeze.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54617

wine commit id 3fe15349d39ccf31026a92eae30f83f65c91cb1f by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Don't assume that TxDraw preserves the device context's brush selection.

Today, RichEditWndProc_common assumes that ITextServices::TxDraw
preserves the brush selection of the given device context.  However,
this invariant may be broken by misbehaving embedded OLE objects in the
text document.

Fix this by not assuming that the return value of the second
SelectObject() call equals the brush passed to the first SelectObject()
call in RichEditWndProc_common's WM_PAINT / WM_PRINTCLIENT case.

wine commit id 2027be7e0370c92595f126a0b0dd167a635d50a2 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Test for ITextDocument::Freeze and ITextDocument::Unfreeze.

wine commit id 3105fad82b9bae390fcd710a2fc10a18988b4622 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Don't set para unless committing cursor move in ME_MoveCursorWords.

Introduce a temporary variable, `other_para`, so that we don't end up
returning incorrect para (with stale run) inside the output cursor.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54564

wine commit id 7e28fa5c558f1417f8f033cb843424778bbfb8b8 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Test for word movement across paragraph boundary.

wine commit id 21d25b17c2cae8eb2d2376ce42b76e3f61eb0bba by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Fix the EM_GETSELTEXT tests in Hindi on Windows.

On Windows EM_GETSELTEXT fails with an invalid parameter error in the
Hindi locale but works in most other locales, including UTF-8 ones.
So check for this issue and adjust the expected results accordingly.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54559
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54565

wine commit id 37cd13abdf5d91c7b3f25b39fa14976bc3a3e3a3 by Francois Gouget <fgouget@codeweavers.com>

[WINESYNC] riched20/tests: EM_GETSELTEXT's wparam is not used and should be 0.

wine commit id baa41970647a7e548701a72bea2e4aa2a61ca27e by Francois Gouget <fgouget@codeweavers.com>

[WINESYNC] riched20/tests: Add context to the EM_FORMATRANGE tests.

wine commit id 020145248371bbfd2e473e79ba873e8313dde72d by Francois Gouget <fgouget@codeweavers.com>

[WINESYNC] riched20/tests: Check clipboard content after destroying the editor window.

Destroying the editor window should render all the formats so they are
still available after.

wine commit id b5b5b0b365639b889a0240d4992e16174b428f75 by Francois Gouget <fgouget@codeweavers.com>

[WINESYNC] riched20/tests: Add retry loop around OpenClipboard() to avoid access denial.

Reusing existing helper from user32 & comctl32.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47888
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>

wine commit id 25743d46f4103c7345c955b87b4134a065fb5f1d by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20/tests: Ensure clipboard has been pasted before testing the result.

The patch does reduce error failures locally.

For the record:
- WM_PASTE in undo operations haven't been transformed (as it requires
  UNDO stack manipulation in a coherent way across platforms)

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47888
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>

wine commit id 4fd5252f635817b431673accaba718c7481f48f6 by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20: Support SFF_SELECTION when streaming in plain text.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>

wine commit id 1b7a918bd7ec8bc2c51bcb76525b56b17c5ff0c0 by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20/tests: Add tests when pasting in plain text mode.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>

wine commit id 82fa1048b5cc7d9c6a2a289403f25adbdd8158c7 by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20: Obtain the composition start index after deleting selection.

Today, the Rich Edit control handles the WM_IME_STARTCOMPOSITION message
by the computing the composition start position (imeStartIndex) _before_
calling ME_DeleteSelection(), which shifts the character positions after
the range of deletion.  If the selection were not empty, imeStartIndex
immediately becomes stale, since it does not take into account the
number of deleted characters before it.

Fix this by computing imeStartIndex after the ME_DeleteSelection() call.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54318

wine commit id 8c43577f0f9b4422d3641457c595c3998bd54a18 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Call GlobalReAlloc with GMEM_MOVEABLE flag.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474

wine commit id dfd44bb979ee2052eceff094083147e9879fa807 by Rémi Bernon <rbernon@codeweavers.com>

[WINESYNC] riched20: Fix failing test in UTF8 locales.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52875
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>

wine commit id 5902cfd2990261189ce9af27981a95ac12fa2a5d by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20: Don't emit EN_CHANGE events during window creation.

wine commit id 5c997de8dc1e4885266fa884a2fb74f840e3bedc by Evan Tang <etang@codeweavers.com>

[WINESYNC] riched20: Add test for EN_CHANGE events during window creation.

GenoPro isn't very happy if it receives one

wine commit id 0b069106b0e0f141d6925d3e10166be89fc59145 by Evan Tang <etang@codeweavers.com>

[WINESYNC] riched20: Move test class creation to a helper function.

wine commit id f9083961ed187777d660796f7136addc04fff8b0 by Evan Tang <etang@codeweavers.com>

[WINESYNC] riched20/tests: Use ARRAY_SIZE instead of open coding it.

wine commit id 90b6288f54afdc4430dac146779a92b89f4d1219 by Michael Stefaniuc <mstefani@winehq.org>

[WINESYNC] riched20/test: Add scrolling test for richole.

Signed-off-by: Santino Mazza <mazzasantino1206@gmail.com>

wine commit id 059c70d736baa164a1b246e949acd006cf83ab5a by Santino Mazza <mazzasantino1206@gmail.com>

[WINESYNC] riched20: Ensure that cursor is visible when selecting text.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40444
Signed-off-by: Santino Mazza <mazzasantino1206@gmail.com>

wine commit id 25209c162fc209124b369abbad55d915d31909b2 by Santino Mazza <mazzasantino1206@gmail.com>

[WINESYNC] riched20/tests: When selection is out of view, the scrollbar should move.

Signed-off-by: Santino Mazza <mazzasantino1206@gmail.com>

wine commit id ee131e9eba7dad090f0baf4a73fab2d62dc73b52 by Santino Mazza <mazzasantino1206@gmail.com>

[WINESYNC] riched20: Remove duplicate code.

Signed-off-by: David Kahurani <k.kahurani@gmail.com>

wine commit id 3588479e1a674e5f43f1acb9e7c0aa8cecf98f25 by David Kahurani <k.kahurani@gmail.com>

[WINESYNC] riched20: Implement ITextDocument::Undo and ITextDocument::Redo.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53289
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id ded8227774570a1ea320dc34f2de0033f85b3ce7 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Add undo control state variable to ME_TextEditor.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id 40c54854e61d8adfca21e2fa9260712e4f5453e9 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Factor out undo-ignored status check.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id 0cd86e010e41eebdc1a4c142f9cc6a4948554d0e by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Ensure MEPF_COMPLEX is unset when in password input mode.

Otherwise, Wine may crash while attempting to fetch the script shaping
information, which does not exist since shape_para() was not called.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53335
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id f77f12ba3b1dad9ebdcb116c66b137e9103a0d1b by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Test for ITextDocument::Undo and ITextDocument::Redo.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id 73284ea18891a152dce989ffff59e2c527f94c73 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Commit and wrap paragraphs after changing text properties.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53170
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id 0974f047b57357252ec94bea119e5291250a446c by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Draw OLE objects with IViewObject implementation.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52752
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id ecc607c6da96a5c2e8988f3021e98b442fe24c12 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Fetch extent from object if REOBJECT::sizel is unset.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id 164897e6c94d3eee4798f82a730472a5a847f9b2 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Add tests for drawing embedded OLE objects.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>

wine commit id a7d29d1625f7e02df4fbf59ef4e4a999d39edde0 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Fix the spelling of a comment.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f9fa5f9e523b45766f715c6981c6a6ab5f183157 by Francois Gouget <fgouget@free.fr>

[WINESYNC] riched20: Implement callback to IRichEditOleCallback_QueryInsertObject.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 10667b39aad6710668f60c1ba8f10e50aeb87242 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20/tests: Add tests for IRichEditOleCallback_QueryInsertObject.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 95b4072cc774ba7a7eabb0d4c114b933b7d71105 by Jinoh Kang <jinoh.kang.kr@gmail.com>

Update richole.c

[WINESYNC] riched20: Set REOBJECT's cp correctly in IRichEditOle::GetObject.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52705
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 194ba06c403fd72fbfb95048385c9ca4838af169 by Jinoh Kang <jinoh.kang.kr@gmail.com>

[WINESYNC] riched20: Add back-reference to outer ME_Run from struct re_object.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 05796c4e2a4acb91e6035c536b4d0e1f7e16896d by Jinoh Kang <jinoh.kang.kr@gmail.com>

fix

[WINESYNC] riched20/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 9e90cecdc603d79c6332a03884ed8d4851ef2e88 by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20/tests: Use correct integral type.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 8b66db027d4112bfd4287b03d5c7b6f33994adc3 by Eric Pouech <eric.pouech@gmail.com>

fix build, sync rbtree.h

[WINESYNC] riched20: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 42d0e56643740a0eac5913a9f176e789457cb475 by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20/tests: Add a test to see what richedit class flavours should be available.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id d54a0e2bea4548bb5d9c0cca9f918d7c46591e23 by Dmitry Timoshkov <dmitry@baikal.ru>

[WINESYNC] riched20: Use correct integral type.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 63a643f7f42ecd0c2625a5f5704b5b9647349e7b by Eric Pouech <eric.pouech@gmail.com>

[WINESYNC] riched20/tests: Avoid "misleading indentation" warnings.

Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 2d6fad7bda2f2e21a871f405a6b0c3e70ebf6a6a by Fabian Maurer <dark.shadow4@web.de>

[WINESYNC] include: Remove the wine_ prefix on rbtree functions.

Add defines for frequently-used functions.

For compatibility with vkd3d.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 3527230c461b6baba9c29e69b575ada85bdbbc43 by Alexandre Julliard <julliard@winehq.org>

[WINESYNC] riched20: Defer releasing the host if inside a notify callback.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51521
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 8138159f20d6453443861570689e0f14018051da by Huw Davies <huw@codeweavers.com>

[WINESYNC] riched20: Return the nearest char pos if the coords are outside the format rect.

For the two tests that remain todo_wine, the results differ between
riched20 and msftedit, with Wine's implementation matching msftedit.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52041
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 363508454d5f8f1fc5916bda47e6429756b7dc8f by Huw Davies <huw@codeweavers.com>

[WINESYNC] riched20: Check font_cache in select_style() too.

Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 177f808aa86e5442be1a0a92ddccc4904bf2e743 by Serge Gautherie <winehq-git_serge_180711@gautherie.fr>

[WINESYNC] riched20: Use the standard va_list instead of __ms_va_list.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 5b15bf33255bd373cbf26ec373d16a8234ec6b1c by Alexandre Julliard <julliard@winehq.org>

[WINESYNC] riched20: Use regular allocation helpers for text services objects.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 2064c206c0b67edb8524f572166b974ba9cbd6fe by Nikolay Sivov <nsivov@codeweavers.com>

[WINESYNC] riched20: Remove New() allocation macro.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 1d5c9defb19fca6cfb1107384fc2325d391726d6 by Nikolay Sivov <nsivov@codeweavers.com>

[WINESYNC] riched20: Don't create custom heap.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 8bff437e9d5e047e689d8b32f62995785c0cd48e by Dmitry Timoshkov <dmitry@baikal.ru>

[WINESYNC] riched20/tests: Don't cast NULL.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b701c3df99fbd6d4df7eaa11327bb11db95d8676 by Michael Stefaniuc <mstefani@winehq.org>

[WINESYNC] riched20/tests: Add more tests for testing EM_GETTEXTEX with OLE objects.

Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 40988d6c3886d0f7a914c45ea68264bfc8540859 by Jactry Zeng <jzeng@codeweavers.com>

Update richole.c

[WINESYNC] riched20: Allow to insert OLE object at specified offset.

Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 8c894382dde5b9da88b0e9f23a753d5e851a43d6 by Jactry Zeng <jzeng@codeweavers.com>

Update richole.c

[WINESYNC] riched20/tests: Lock hGlobal before use.

Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f9c8c95856ded333be35ff41ab40a246bfe345b6 by Jactry Zeng <jzeng@codeweavers.com>

Co-authored-by: winesync <ros-dev@reactos.org>
2025-06-08 15:05:27 -07:00
Whindmar Saksit
c7a7376545 [SHELL32] Implement basic SHMultiFileProperties (#7956)
CORE-12510 CORE-20217
2025-06-08 20:04:10 +02:00
Eric Kohl
bec50f65f4 [ACPI] Report a docking device to the system 2025-06-08 16:47:45 +02:00
Serge Gautherie
076f08cb3e [SYSSETUP] WriteUserLocale(): Fix Locale[] length and value (#8090)
'Locale' format is "0000nnnn".

CORE-15848
2025-06-08 16:05:22 +02:00
Katayama Hirofumi MZ
6128c20937 [EXPLORER] Set MINMAXINFO correctly (#8100)
JIRA issue: CORE-20219
Set MINMAXINFO data in WM_GETMINMAXINFO
message handling.
2025-06-08 19:49:45 +09:00
Katayama Hirofumi MZ
586989350b [KBSWITCH] Support System Pen Icon (#8080)
## Purpose
Supporting System Pen icon and IME menus for
East-Asian users.
JIRA issue: CORE-20142

## Overview
The East-Asian system has the system pen icon
in taskbar additionally. The system pen icon
shows the current IME status.

If the user clicked the IME system pen icon,
the IME menu will open. The IME system pen icon
can be customized by the IME module by posting
indicator messages.

## Proposed changes
- Add default pen icon resources.
- Add base/applications/kbswitch/imemenu.c to
  handle IME menus.
- Add code for adding, modifying and deleting
  the System Pen icon.
- Modify indicdll.spec.
- Fix popup menu alignment.
2025-06-08 17:21:24 +09:00
353 changed files with 14149 additions and 4435 deletions

View File

@@ -1,9 +1,10 @@
add_rc_deps(kbswitch.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/kbswitch.ico)
add_executable(kbswitch kbswitch.c kbswitch.rc)
add_executable(kbswitch kbswitch.c imemenu.c kbswitch.rc)
set_module_type(kbswitch win32gui UNICODE)
target_link_libraries(kbswitch wine)
add_importlibs(kbswitch advapi32 imm32 user32 shell32 shlwapi gdi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET kbswitch DESTINATION reactos/system32 FOR all)
add_subdirectory(indicdll)
add_dependencies(kbswitch indicdll)

View File

@@ -0,0 +1,260 @@
/*
* PROJECT: ReactOS Keyboard Layout Switcher
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: IME menu handling
* COPYRIGHT: Copyright 2025 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
#include "kbswitch.h"
#include "imemenu.h"
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(internat);
PIMEMENUNODE g_pMenuList = NULL;
INT g_nNextMenuID = 0;
static BOOL MakeImeMenu(_In_ HMENU hMenu, _In_ const IMEMENUNODE *pMenu);
static VOID
AddImeMenuNode(_In_ PIMEMENUNODE pMenu)
{
if (!g_pMenuList)
{
g_pMenuList = pMenu;
return;
}
pMenu->m_pNext = g_pMenuList;
g_pMenuList = pMenu;
}
static PIMEMENUNODE
AllocateImeMenu(_In_ DWORD itemCount)
{
SIZE_T cbMenu = sizeof(IMEMENUNODE) + (itemCount - 1) * sizeof(IMEMENUITEM);
PIMEMENUNODE pMenu = LocalAlloc(LPTR, cbMenu);
if (!pMenu)
return NULL;
pMenu->m_nItems = itemCount;
AddImeMenuNode(pMenu);
return pMenu;
}
static VOID
GetImeMenuItem(
_In_ HIMC hIMC,
_Out_ PIMEMENUITEMINFO lpImeParentMenu,
_In_ BOOL bRightMenu,
_Out_ PIMEMENUITEM pItem)
{
ZeroMemory(pItem, sizeof(IMEMENUITEM));
pItem->m_Info = *lpImeParentMenu;
if (lpImeParentMenu->fType & IMFT_SUBMENU)
pItem->m_pSubMenu = CreateImeMenu(hIMC, lpImeParentMenu, bRightMenu);
pItem->m_nRealID = pItem->m_Info.wID;
pItem->m_Info.wID = ID_STARTIMEMENU + g_nNextMenuID++;
}
PIMEMENUNODE
CreateImeMenu(
_In_ HIMC hIMC,
_Inout_opt_ PIMEMENUITEMINFO lpImeParentMenu,
_In_ BOOL bRightMenu)
{
const DWORD dwFlags = (bRightMenu ? IGIMIF_RIGHTMENU : 0);
const DWORD dwTypes = IGIMII_CMODE |
IGIMII_SMODE |
IGIMII_CONFIGURE |
IGIMII_TOOLS |
IGIMII_HELP |
IGIMII_OTHER;
DWORD itemCount = ImmGetImeMenuItems(hIMC, dwFlags, dwTypes, lpImeParentMenu, NULL, 0);
if (!itemCount)
return NULL;
PIMEMENUNODE pMenu = AllocateImeMenu(itemCount);
if (!pMenu)
return NULL;
DWORD cbItems = sizeof(IMEMENUITEMINFO) * itemCount;
PIMEMENUITEMINFO pImeMenuItems = LocalAlloc(LPTR, cbItems);
if (!pImeMenuItems)
{
LocalFree(pMenu);
return NULL;
}
itemCount = ImmGetImeMenuItems(hIMC, dwFlags, dwTypes, lpImeParentMenu, pImeMenuItems, cbItems);
if (!itemCount)
{
LocalFree(pImeMenuItems);
LocalFree(pMenu);
return NULL;
}
PIMEMENUITEM pItems = pMenu->m_Items;
for (DWORD iItem = 0; iItem < itemCount; ++iItem)
{
GetImeMenuItem(hIMC, &pImeMenuItems[iItem], bRightMenu, &pItems[iItem]);
}
LocalFree(pImeMenuItems);
return pMenu;
}
static BOOL
FillImeMenuItem(_Out_ LPMENUITEMINFO pItemInfo, _In_ const IMEMENUITEM *pItem)
{
ZeroMemory(pItemInfo, sizeof(MENUITEMINFO));
pItemInfo->cbSize = sizeof(MENUITEMINFO);
pItemInfo->fMask = MIIM_ID | MIIM_STATE | MIIM_DATA;
pItemInfo->wID = pItem->m_Info.wID;
pItemInfo->fState = pItem->m_Info.fState;
pItemInfo->dwItemData = pItem->m_Info.dwItemData;
if (pItem->m_Info.fType)
{
pItemInfo->fMask |= MIIM_FTYPE;
pItemInfo->fType = 0;
if (pItem->m_Info.fType & IMFT_RADIOCHECK)
pItemInfo->fType |= MFT_RADIOCHECK;
if (pItem->m_Info.fType & IMFT_SEPARATOR)
pItemInfo->fType |= MFT_SEPARATOR;
}
if (pItem->m_Info.fType & IMFT_SUBMENU)
{
pItemInfo->fMask |= MIIM_SUBMENU;
pItemInfo->hSubMenu = CreatePopupMenu();
if (!MakeImeMenu(pItemInfo->hSubMenu, pItem->m_pSubMenu))
{
DestroyMenu(pItemInfo->hSubMenu);
pItemInfo->hSubMenu = NULL;
return FALSE;
}
}
if (pItem->m_Info.hbmpChecked && pItem->m_Info.hbmpUnchecked)
{
pItemInfo->fMask |= MIIM_CHECKMARKS;
pItemInfo->hbmpChecked = pItem->m_Info.hbmpChecked;
pItemInfo->hbmpUnchecked = pItem->m_Info.hbmpUnchecked;
}
if (pItem->m_Info.hbmpItem)
{
pItemInfo->fMask |= MIIM_BITMAP;
pItemInfo->hbmpItem = pItem->m_Info.hbmpItem;
}
PCTSTR szString = pItem->m_Info.szString;
if (szString && szString[0])
{
pItemInfo->fMask |= MIIM_STRING;
pItemInfo->dwTypeData = (PTSTR)szString;
pItemInfo->cch = lstrlen(szString);
}
return TRUE;
}
static BOOL
MakeImeMenu(_In_ HMENU hMenu, _In_ const IMEMENUNODE *pMenu)
{
if (!pMenu || !pMenu->m_nItems)
return FALSE;
for (INT iItem = 0; iItem < pMenu->m_nItems; ++iItem)
{
MENUITEMINFO mi = { sizeof(mi) };
if (!FillImeMenuItem(&mi, &pMenu->m_Items[iItem]))
{
ERR("FillImeMenuItem failed\n");
return FALSE;
}
if (!InsertMenuItem(hMenu, iItem, TRUE, &mi))
{
ERR("InsertMenuItem failed\n");
return FALSE;
}
}
return TRUE;
}
HMENU MenuFromImeMenu(_In_ const IMEMENUNODE *pMenu)
{
HMENU hMenu = CreatePopupMenu();
if (!pMenu)
return hMenu;
if (!MakeImeMenu(hMenu, pMenu))
{
DestroyMenu(hMenu);
return NULL;
}
return hMenu;
}
INT
GetRealImeMenuID(_In_ const IMEMENUNODE *pMenu, _In_ INT nFakeID)
{
if (!pMenu || !pMenu->m_nItems || nFakeID < ID_STARTIMEMENU)
return 0;
for (INT iItem = 0; iItem < pMenu->m_nItems; ++iItem)
{
const IMEMENUITEM *pItem = &pMenu->m_Items[iItem];
if (pItem->m_Info.wID == nFakeID)
return pItem->m_nRealID;
if (pItem->m_pSubMenu)
{
INT nRealID = GetRealImeMenuID(pItem->m_pSubMenu, nFakeID);
if (nRealID)
return nRealID;
}
}
return 0;
}
static BOOL
FreeMenuNode(_In_ PIMEMENUNODE pMenuNode)
{
if (!pMenuNode)
return FALSE;
for (INT iItem = 0; iItem < pMenuNode->m_nItems; ++iItem)
{
PIMEMENUITEM pItem = &pMenuNode->m_Items[iItem];
if (pItem->m_Info.hbmpChecked)
DeleteObject(pItem->m_Info.hbmpChecked);
if (pItem->m_Info.hbmpUnchecked)
DeleteObject(pItem->m_Info.hbmpUnchecked);
if (pItem->m_Info.hbmpItem)
DeleteObject(pItem->m_Info.hbmpItem);
}
LocalFree(pMenuNode);
return TRUE;
}
VOID
CleanupImeMenus(VOID)
{
if (!g_pMenuList)
return;
PIMEMENUNODE pNext;
for (PIMEMENUNODE pNode = g_pMenuList; pNode; pNode = pNext)
{
pNext = pNode->m_pNext;
FreeMenuNode(pNode);
}
g_pMenuList = NULL;
g_nNextMenuID = 0;
}

View File

@@ -0,0 +1,38 @@
/*
* PROJECT: ReactOS Keyboard Layout Switcher
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: IME menu handling
* COPYRIGHT: Copyright 2025 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
#pragma once
#include <immdev.h>
#define ID_STARTIMEMENU 1000
struct tagIMEMENUNODE;
typedef struct tagIMEMENUITEM
{
IMEMENUITEMINFO m_Info;
UINT m_nRealID;
struct tagIMEMENUNODE *m_pSubMenu;
} IMEMENUITEM, *PIMEMENUITEM;
typedef struct tagIMEMENUNODE
{
struct tagIMEMENUNODE *m_pNext;
INT m_nItems;
IMEMENUITEM m_Items[ANYSIZE_ARRAY];
} IMEMENUNODE, *PIMEMENUNODE;
PIMEMENUNODE
CreateImeMenu(
_In_ HIMC hIMC,
_Inout_opt_ PIMEMENUITEMINFO lpImeParentMenu,
_In_ BOOL bRightMenu);
HMENU MenuFromImeMenu(_In_ const IMEMENUNODE *pMenu);
INT GetRealImeMenuID(_In_ const IMEMENUNODE *pMenu, _In_ INT nFakeID);
VOID CleanupImeMenus(VOID);

View File

@@ -1,6 +1,9 @@
spec2def(indicdll.dll indicdll.spec)
file(GLOB indicdll_rc_deps res/*.*)
add_rc_deps(indicdll.rc ${indicdll_rc_deps})
list(APPEND SOURCE
indicdll.c
indicdll.rc

View File

@@ -8,24 +8,35 @@
*/
#include "../kbswitch.h"
#include "resource.h"
HHOOK hWinHook = NULL;
HHOOK hShellHook = NULL;
HHOOK hKeyboardLLHook = NULL;
HINSTANCE hInstance = NULL;
HWND hKbSwitchWnd = NULL;
typedef struct tagSHARED_DATA
{
HHOOK hWinHook;
HHOOK hShellHook;
HHOOK hKeyboardHook;
HWND hKbSwitchWnd;
UINT nHotID;
DWORD_PTR dwHotMenuItemData;
CRITICAL_SECTION csLock;
} SHARED_DATA, *PSHARED_DATA;
HINSTANCE g_hInstance = NULL;
HANDLE g_hShared = NULL;
PSHARED_DATA g_pShared = NULL;
BOOL g_bCriticalSectionInitialized = 0;
static VOID
PostMessageToMainWnd(UINT Msg, WPARAM wParam, LPARAM lParam)
{
PostMessage(hKbSwitchWnd, Msg, wParam, lParam);
PostMessage(g_pShared->hKbSwitchWnd, Msg, wParam, lParam);
}
static LRESULT CALLBACK
WinHookProc(INT code, WPARAM wParam, LPARAM lParam)
{
if (code < 0)
return CallNextHookEx(hWinHook, code, wParam, lParam);
return CallNextHookEx(g_pShared->hWinHook, code, wParam, lParam);
switch (code)
{
@@ -33,20 +44,20 @@ WinHookProc(INT code, WPARAM wParam, LPARAM lParam)
case HCBT_SETFOCUS:
{
HWND hwndFocus = (HWND)wParam;
if (hwndFocus && hwndFocus != hKbSwitchWnd)
if (hwndFocus && hwndFocus != g_pShared->hKbSwitchWnd)
PostMessageToMainWnd(WM_WINDOW_ACTIVATE, (WPARAM)hwndFocus, 0);
break;
}
}
return CallNextHookEx(hWinHook, code, wParam, lParam);
return CallNextHookEx(g_pShared->hWinHook, code, wParam, lParam);
}
static LRESULT CALLBACK
ShellHookProc(INT code, WPARAM wParam, LPARAM lParam)
{
if (code < 0)
return CallNextHookEx(hShellHook, code, wParam, lParam);
return CallNextHookEx(g_pShared->hShellHook, code, wParam, lParam);
switch (code)
{
@@ -62,76 +73,104 @@ ShellHookProc(INT code, WPARAM wParam, LPARAM lParam)
}
}
return CallNextHookEx(hShellHook, code, wParam, lParam);
return CallNextHookEx(g_pShared->hShellHook, code, wParam, lParam);
}
static inline BOOL
CheckVirtualKey(UINT vKey, UINT vKey1, UINT vKey2)
CheckVirtualKey(UINT vKey, UINT vKey0, UINT vKey1, UINT vKey2)
{
return vKey == vKey1 || vKey == vKey2;
return vKey == vKey0 || vKey == vKey1 || vKey == vKey2;
}
static LRESULT CALLBACK
KeyboardLLHook(INT code, WPARAM wParam, LPARAM lParam)
KeyboardProc(INT code, WPARAM wParam, LPARAM lParam)
{
if (code < 0)
return CallNextHookEx(hKeyboardLLHook, code, wParam, lParam);
return CallNextHookEx(g_pShared->hKeyboardHook, code, wParam, lParam);
if (code == HC_ACTION)
{
KBDLLHOOKSTRUCT *pKbStruct = (KBDLLHOOKSTRUCT *)lParam;
if (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN)
UINT vKey = (UINT)wParam;
LONG keyFlags = HIWORD(lParam);
if (!(keyFlags & KF_UP) && !(keyFlags & KF_REPEAT))
{
BOOL bShiftPressed = GetAsyncKeyState(VK_SHIFT) < 0;
BOOL bAltPressed = GetAsyncKeyState(VK_MENU) < 0;
BOOL bCtrlPressed = GetAsyncKeyState(VK_CONTROL) < 0;
BOOL bShiftPressed = (GetKeyState(VK_SHIFT) < 0);
BOOL bAltPressed = (keyFlags & KF_ALTDOWN) || (GetKeyState(VK_MENU) < 0);
BOOL bCtrlPressed = (GetKeyState(VK_CONTROL) < 0);
// Detect Alt+Shift and Ctrl+Shift
UINT vkCode = pKbStruct->vkCode;
if ((bAltPressed && CheckVirtualKey(vkCode, VK_LSHIFT, VK_RSHIFT)) ||
(bShiftPressed && CheckVirtualKey(vkCode, VK_LMENU, VK_RMENU)) ||
(bCtrlPressed && CheckVirtualKey(vkCode, VK_LSHIFT, VK_RSHIFT)) ||
(bShiftPressed && CheckVirtualKey(vkCode, VK_LCONTROL, VK_RCONTROL)))
if ((bAltPressed && CheckVirtualKey(vKey, VK_SHIFT, VK_LSHIFT, VK_RSHIFT)) ||
(bShiftPressed && CheckVirtualKey(vKey, VK_MENU, VK_LMENU, VK_RMENU)) ||
(bCtrlPressed && CheckVirtualKey(vKey, VK_SHIFT, VK_LSHIFT, VK_RSHIFT)) ||
(bShiftPressed && CheckVirtualKey(vKey, VK_CONTROL, VK_LCONTROL, VK_RCONTROL)))
{
PostMessageToMainWnd(WM_LANG_CHANGED, 0, 0);
}
}
}
return CallNextHookEx(hKeyboardLLHook, code, wParam, lParam);
return CallNextHookEx(g_pShared->hKeyboardHook, code, wParam, lParam);
}
BOOL APIENTRY
KbSwitchSetHooks(_In_ BOOL bDoHook)
{
EnterCriticalSection(&g_pShared->csLock);
if (bDoHook)
{
hWinHook = SetWindowsHookEx(WH_CBT, WinHookProc, hInstance, 0);
hShellHook = SetWindowsHookEx(WH_SHELL, ShellHookProc, hInstance, 0);
hKeyboardLLHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardLLHook, hInstance, 0);
g_pShared->hWinHook = SetWindowsHookEx(WH_CBT, WinHookProc, g_hInstance, 0);
g_pShared->hShellHook = SetWindowsHookEx(WH_SHELL, ShellHookProc, g_hInstance, 0);
g_pShared->hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc, g_hInstance, 0);
if (hWinHook && hShellHook && hKeyboardLLHook)
if (g_pShared->hWinHook &&
g_pShared->hShellHook &&
g_pShared->hKeyboardHook)
{
LeaveCriticalSection(&g_pShared->csLock);
return TRUE;
}
}
/* Unhook */
if (hKeyboardLLHook)
if (g_pShared->hKeyboardHook)
{
UnhookWindowsHookEx(hKeyboardLLHook);
hKeyboardLLHook = NULL;
UnhookWindowsHookEx(g_pShared->hKeyboardHook);
g_pShared->hKeyboardHook = NULL;
}
if (hShellHook)
if (g_pShared->hShellHook)
{
UnhookWindowsHookEx(hShellHook);
hShellHook = NULL;
UnhookWindowsHookEx(g_pShared->hShellHook);
g_pShared->hShellHook = NULL;
}
if (hWinHook)
if (g_pShared->hWinHook)
{
UnhookWindowsHookEx(hWinHook);
hWinHook = NULL;
UnhookWindowsHookEx(g_pShared->hWinHook);
g_pShared->hWinHook = NULL;
}
LeaveCriticalSection(&g_pShared->csLock);
return !bDoHook;
}
// indicdll!12
VOID APIENTRY
GetPenMenuData(PUINT pnID, PDWORD_PTR pdwItemData)
{
EnterCriticalSection(&g_pShared->csLock);
*pnID = g_pShared->nHotID;
*pdwItemData = g_pShared->dwHotMenuItemData;
LeaveCriticalSection(&g_pShared->csLock);
}
// indicdll!14
VOID APIENTRY
SetPenMenuData(_In_ UINT nID, _In_ DWORD_PTR dwItemData)
{
EnterCriticalSection(&g_pShared->csLock);
g_pShared->nHotID = nID;
g_pShared->dwHotMenuItemData = dwItemData;
LeaveCriticalSection(&g_pShared->csLock);
}
BOOL WINAPI
DllMain(IN HINSTANCE hinstDLL,
IN DWORD dwReason,
@@ -141,12 +180,37 @@ DllMain(IN HINSTANCE hinstDLL,
{
case DLL_PROCESS_ATTACH:
{
hInstance = hinstDLL;
hKbSwitchWnd = FindWindow(szKbSwitcherName, NULL);
if (!hKbSwitchWnd)
g_hInstance = hinstDLL;
g_hShared = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
0, sizeof(SHARED_DATA), TEXT("InternatSHData"));
if (!g_hShared)
return FALSE;
BOOL bAlreadyExists = GetLastError() == ERROR_ALREADY_EXISTS;
g_pShared = (PSHARED_DATA)MapViewOfFile(g_hShared, FILE_MAP_WRITE, 0, 0, 0);
if (!g_pShared)
return FALSE;
if (!bAlreadyExists)
{
ZeroMemory(g_pShared, sizeof(*g_pShared));
g_pShared->hKbSwitchWnd = FindWindow(INDICATOR_CLASS, NULL);
InitializeCriticalSection(&g_pShared->csLock);
g_bCriticalSectionInitialized = TRUE;
}
break;
}
case DLL_PROCESS_DETACH:
{
if (g_bCriticalSectionInitialized)
{
DeleteCriticalSection(&g_pShared->csLock);
}
UnmapViewOfFile(g_pShared);
CloseHandle(g_hShared);
break;
}
break;
}
return TRUE;

View File

@@ -1,5 +1,15 @@
#include "resource.h"
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Keyboard Layout Switcher"
#define REACTOS_STR_INTERNAL_NAME "indicdll"
#define REACTOS_STR_ORIGINAL_FILENAME "indicdll.dll"
#include <reactos/version.rc>
IDI_IME_OPEN ICON "res/10.ico"
IDI_IME_CLOSED ICON "res/11.ico"
IDI_IME_DISABLED ICON "res/12.ico"
IDI_KOREAN_A_HALF ICON "res/13.ico"
IDI_KOREAN_A_FULL ICON "res/14.ico"
IDI_KOREAN_JR_HALF ICON "res/15.ico"
IDI_KOREAN_JR_FULL ICON "res/16.ico"

View File

@@ -1 +1,3 @@
1 stdcall KbSwitchSetHooks(long)
12 stdcall GetPenMenuData(ptr ptr)
14 stdcall SetPenMenuData(long long)

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,8 @@
#define IDI_IME_OPEN 10
#define IDI_IME_CLOSED 11
#define IDI_IME_DISABLED 12
#define IDI_KOREAN_A_HALF 13
#define IDI_KOREAN_A_FULL 14
#define IDI_KOREAN_JR_HALF 15
#define IDI_KOREAN_JR_FULL 16

View File

@@ -9,8 +9,11 @@
#include "kbswitch.h"
#include <shlobj.h>
#include <shlwapi_undoc.h>
#include <undocuser.h>
#include <imm.h>
#include <immdev.h>
#include <imm32_undoc.h>
#include "imemenu.h"
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(internat);
@@ -29,12 +32,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(internat);
* won't be generated in Vista+.
*/
#define WM_NOTIFYICONMSG (WM_USER + 248)
#define WM_NOTIFYICONMSG 0x8064
#define WM_PENICONMSG 0x8065
#define NOTIFY_ICON_ID_LANGUAGE 223
#define NOTIFY_ICON_ID_SYSTEM_PEN 224
#define TIMER_ID_LANG_CHANGED_DELAYED 0x10000
#define TIMER_LANG_CHANGED_DELAY 200
#define IME_HKL_MASK 0xF000FFFF
#define IS_KOREAN_IME_HKL(hKL) ((HandleToUlong(hKL) & IME_HKL_MASK) == 0xE0000412)
#define MAX_KLS 64
typedef BOOL (APIENTRY *FN_KbSwitchSetHooks)(BOOL bDoHook);
typedef VOID (APIENTRY *FN_SetPenMenuData)(UINT nID, DWORD_PTR dwItemData); // indic!14
FN_KbSwitchSetHooks KbSwitchSetHooks = NULL;
FN_SetPenMenuData SetPenMenuData = NULL;
HINSTANCE g_hInst = NULL;
HMODULE g_hHookDLL = NULL;
@@ -42,9 +58,29 @@ HICON g_hTrayIcon = NULL;
HWND g_hwndLastActive = NULL;
UINT g_iKL = 0;
UINT g_cKLs = 0;
HKL g_ahKLs[64];
HKL g_ahKLs[MAX_KLS] = { NULL };
WORD g_aiSysPenIcons[MAX_KLS] = { 0 };
WORD g_anToolTipAtoms[MAX_KLS] = { 0 };
HICON g_ahSysPenIcons[MAX_KLS] = { NULL };
BYTE g_anFlags[MAX_KLS] = { 0 };
UINT g_uTaskbarRestartMsg = 0;
UINT g_uShellHookMessage = 0;
HWND g_hTrayWnd = NULL;
HWND g_hTrayNotifyWnd = NULL;
// Flags for g_anFlags
#define LAYOUTF_FAR_EAST 0x1
#define LAYOUTF_IME_ICON 0x2
#define LAYOUTF_TOOLTIP_ATOM 0x4
#define LAYOUTF_REMOVE_LEFT_DEF_MENU 0x8
#define LAYOUTF_REMOVE_RIGHT_DEF_MENU 0x10
static VOID
UpdateTrayInfo(VOID)
{
g_hTrayWnd = FindWindow(TEXT("Shell_TrayWnd"), NULL);
g_hTrayNotifyWnd = FindWindowEx(g_hTrayWnd, NULL, TEXT("TrayNotifyWnd"), NULL);
}
typedef struct tagSPECIAL_ID
{
@@ -139,32 +175,126 @@ GetKLIDFromHKL(HKL hKL, LPTSTR szKLID, SIZE_T KLIDLength)
}
}
static HWND
GetTargetWindow(HWND hwndFore OPTIONAL)
{
HWND hwndTarget = (hwndFore ? hwndFore : GetForegroundWindow());
if (!hwndTarget ||
IsWndClassName(hwndTarget, INDICATOR_CLASS) ||
IsWndClassName(hwndTarget, TEXT("Shell_TrayWnd")))
{
hwndTarget = g_hwndLastActive;
}
return hwndTarget;
}
static HKL GetActiveKL(VOID)
{
/* FIXME: Get correct console window's HKL when console window */
HWND hwndTarget = (g_hwndLastActive ? g_hwndLastActive : GetForegroundWindow());
HWND hwndTarget = GetTargetWindow(NULL);
TRACE("hwndTarget: %p\n", hwndTarget);
DWORD dwTID = GetWindowThreadProcessId(hwndTarget, NULL);
return GetKeyboardLayout(dwTID);
}
static VOID
DeletePenIcon(HWND hwnd, UINT iKL)
{
UNREFERENCED_PARAMETER(hwnd);
if (g_ahSysPenIcons[iKL])
{
DestroyIcon(g_ahSysPenIcons[iKL]);
g_ahSysPenIcons[iKL] = NULL;
}
}
static VOID
DestroyPenIcons(VOID)
{
INT iKL;
for (iKL = 0; iKL < g_cKLs; ++iKL)
{
if (g_ahSysPenIcons[iKL])
{
DestroyIcon(g_ahSysPenIcons[iKL]);
g_ahSysPenIcons[iKL] = NULL;
}
}
}
static UINT
GetLayoutIndexFromHKL(HKL hKL)
{
for (UINT iKL = 0; iKL < g_cKLs; ++iKL)
{
if (g_ahKLs[iKL] == hKL)
return iKL;
}
return 0;
}
static VOID UpdateLayoutList(HKL hKL OPTIONAL)
{
UINT iKL;
if (!hKL)
hKL = GetActiveKL();
g_cKLs = GetKeyboardLayoutList(_countof(g_ahKLs), g_ahKLs);
HICON ahSysPenIcons[MAX_KLS];
WORD aiSysPenIcons[MAX_KLS];
BYTE anFlags[MAX_KLS];
ZeroMemory(ahSysPenIcons, sizeof(ahSysPenIcons));
FillMemory(aiSysPenIcons, sizeof(aiSysPenIcons), 0xFF);
ZeroMemory(anFlags, sizeof(anFlags));
g_iKL = 0;
for (iKL = 0; iKL < g_cKLs; ++iKL)
HKL ahKLs[MAX_KLS];
UINT iKL, nKLs = GetKeyboardLayoutList(_countof(ahKLs), ahKLs);
/* Reuse old icons and flags */
for (iKL = 0; iKL < nKLs; ++iKL)
{
if (g_ahKLs[iKL] == hKL)
LANGID wLangID = LOWORD(ahKLs[iKL]);
switch (wLangID)
{
g_iKL = iKL;
break;
case LANGID_CHINESE_SIMPLIFIED:
case LANGID_CHINESE_TRADITIONAL:
case LANGID_JAPANESE:
case LANGID_KOREAN:
anFlags[iKL] |= LAYOUTF_FAR_EAST;
break;
default:
anFlags[iKL] &= ~LAYOUTF_FAR_EAST;
break;
}
UINT iKL2;
for (iKL2 = 0; iKL2 < g_cKLs; ++iKL2)
{
if (ahKLs[iKL] == g_ahKLs[iKL2])
{
ahSysPenIcons[iKL] = g_ahSysPenIcons[iKL2];
aiSysPenIcons[iKL] = g_aiSysPenIcons[iKL2];
anFlags[iKL] = g_anFlags[iKL2];
g_ahSysPenIcons[iKL2] = NULL;
break;
}
}
}
DestroyPenIcons();
g_cKLs = nKLs;
C_ASSERT(sizeof(g_ahKLs) == sizeof(ahKLs));
CopyMemory(g_ahKLs, ahKLs, sizeof(g_ahKLs));
C_ASSERT(sizeof(g_ahSysPenIcons) == sizeof(ahSysPenIcons));
CopyMemory(g_ahSysPenIcons, ahSysPenIcons, sizeof(g_ahSysPenIcons));
C_ASSERT(sizeof(g_anFlags) == sizeof(anFlags));
CopyMemory(g_anFlags, anFlags, sizeof(g_anFlags));
g_iKL = GetLayoutIndexFromHKL(hKL);
}
static HKL GetHKLFromLayoutNum(UINT iKL)
@@ -260,7 +390,9 @@ static BOOL GetImeFile(LPTSTR szImeFile, SIZE_T cchImeFile, LPCTSTR szKLID)
typedef struct tagLOAD_ICON
{
INT nIconIndex;
INT cxIcon, cyIcon;
INT iIcon;
HICON hIcon;
} LOAD_ICON, *PLOAD_ICON;
@@ -271,24 +403,37 @@ EnumResNameProc(
LPTSTR lpszName,
LPARAM lParam)
{
UNREFERENCED_PARAMETER(lpszType);
PLOAD_ICON pLoadIcon = (PLOAD_ICON)lParam;
pLoadIcon->hIcon = (HICON)LoadImage(hModule, lpszName, IMAGE_ICON,
pLoadIcon->cxIcon, pLoadIcon->cyIcon,
LR_DEFAULTCOLOR);
if (pLoadIcon->hIcon)
return FALSE; /* Stop enumeration */
if (pLoadIcon->iIcon == pLoadIcon->nIconIndex)
{
pLoadIcon->hIcon = (HICON)LoadImage(hModule, lpszName, IMAGE_ICON,
pLoadIcon->cxIcon, pLoadIcon->cyIcon,
LR_DEFAULTCOLOR);
if (pLoadIcon->hIcon)
return FALSE; /* Stop enumeration */
}
++pLoadIcon->iIcon;
return TRUE;
}
static HICON FakeExtractIcon(LPCTSTR szIconPath, INT cxIcon, INT cyIcon)
static HICON
FakeExtractIcon(PCTSTR pszImeFile, INT nIconIndex)
{
LOAD_ICON LoadIcon = { cxIcon, cyIcon, NULL };
HMODULE hImeDLL = LoadLibraryEx(szIconPath, NULL, LOAD_LIBRARY_AS_DATAFILE);
if (hImeDLL)
HMODULE hImeDLL = LoadLibraryEx(pszImeFile, NULL, LOAD_LIBRARY_AS_DATAFILE);
if (!hImeDLL)
return NULL;
LOAD_ICON LoadIcon =
{
EnumResourceNames(hImeDLL, RT_GROUP_ICON, EnumResNameProc, (LPARAM)&LoadIcon);
FreeLibrary(hImeDLL);
}
nIconIndex, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CXSMICON)
};
EnumResourceNames(hImeDLL, RT_GROUP_ICON, EnumResNameProc, (LPARAM)&LoadIcon);
FreeLibrary(hImeDLL);
return LoadIcon.hIcon;
}
@@ -313,6 +458,141 @@ static HBITMAP BitmapFromIcon(HICON hIcon)
return hbm;
}
static DWORD
GetImeStatus(HWND hwndTarget)
{
HWND hwndIme = ImmGetDefaultIMEWnd(hwndTarget);
if (!hwndIme)
return IME_STATUS_IME_CLOSED;
HIMC hIMC = (HIMC)SendMessage(hwndIme, WM_IME_SYSTEM, IMS_GETCONTEXT, (LPARAM)hwndTarget);
if (!hIMC)
return IME_STATUS_NO_IME;
DWORD dwImeStatus = (ImmGetOpenStatus(hIMC) ? IME_STATUS_IME_OPEN : IME_STATUS_IME_CLOSED);
if (GetACP() == 949) // Korean
{
DWORD dwConversion = 0, dwSentence = 0;
if (ImmGetConversionStatus(hIMC, &dwConversion, &dwSentence))
{
if (dwConversion & IME_CMODE_NATIVE)
dwImeStatus |= IME_STATUS_IME_NATIVE;
if (dwConversion & IME_CMODE_FULLSHAPE)
dwImeStatus |= IME_STATUS_IME_FULLSHAPE;
}
}
return dwImeStatus;
}
static HICON
LoadDefaultPenIcon(PCWSTR szImeFile, HKL hKL)
{
HWND hwndTarget = g_hwndLastActive ? g_hwndLastActive : GetForegroundWindow();
DWORD dwImeStatus = GetImeStatus(hwndTarget);
INT nIconID = -1;
if (IS_KOREAN_IME_HKL(hKL)) // Korean IME?
{
if (dwImeStatus != IME_STATUS_NO_IME)
{
if (dwImeStatus & IME_STATUS_IME_CLOSED)
{
nIconID = IDI_KOREAN_A_HALF;
}
else
{
if (dwImeStatus & IME_STATUS_IME_FULLSHAPE)
{
if (dwImeStatus & IME_STATUS_IME_NATIVE)
nIconID = IDI_KOREAN_JR_FULL;
else
nIconID = IDI_KOREAN_A_FULL;
}
else
{
if (dwImeStatus & IME_STATUS_IME_NATIVE)
nIconID = IDI_KOREAN_JR_HALF;
else
nIconID = IDI_KOREAN_A_HALF;
}
}
}
}
else
{
if (dwImeStatus & IME_STATUS_IME_CLOSED)
nIconID = IDI_IME_CLOSED;
else if (dwImeStatus & IME_STATUS_IME_OPEN)
nIconID = IDI_IME_OPEN;
else
nIconID = IDI_IME_DISABLED;
}
if (nIconID < 0)
return NULL;
return LoadIcon(g_hHookDLL, MAKEINTRESOURCE(nIconID));
}
static VOID
DeletePenNotifyIcon(HWND hwnd)
{
NOTIFYICONDATA nid = { sizeof(nid), hwnd, NOTIFY_ICON_ID_SYSTEM_PEN };
Shell_NotifyIcon(NIM_DELETE, &nid);
}
static VOID
UpdatePenIcon(HWND hwnd, UINT iKL)
{
BOOL bHadIcon = (g_ahSysPenIcons[iKL] != NULL);
DeletePenIcon(hwnd, iKL);
// Not Far-East?
if (!(g_anFlags[iKL] & LAYOUTF_FAR_EAST))
{
if (bHadIcon)
DeletePenNotifyIcon(hwnd);
return;
}
// Get IME file
TCHAR szKLID[CCH_LAYOUT_ID + 1], szImeFile[MAX_PATH];
GetKLIDFromHKL(g_ahKLs[iKL], szKLID, _countof(szKLID));
if (!GetImeFile(szImeFile, _countof(szImeFile), szKLID))
{
if (bHadIcon)
DeletePenNotifyIcon(hwnd);
return;
}
// Load pen icon
if (g_anFlags[iKL] & LAYOUTF_IME_ICON)
g_ahSysPenIcons[iKL] = FakeExtractIcon(szImeFile, g_aiSysPenIcons[iKL]);
if (!g_ahSysPenIcons[iKL])
g_ahSysPenIcons[iKL] = LoadDefaultPenIcon(szImeFile, g_ahKLs[iKL]);
if (!g_ahSysPenIcons[iKL])
{
if (bHadIcon)
DeletePenNotifyIcon(hwnd);
return;
}
// Add pen icon
NOTIFYICONDATA nid = { sizeof(nid), hwnd, NOTIFY_ICON_ID_SYSTEM_PEN };
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_PENICONMSG;
nid.hIcon = g_ahSysPenIcons[iKL];
if (g_anToolTipAtoms[iKL])
GlobalGetAtomName(g_anToolTipAtoms[iKL], nid.szTip, _countof(nid.szTip));
else
ImmGetDescription(g_ahKLs[iKL], nid.szTip, _countof(nid.szTip));
Shell_NotifyIcon((bHadIcon ? NIM_MODIFY : NIM_ADD), &nid);
}
static HICON
CreateTrayIcon(LPTSTR szKLID, LPCTSTR szImeFile OPTIONAL)
{
@@ -332,7 +612,7 @@ CreateTrayIcon(LPTSTR szKLID, LPCTSTR szImeFile OPTIONAL)
if (szImeFile && szImeFile[0])
{
if (GetSystemLibraryPath(szPath, _countof(szPath), szImeFile))
return FakeExtractIcon(szPath, cxIcon, cyIcon);
return FakeExtractIcon(szPath, 0);
}
/* Getting "EN", "FR", etc. from English, French, ... */
@@ -413,7 +693,10 @@ CreateTrayIcon(LPTSTR szKLID, LPCTSTR szImeFile OPTIONAL)
static VOID
AddTrayIcon(HWND hwnd)
{
NOTIFYICONDATA tnid = { sizeof(tnid), hwnd, 1, NIF_ICON | NIF_MESSAGE | NIF_TIP };
NOTIFYICONDATA tnid =
{
sizeof(tnid), hwnd, NOTIFY_ICON_ID_LANGUAGE, NIF_ICON | NIF_MESSAGE | NIF_TIP
};
TCHAR szKLID[CCH_LAYOUT_ID + 1], szName[MAX_PATH], szImeFile[80];
GetKLIDFromLayoutNum(g_iKL, szKLID, _countof(szKLID));
@@ -434,7 +717,7 @@ AddTrayIcon(HWND hwnd)
static VOID
DeleteTrayIcon(HWND hwnd)
{
NOTIFYICONDATA tnid = { sizeof(tnid), hwnd, 1 };
NOTIFYICONDATA tnid = { sizeof(tnid), hwnd, NOTIFY_ICON_ID_LANGUAGE };
Shell_NotifyIcon(NIM_DELETE, &tnid);
if (g_hTrayIcon)
@@ -447,7 +730,10 @@ DeleteTrayIcon(HWND hwnd)
static VOID
UpdateTrayIcon(HWND hwnd, LPTSTR szKLID, LPTSTR szName)
{
NOTIFYICONDATA tnid = { sizeof(tnid), hwnd, 1, NIF_ICON | NIF_MESSAGE | NIF_TIP };
NOTIFYICONDATA tnid =
{
sizeof(tnid), hwnd, NOTIFY_ICON_ID_LANGUAGE, NIF_ICON | NIF_MESSAGE | NIF_TIP
};
TCHAR szImeFile[80];
GetImeFile(szImeFile, _countof(szImeFile), szKLID);
@@ -546,19 +832,22 @@ BuildLeftPopupMenu(VOID)
return hMenu;
}
#define IFN_KbSwitchSetHooks 1
#define IFN_SetPenMenuData 14
static BOOL
SetHooks(VOID)
{
g_hHookDLL = LoadLibrary(_T("indicdll.dll"));
if (!g_hHookDLL)
{
return FALSE;
}
#define IHOOK_SET 1
KbSwitchSetHooks = (FN_KbSwitchSetHooks)GetProcAddress(g_hHookDLL, MAKEINTRESOURCEA(IHOOK_SET));
KbSwitchSetHooks =
(FN_KbSwitchSetHooks)GetProcAddress(g_hHookDLL, MAKEINTRESOURCEA(IFN_KbSwitchSetHooks));
SetPenMenuData =
(FN_SetPenMenuData)GetProcAddress(g_hHookDLL, MAKEINTRESOURCEA(IFN_SetPenMenuData));
if (!KbSwitchSetHooks || !KbSwitchSetHooks(TRUE))
if (!KbSwitchSetHooks || !SetPenMenuData || !KbSwitchSetHooks(TRUE))
{
ERR("SetHooks failed\n");
return FALSE;
@@ -614,15 +903,6 @@ UpdateLanguageDisplay(HWND hwnd, HKL hKL)
return 0;
}
HWND
GetTargetWindow(HWND hwndFore OPTIONAL)
{
HWND hwndTarget = (hwndFore ? hwndFore : GetForegroundWindow());
if (IsWndClassName(hwndTarget, szKbSwitcherName))
hwndTarget = g_hwndLastActive;
return hwndTarget;
}
UINT
UpdateLanguageDisplayCurrent(HWND hwnd, HWND hwndFore)
{
@@ -640,7 +920,7 @@ static BOOL RememberLastActive(HWND hwnd, HWND hwndFore)
if (!IsWindowVisible(hwndFore))
return FALSE;
if (IsWndClassName(hwndFore, szKbSwitcherName) ||
if (IsWndClassName(hwndFore, INDICATOR_CLASS) ||
IsWndClassName(hwndFore, TEXT("Shell_TrayWnd")))
{
return FALSE; /* Special window */
@@ -661,9 +941,10 @@ KbSwitch_OnCreate(HWND hwnd)
}
LoadSpecialIds();
UpdateTrayInfo();
UpdateLayoutList(NULL);
AddTrayIcon(hwnd);
UpdatePenIcon(hwnd, g_iKL);
ActivateLayout(hwnd, g_iKL, NULL, TRUE);
g_uTaskbarRestartMsg = RegisterWindowMessage(TEXT("TaskbarCreated"));
@@ -678,6 +959,7 @@ KbSwitch_OnDestroy(HWND hwnd)
KillTimer(hwnd, TIMER_ID_LANG_CHANGED_DELAYED);
DeleteHooks();
DeleteTrayIcon(hwnd);
DestroyPenIcons();
PostQuitMessage(0);
}
@@ -691,6 +973,7 @@ KbSwitch_OnTimer(HWND hwnd, UINT_PTR nTimerID)
HKL hKL = GetActiveKL();
UpdateLayoutList(hKL);
UpdateLanguageDisplay(hwnd, hKL);
UpdatePenIcon(hwnd, g_iKL);
}
}
@@ -698,7 +981,7 @@ KbSwitch_OnTimer(HWND hwnd, UINT_PTR nTimerID)
static void
KbSwitch_OnNotifyIconMsg(HWND hwnd, UINT uMouseMsg)
{
if (uMouseMsg != WM_LBUTTONUP && uMouseMsg != WM_RBUTTONUP && uMouseMsg != WM_CONTEXTMENU)
if (uMouseMsg != WM_LBUTTONUP && uMouseMsg != WM_RBUTTONUP)
return;
UpdateLayoutList(NULL);
@@ -708,21 +991,24 @@ KbSwitch_OnNotifyIconMsg(HWND hwnd, UINT uMouseMsg)
SetForegroundWindow(hwnd);
TPMPARAMS params = { sizeof(params) };
GetWindowRect(g_hTrayNotifyWnd, &params.rcExclude);
INT nID;
if (uMouseMsg == WM_LBUTTONUP)
{
/* Rebuild the left popup menu on every click to take care of keyboard layout changes */
HMENU hPopupMenu = BuildLeftPopupMenu();
nID = TrackPopupMenuEx(hPopupMenu, TPM_LEFTALIGN | TPM_RETURNCMD | TPM_LEFTBUTTON,
pt.x, pt.y, hwnd, NULL);
UINT uFlags = TPM_VERTICAL | TPM_RIGHTALIGN | TPM_RETURNCMD | TPM_LEFTBUTTON;
nID = TrackPopupMenuEx(hPopupMenu, uFlags, pt.x, pt.y, hwnd, &params);
DestroyMenu(hPopupMenu);
}
else /* WM_RBUTTONUP or WM_CONTEXTMENU */
else /* WM_RBUTTONUP */
{
HMENU hPopupMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_POPUP));
HMENU hSubMenu = GetSubMenu(hPopupMenu, 0);
nID = TrackPopupMenuEx(hSubMenu, TPM_LEFTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
pt.x, pt.y, hwnd, NULL);
UINT uFlags = TPM_VERTICAL | TPM_RIGHTALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON;
nID = TrackPopupMenuEx(hSubMenu, uFlags, pt.x, pt.y, hwnd, &params);
DestroyMenu(hPopupMenu);
}
@@ -732,6 +1018,221 @@ KbSwitch_OnNotifyIconMsg(HWND hwnd, UINT uMouseMsg)
PostMessage(hwnd, WM_COMMAND, nID, 0);
}
static BOOL
IsRegImeToolbarShown(VOID)
{
HKEY hKey;
LSTATUS error = RegOpenKey(HKEY_CURRENT_USER, TEXT("Control Panel\\Input Method"), &hKey);
if (error)
{
ERR("Cannot open regkey: 0x%lX\n", error);
return TRUE;
}
WCHAR szText[8];
DWORD cbValue = sizeof(szText);
error = RegQueryValueEx(hKey, TEXT("Show Status"), NULL, NULL, (PBYTE)szText, &cbValue);
if (error)
{
RegCloseKey(hKey);
return TRUE;
}
BOOL ret = !!_wtoi(szText);
RegCloseKey(hKey);
return ret;
}
static VOID
ShowImeToolbar(HWND hwndTarget, BOOL bShowToolbar)
{
HKEY hKey;
LSTATUS error = RegOpenKey(HKEY_CURRENT_USER, TEXT("Control Panel\\Input Method"), &hKey);
if (error)
{
ERR("Cannot open regkey: 0x%lX\n", error);
return;
}
WCHAR szText[8];
StringCchPrintf(szText, _countof(szText), TEXT("%d"), bShowToolbar);
DWORD cbValue = (lstrlen(szText) + 1) * sizeof(TCHAR);
RegSetValueEx(hKey, TEXT("Show Status"), 0, REG_SZ, (PBYTE)szText, cbValue);
RegCloseKey(hKey);
HWND hwndIme = ImmGetDefaultIMEWnd(hwndTarget);
PostMessage(hwndIme, WM_IME_SYSTEM, IMS_NOTIFYIMESHOW, bShowToolbar);
}
// WM_PENICONMSG
static VOID
KbSwitch_OnPenIconMsg(HWND hwnd, UINT uMouseMsg)
{
if (uMouseMsg != WM_LBUTTONUP && uMouseMsg != WM_RBUTTONUP)
return;
if (!(g_anFlags[g_iKL] & LAYOUTF_FAR_EAST))
return;
POINT pt;
GetCursorPos(&pt);
// Get target window
TRACE("g_hwndLastActive: %p\n", g_hwndLastActive);
HWND hwndTarget = GetTargetWindow(g_hwndLastActive);
TRACE("hwndTarget: %p\n", hwndTarget);
// Get default IME window
HWND hwndIme = ImmGetDefaultIMEWnd(hwndTarget);
if (!hwndIme)
{
WARN("No default IME\n");
return;
}
// Get IME context from another process
HIMC hIMC = (HIMC)SendMessage(hwndIme, WM_IME_SYSTEM, IMS_GETCONTEXT, (LPARAM)hwndTarget);
if (!hIMC)
{
WARN("No HIMC\n");
return;
}
// Workaround of TrackPopupMenu's bug
SetForegroundWindow(hwnd);
// Create IME menu
BOOL bRightButton = (uMouseMsg == WM_RBUTTONUP);
PIMEMENUNODE pImeMenu = CreateImeMenu(hIMC, NULL, bRightButton);
HMENU hMenu = MenuFromImeMenu(pImeMenu);
HKL hKL = g_ahKLs[g_iKL];
DWORD dwImeStatus = GetImeStatus(hwndTarget);
BOOL bImeOn = FALSE, bSoftOn = FALSE, bShowToolbar = FALSE;
TCHAR szText[128];
if (bRightButton)
{
if (!(g_anFlags[g_iKL] & LAYOUTF_REMOVE_RIGHT_DEF_MENU)) // Add default menu items?
{
if (GetMenuItemCount(hMenu))
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); // Separator
// "Input System (IME) configuration..."
LoadString(g_hInst, IDS_INPUTSYSTEM, szText, _countof(szText));
AppendMenu(hMenu, MF_STRING, ID_INPUTSYSTEM, szText);
}
}
else
{
if (!(g_anFlags[g_iKL] & LAYOUTF_REMOVE_LEFT_DEF_MENU)) // Add default menu items?
{
if (GetMenuItemCount(hMenu))
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); // Separator
if (!IS_KOREAN_IME_HKL(hKL)) // Not Korean IME?
{
// "IME ON / OFF"
bImeOn = (dwImeStatus == IME_STATUS_IME_OPEN);
UINT nId = (bImeOn ? IDS_IME_ON : IDS_IME_OFF);
LoadString(g_hInst, nId, szText, _countof(szText));
AppendMenu(hMenu, MF_STRING, ID_IMEONOFF, szText);
}
if ((ImmGetProperty(hKL, IGP_CONVERSION) & IME_CMODE_SOFTKBD) &&
IsWindow(hwndIme)) // Is Soft Keyboard available?
{
// "Soft Keyboard ON / OFF"
bSoftOn = (SendMessage(hwndIme, WM_IME_SYSTEM, IMS_GETCONVSTATUS, 0) & IME_CMODE_SOFTKBD);
UINT nId = (bSoftOn ? IDS_SOFTKBD_ON : IDS_SOFTKBD_OFF);
LoadString(g_hInst, nId, szText, _countof(szText));
AppendMenu(hMenu, MF_STRING, ID_SOFTKBDONOFF, szText);
}
if (GetMenuItemCount(hMenu))
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL); // Separator
// "Show toolbar"
LoadString(g_hInst, IDS_SHOWTOOLBAR, szText, _countof(szText));
AppendMenu(hMenu, MF_STRING, ID_SHOWTOOLBAR, szText);
bShowToolbar = IsRegImeToolbarShown();
if (bShowToolbar)
CheckMenuItem(hMenu, ID_SHOWTOOLBAR, MF_CHECKED);
}
}
if (!GetMenuItemCount(hMenu)) // No items?
{
// Clean up
DestroyMenu(hMenu);
CleanupImeMenus();
SetForegroundWindow(hwndTarget);
return;
}
// TrackPopupMenuEx flags
UINT uFlags = TPM_VERTICAL | TPM_RIGHTALIGN | TPM_RETURNCMD;
uFlags |= (bRightButton ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON);
// Exclude the notification area
TPMPARAMS params = { sizeof(params) };
GetWindowRect(g_hTrayNotifyWnd, &params.rcExclude);
// Show the popup menu
INT nID = TrackPopupMenuEx(hMenu, uFlags, pt.x, pt.y, hwnd, &params);
// Workaround of TrackPopupMenu's bug
PostMessage(hwnd, WM_NULL, 0, 0);
if (nID) // Action!
{
if (nID >= ID_STARTIMEMENU) // IME internal menu ID?
{
MENUITEMINFO mii = { sizeof(mii), MIIM_DATA };
GetMenuItemInfo(hMenu, nID, FALSE, &mii);
if (pImeMenu)
nID = GetRealImeMenuID(pImeMenu, nID);
if (SetPenMenuData)
SetPenMenuData(nID, mii.dwItemData);
PostMessage(hwndIme, WM_IME_SYSTEM, IMS_IMEMENUITEMSELECTED, (LPARAM)hwndTarget);
}
else // Otherwise action of IME menu item
{
switch (nID)
{
case ID_INPUTSYSTEM:
if (IS_IME_HKL(hKL))
PostMessage(hwndIme, WM_IME_SYSTEM, IMS_CONFIGURE, (LPARAM)hKL);
break;
case ID_IMEONOFF:
ImmSetOpenStatus(hIMC, !bImeOn);
break;
case ID_SOFTKBDONOFF:
PostMessage(hwndIme, WM_IME_SYSTEM, IMS_SOFTKBDONOFF, !bSoftOn);
break;
case ID_SHOWTOOLBAR:
ShowImeToolbar(hwndTarget, !bShowToolbar);
break;
default:
{
PostMessage(hwnd, WM_COMMAND, nID, 0);
break;
}
}
}
}
// Clean up
DestroyMenu(hMenu);
CleanupImeMenus();
SetForegroundWindow(hwndTarget);
}
// WM_COMMAND
static void
KbSwitch_OnCommand(HWND hwnd, UINT nID)
@@ -767,7 +1268,7 @@ KbSwitch_OnCommand(HWND hwnd, UINT nID)
}
}
// WM_LANG_CHANGED
// WM_LANG_CHANGED (HSHELL_LANGUAGE)
static LRESULT
KbSwitch_OnLangChanged(HWND hwnd, HWND hwndTarget OPTIONAL, HKL hKL OPTIONAL)
{
@@ -778,7 +1279,7 @@ KbSwitch_OnLangChanged(HWND hwnd, HWND hwndTarget OPTIONAL, HKL hKL OPTIONAL)
return 0;
}
// WM_WINDOW_ACTIVATE
// WM_WINDOW_ACTIVATE (HCBT_ACTIVATE / HCBT_SETFOCUS / HSHELL_WINDOWACTIVATED)
static LRESULT
KbSwitch_OnWindowActivate(HWND hwnd, HWND hwndTarget OPTIONAL, LPARAM lParam OPTIONAL)
{
@@ -802,8 +1303,10 @@ KbSwitch_OnDefault(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == g_uTaskbarRestartMsg)
{
UpdateTrayInfo();
UpdateLayoutList(NULL);
AddTrayIcon(hwnd);
UpdatePenIcon(hwnd, g_iKL);
return 0;
}
@@ -820,6 +1323,67 @@ KbSwitch_OnDefault(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
static VOID
OnIndicatorMsg(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HKL hKL = (HKL)lParam;
UINT iKL = GetLayoutIndexFromHKL(hKL);
if (iKL >= g_cKLs)
return;
g_iKL = iKL;
switch (uMsg)
{
case INDICM_SETIMEICON:
if (LOWORD(wParam) == MAXWORD)
{
g_anFlags[iKL] &= ~LAYOUTF_IME_ICON;
g_aiSysPenIcons[iKL] = MAXWORD;
}
else
{
g_anFlags[iKL] |= LAYOUTF_IME_ICON;
g_aiSysPenIcons[iKL] = (WORD)wParam;
}
UpdatePenIcon(hwnd, iKL);
break;
case INDICM_SETIMETOOLTIPS:
if (LOWORD(wParam) == MAXWORD)
{
g_anFlags[iKL] &= ~LAYOUTF_TOOLTIP_ATOM;
}
else
{
g_anFlags[iKL] |= LAYOUTF_TOOLTIP_ATOM;
g_anToolTipAtoms[iKL] = LOWORD(wParam);
}
UpdatePenIcon(hwnd, iKL);
break;
case INDICM_REMOVEDEFAULTMENUITEMS:
if (wParam)
{
if (wParam & RDMI_LEFT)
g_anFlags[iKL] |= LAYOUTF_REMOVE_LEFT_DEF_MENU;
if (wParam & RDMI_RIGHT)
g_anFlags[iKL] |= LAYOUTF_REMOVE_RIGHT_DEF_MENU;
}
else
{
g_anFlags[iKL] &= ~(LAYOUTF_REMOVE_LEFT_DEF_MENU | LAYOUTF_REMOVE_RIGHT_DEF_MENU);
}
break;
default:
{
ERR("uMsg: %u\n", uMsg);
return;
}
}
}
LRESULT CALLBACK
WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
@@ -842,6 +1406,10 @@ WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
KbSwitch_OnNotifyIconMsg(hwnd, (UINT)lParam);
break;
case WM_PENICONMSG:
KbSwitch_OnPenIconMsg(hwnd, (UINT)lParam);
break;
case WM_COMMAND:
KbSwitch_OnCommand(hwnd, LOWORD(wParam));
break;
@@ -854,6 +1422,18 @@ WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
KbSwitch_OnDestroy(hwnd);
break;
case INDICM_SETIMEICON:
case INDICM_SETIMETOOLTIPS:
case INDICM_REMOVEDEFAULTMENUITEMS:
if (InSendMessageEx(NULL))
break; /* Must be a PostMessage call for quick response, not SendMessage */
OnIndicatorMsg(hwnd, uMsg, wParam, lParam);
break;
case WM_INPUTLANGCHANGEREQUEST:
break;
default:
return KbSwitch_OnDefault(hwnd, uMsg, wParam, lParam);
}
@@ -879,7 +1459,7 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdSh
break;
}
hMutex = CreateMutex(NULL, FALSE, szKbSwitcherName);
hMutex = CreateMutex(NULL, FALSE, INDICATOR_CLASS);
if (!hMutex)
{
ERR("!hMutex\n");
@@ -899,14 +1479,14 @@ _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdSh
WndClass.lpfnWndProc = WndProc;
WndClass.hInstance = hInstance;
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.lpszClassName = szKbSwitcherName;
WndClass.lpszClassName = INDICATOR_CLASS;
if (!RegisterClass(&WndClass))
{
CloseHandle(hMutex);
return 1;
}
hwnd = CreateWindow(szKbSwitcherName, NULL, 0, 0, 0, 1, 1, HWND_DESKTOP, NULL, hInstance, NULL);
hwnd = CreateWindow(INDICATOR_CLASS, NULL, 0, 0, 0, 1, 1, HWND_DESKTOP, NULL, hInstance, NULL);
g_uShellHookMessage = RegisterWindowMessage(L"SHELLHOOK");
if (!RegisterShellHookWindow(hwnd))
{

View File

@@ -13,16 +13,25 @@
#include <ime/indicml.h> /* INDICATOR_CLASS, INDICM_... */
#include "resource.h"
#include "indicdll/resource.h"
#define CCH_LAYOUT_ID 8 // Character Count of a layout ID like "00000409"
#define CCH_ULONG_DEC 10 // Maximum Character Count of a ULONG in decimal
// Far East Language IDs
#define LANGID_CHINESE_SIMPLIFIED MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)
#define LANGID_CHINESE_TRADITIONAL MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)
#define LANGID_JAPANESE MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT)
#define LANGID_KOREAN MAKELANGID(LANG_KOREAN, SUBLANG_DEFAULT)
#define WM_LANG_CHANGED (WM_USER + 10200)
#define WM_WINDOW_ACTIVATE (WM_USER + 10300)
typedef BOOL (APIENTRY *FN_KbSwitchSetHooks)(BOOL bDoHook);
const TCHAR szKbSwitcherName[] = INDICATOR_CLASS;
#define IME_STATUS_NO_IME 0
#define IME_STATUS_IME_CLOSED 1
#define IME_STATUS_IME_OPEN 2
#define IME_STATUS_IME_NATIVE 4
#define IME_STATUS_IME_FULLSHAPE 8
static inline BOOL
IsWndClassName(_In_opt_ HWND hwndTarget, PCTSTR pszName)

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "Из&ход", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -14,3 +14,13 @@ BEGIN
MENUITEM "&Ukončit", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "&Beenden", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "E&xit", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "&Salir", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "V&älju", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "Quitt&er", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "&יציאה", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "&Esci", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "終了(&E)", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "入力システム (IME) - オン"
IDS_IME_OFF "入力システム (IME) - オフ"
IDS_SOFTKBD_ON "ソフト キーボード - オン"
IDS_SOFTKBD_OFF "ソフト キーボード - オフ"
IDS_SHOWTOOLBAR "ツールバーを表示する"
IDS_INPUTSYSTEM "入力システム (IME) の設定..."
END

View File

@@ -11,3 +11,13 @@ BEGIN
MENUITEM "&Baigti", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "&Avslutt", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -17,3 +17,13 @@ BEGIN
MENUITEM "&Wyjście", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -11,3 +11,13 @@ BEGIN
MENUITEM "&Sair", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -16,3 +16,13 @@ BEGIN
MENUITEM "&Sair", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -16,3 +16,13 @@ BEGIN
MENUITEM "I&eșire", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -9,3 +9,13 @@ BEGIN
MENUITEM "&Выход", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -13,3 +13,13 @@ BEGIN
MENUITEM "&Zavrieť", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -13,3 +13,13 @@ BEGIN
MENUITEM "&Dil", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -11,3 +11,13 @@ BEGIN
MENUITEM "&Avsluta", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -11,3 +11,13 @@ BEGIN
MENUITEM "&Çıkış", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -17,3 +17,13 @@ BEGIN
MENUITEM "В&ихід", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -17,3 +17,13 @@ BEGIN
MENUITEM "退出(&E)", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -17,3 +17,13 @@ BEGIN
MENUITEM "結束(&E)", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -17,3 +17,13 @@ BEGIN
MENUITEM "結束(&E)", ID_EXIT
END
END
STRINGTABLE
BEGIN
IDS_IME_ON "Input System (IME) - ON"
IDS_IME_OFF "Input System (IME) - OFF"
IDS_SOFTKBD_ON "Soft Keyboard - ON"
IDS_SOFTKBD_OFF "Soft Keyboard - OFF"
IDS_SHOWTOOLBAR "Show Toolbar"
IDS_INPUTSYSTEM "Input System (IME) configuration..."
END

View File

@@ -1,12 +1,24 @@
#pragma once
/* Icons */
#define IDI_MAIN 100
#define IDI_MAIN 150
/* Menus */
#define IDR_POPUP 100
/* Strings */
#define IDS_IME_ON 300
#define IDS_IME_OFF 301
#define IDS_SOFTKBD_ON 302
#define IDS_SOFTKBD_OFF 303
#define IDS_SHOWTOOLBAR 304
#define IDS_INPUTSYSTEM 305
/* Menu items */
#define ID_EXIT 100
#define ID_EXIT 100
#define ID_PREFERENCES 101
#define ID_LANG_BASE 1000
#define ID_INPUTSYSTEM 252
#define ID_IMEONOFF 500
#define ID_SOFTKBDONOFF 501
#define ID_SHOWTOOLBAR 502
#define ID_LANG_BASE 1000

View File

@@ -64,7 +64,14 @@ BOOL PerfDataInitialize(void)
* Create the SYSTEM Sid
*/
AllocateAndInitializeSid(&NtSidAuthority, 1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0, &SystemUserSid);
return TRUE;
/*
* Set up global info storage
*/
SystemProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)HeapAlloc(GetProcessHeap(),
0, sizeof(*SystemProcessorTimeInfo) * SystemBasicInfo.NumberOfProcessors);
return SystemProcessorTimeInfo != NULL;
}
void PerfDataUninitialize(void)
@@ -247,10 +254,12 @@ void PerfDataRefresh(void)
/*
* Save system processor time info
*/
if (SystemProcessorTimeInfo) {
HeapFree(GetProcessHeap(), 0, SystemProcessorTimeInfo);
memcpy(SystemProcessorTimeInfo, SysProcessorTimeInfo,
sizeof(*SystemProcessorTimeInfo) * SystemBasicInfo.NumberOfProcessors);
if (SysProcessorTimeInfo) {
HeapFree(GetProcessHeap(), 0, SysProcessorTimeInfo);
}
SystemProcessorTimeInfo = SysProcessorTimeInfo;
/*
* Save system handle info

View File

@@ -8,18 +8,18 @@ list(APPEND SOURCE
categorymgr.c
compartmentmgr.c
context.c
displayattributemgr.c
documentmgr.c
inputprocessor.c
msctf.c
range.c
threadmgr.c
precomp.h
${CMAKE_CURRENT_BINARY_DIR}/msctf_stubs.c)
list(APPEND PCH_SKIP_SOURCE
displayattributemgr.cpp
documentmgr.cpp
langbarmgr.cpp
mlng.cpp
range.cpp
utils.cpp)
add_library(msctf MODULE

View File

@@ -1,143 +0,0 @@
/*
* ITfDisplayAttributeMgr implementation
*
* Copyright 2010 CodeWeavers, Aric Stewart
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "wine/debug.h"
#include "winbase.h"
#include "winreg.h"
#include "shlwapi.h"
#include "msctf.h"
#include "msctf_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
typedef struct tagDisplayAttributeMgr {
ITfDisplayAttributeMgr ITfDisplayAttributeMgr_iface;
LONG refCount;
} DisplayAttributeMgr;
static inline DisplayAttributeMgr *impl_from_ITfDisplayAttributeMgr(ITfDisplayAttributeMgr *iface)
{
return CONTAINING_RECORD(iface, DisplayAttributeMgr, ITfDisplayAttributeMgr_iface);
}
static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This)
{
TRACE("destroying %p\n", This);
HeapFree(GetProcessHeap(),0,This);
}
static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut)
{
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr))
{
*ppvOut = &This->ITfDisplayAttributeMgr_iface;
}
if (*ppvOut)
{
ITfDisplayAttributeMgr_AddRef(iface);
return S_OK;
}
WARN("unsupported interface: %s\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface)
{
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface)
{
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
if (ret == 0)
DisplayAttributeMgr_Destructor(This);
return ret;
}
/*****************************************************
* ITfDisplayAttributeMgr functions
*****************************************************/
static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface)
{
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum)
{
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner)
{
DisplayAttributeMgr *This = impl_from_ITfDisplayAttributeMgr(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgrVtbl =
{
DisplayAttributeMgr_QueryInterface,
DisplayAttributeMgr_AddRef,
DisplayAttributeMgr_Release,
DisplayAttributeMgr_OnUpdateInfo,
DisplayAttributeMgr_EnumDisplayAttributeInfo,
DisplayAttributeMgr_GetDisplayAttributeInfo
};
HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
{
DisplayAttributeMgr *This;
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
This = HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr));
if (This == NULL)
return E_OUTOFMEMORY;
This->ITfDisplayAttributeMgr_iface.lpVtbl = &DisplayAttributeMgrVtbl;
This->refCount = 1;
*ppOut = (IUnknown *)&This->ITfDisplayAttributeMgr_iface;
TRACE("returning %p\n", *ppOut);
return S_OK;
}

View File

@@ -0,0 +1,157 @@
/*
* PROJECT: ReactOS CTF
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: ITfDisplayAttributeMgr implementation
* COPYRIGHT: Copyright 2010 CodeWeavers, Aric Stewart
* Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#include <initguid.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <msctf.h>
#include <msctf_undoc.h>
// Cicero
#include <cicbase.h>
#include <cicreg.h>
#include <cicutb.h>
#include "displayattributemgr.h"
#include "msctf_internal.h"
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
////////////////////////////////////////////////////////////////////////////
// CDisplayAttributeMgr
CDisplayAttributeMgr::CDisplayAttributeMgr()
: m_cRefs(1)
{
}
CDisplayAttributeMgr::~CDisplayAttributeMgr()
{
}
BOOL CDisplayAttributeMgr::_IsInCollection(REFGUID rguid)
{
FIXME("(%p)\n", wine_dbgstr_guid(&rguid));
return FALSE;
}
void CDisplayAttributeMgr::_AdviseMarkupCollection(ITfTextInputProcessor *pProcessor, DWORD dwCookie)
{
FIXME("(%p, %u)\n", pProcessor, dwCookie);
}
void CDisplayAttributeMgr::_UnadviseMarkupCollection(DWORD dwCookie)
{
FIXME("(%u)\n", dwCookie);
}
void CDisplayAttributeMgr::_SetThis()
{
FIXME("()\n");
}
////////////////////////////////////////////////////////////////////////////
// ** IUnknown methods **
STDMETHODIMP
CDisplayAttributeMgr::QueryInterface(REFIID riid, void **ppvObj)
{
if (!ppvObj)
return E_INVALIDARG;
*ppvObj = NULL;
if (IsEqualIID(riid, IID_IUnknown) ||
IsEqualIID(riid, IID_ITfDisplayAttributeMgr) ||
IsEqualIID(riid, IID_CDisplayAttributeMgr))
{
*ppvObj = this;
}
else if (IsEqualIID(riid, IID_ITfDisplayAttributeCollectionMgr))
{
*ppvObj = static_cast<ITfDisplayAttributeCollectionMgr *>(this);
}
if (!*ppvObj)
return E_NOINTERFACE;
AddRef();
return S_OK;
}
STDMETHODIMP_(ULONG)
CDisplayAttributeMgr::AddRef()
{
return ::InterlockedIncrement(&m_cRefs);
}
STDMETHODIMP_(ULONG)
CDisplayAttributeMgr::Release()
{
if (::InterlockedDecrement(&m_cRefs) == 0)
{
delete this;
return 0;
}
return m_cRefs;
}
////////////////////////////////////////////////////////////////////////////
// ** ITfDisplayAttributeMgr methods **
STDMETHODIMP CDisplayAttributeMgr::OnUpdateInfo()
{
FIXME("()\n");
return E_NOTIMPL;
}
STDMETHODIMP
CDisplayAttributeMgr::EnumDisplayAttributeInfo(_Out_ IEnumTfDisplayAttributeInfo **ppEnum)
{
FIXME("(%p)\n", ppEnum);
return E_NOTIMPL;
}
STDMETHODIMP
CDisplayAttributeMgr::GetDisplayAttributeInfo(
_In_ REFGUID guid,
_Out_ ITfDisplayAttributeInfo **ppInfo,
_Out_ CLSID *pclsidOwner)
{
FIXME("(%s, %p, %s)\n", wine_dbgstr_guid(&guid), ppInfo, wine_dbgstr_guid(pclsidOwner));
return E_NOTIMPL;
}
////////////////////////////////////////////////////////////////////////////
// ** ITfDisplayAttributeCollectionMgr methods **
STDMETHODIMP
CDisplayAttributeMgr::UnknownMethod(_In_ DWORD unused)
{
FIXME("(0x%lX)\n", unused);
return E_NOTIMPL;
}
////////////////////////////////////////////////////////////////////////////
EXTERN_C
HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
{
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
CDisplayAttributeMgr *This = new(cicNoThrow) CDisplayAttributeMgr();
if (!This)
return E_OUTOFMEMORY;
HRESULT hr = This->QueryInterface(IID_ITfDisplayAttributeMgr, (void **)ppOut);
This->Release();
return hr;
}

View File

@@ -0,0 +1,40 @@
#pragma once
#include <cicarray.h>
DEFINE_GUID(IID_CDisplayAttributeMgr, 0xFF4619E8, 0xEA5E, 0x43E5, 0xB3, 0x08, 0x11, 0xCD, 0x26, 0xAB, 0x6B, 0x3A);
class CDisplayAttributeMgr
: public ITfDisplayAttributeMgr
, public ITfDisplayAttributeCollectionMgr
{
public:
CDisplayAttributeMgr();
virtual ~CDisplayAttributeMgr();
// ** IUnknown methods **
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj) override;
STDMETHODIMP_(ULONG) AddRef() override;
STDMETHODIMP_(ULONG) Release() override;
// ** ITfDisplayAttributeMgr methods **
STDMETHODIMP OnUpdateInfo() override;
STDMETHODIMP EnumDisplayAttributeInfo(_Out_ IEnumTfDisplayAttributeInfo **ppEnum) override;
STDMETHODIMP GetDisplayAttributeInfo(
_In_ REFGUID guid,
_Out_ ITfDisplayAttributeInfo **ppInfo,
_Out_ CLSID *pclsidOwner) override;
// ** ITfDisplayAttributeCollectionMgr methods **
STDMETHODIMP UnknownMethod(_In_ DWORD unused) override; // FIXME
protected:
LONG m_cRefs;
CicArray<IUnknown *> m_array1;
CicArray<DWORD> m_array2;
BOOL _IsInCollection(REFGUID rguid);
void _AdviseMarkupCollection(ITfTextInputProcessor *pProcessor, DWORD dwCookie);
void _UnadviseMarkupCollection(DWORD dwCookie);
void _SetThis();
};

View File

@@ -1,500 +0,0 @@
/*
* ITfDocumentMgr implementation
*
* Copyright 2009 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "msctf.h"
#include "msctf_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
typedef struct tagDocumentMgr {
ITfDocumentMgr ITfDocumentMgr_iface;
ITfSource ITfSource_iface;
LONG refCount;
/* Aggregation */
ITfCompartmentMgr *CompartmentMgr;
ITfContext* contextStack[2]; /* limit of 2 contexts */
ITfThreadMgrEventSink* ThreadMgrSink;
struct list TransitoryExtensionSink;
} DocumentMgr;
typedef struct tagEnumTfContext {
IEnumTfContexts IEnumTfContexts_iface;
LONG refCount;
DWORD index;
DocumentMgr *docmgr;
} EnumTfContext;
static HRESULT EnumTfContext_Constructor(DocumentMgr* mgr, IEnumTfContexts **ppOut);
static inline DocumentMgr *impl_from_ITfDocumentMgr(ITfDocumentMgr *iface)
{
return CONTAINING_RECORD(iface, DocumentMgr, ITfDocumentMgr_iface);
}
static inline DocumentMgr *impl_from_ITfSource(ITfSource *iface)
{
return CONTAINING_RECORD(iface, DocumentMgr, ITfSource_iface);
}
static inline EnumTfContext *impl_from_IEnumTfContexts(IEnumTfContexts *iface)
{
return CONTAINING_RECORD(iface, EnumTfContext, IEnumTfContexts_iface);
}
static void DocumentMgr_Destructor(DocumentMgr *This)
{
ITfThreadMgr *tm = NULL;
TRACE("destroying %p\n", This);
TF_GetThreadMgr(&tm);
if (tm)
{
ThreadMgr_OnDocumentMgrDestruction(tm, &This->ITfDocumentMgr_iface);
ITfThreadMgr_Release(tm);
}
if (This->contextStack[0])
ITfContext_Release(This->contextStack[0]);
if (This->contextStack[1])
ITfContext_Release(This->contextStack[1]);
free_sinks(&This->TransitoryExtensionSink);
CompartmentMgr_Destructor(This->CompartmentMgr);
HeapFree(GetProcessHeap(),0,This);
}
static HRESULT WINAPI DocumentMgr_QueryInterface(ITfDocumentMgr *iface, REFIID iid, LPVOID *ppvOut)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDocumentMgr))
{
*ppvOut = &This->ITfDocumentMgr_iface;
}
else if (IsEqualIID(iid, &IID_ITfSource))
{
*ppvOut = &This->ITfSource_iface;
}
else if (IsEqualIID(iid, &IID_ITfCompartmentMgr))
{
*ppvOut = This->CompartmentMgr;
}
if (*ppvOut)
{
ITfDocumentMgr_AddRef(iface);
return S_OK;
}
WARN("unsupported interface: %s\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
static ULONG WINAPI DocumentMgr_AddRef(ITfDocumentMgr *iface)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI DocumentMgr_Release(ITfDocumentMgr *iface)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
if (ret == 0)
DocumentMgr_Destructor(This);
return ret;
}
/*****************************************************
* ITfDocumentMgr functions
*****************************************************/
static HRESULT WINAPI DocumentMgr_CreateContext(ITfDocumentMgr *iface,
TfClientId tidOwner,
DWORD dwFlags, IUnknown *punk, ITfContext **ppic,
TfEditCookie *pecTextStore)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
TRACE("(%p) 0x%x 0x%x %p %p %p\n",This,tidOwner,dwFlags,punk,ppic,pecTextStore);
return Context_Constructor(tidOwner, punk, iface, ppic, pecTextStore);
}
static HRESULT WINAPI DocumentMgr_Push(ITfDocumentMgr *iface, ITfContext *pic)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
ITfContext *check;
TRACE("(%p) %p\n",This,pic);
if (This->contextStack[1]) /* FUll */
return TF_E_STACKFULL;
if (!pic || FAILED(ITfContext_QueryInterface(pic,&IID_ITfContext,(LPVOID*) &check)))
return E_INVALIDARG;
if (This->contextStack[0] == NULL)
ITfThreadMgrEventSink_OnInitDocumentMgr(This->ThreadMgrSink,iface);
This->contextStack[1] = This->contextStack[0];
This->contextStack[0] = check;
Context_Initialize(check, iface);
ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
return S_OK;
}
static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
TRACE("(%p) 0x%x\n",This,dwFlags);
if (dwFlags == TF_POPF_ALL)
{
int i;
for (i = 0; i < ARRAY_SIZE(This->contextStack); i++)
if (This->contextStack[i])
{
ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink, This->contextStack[i]);
Context_Uninitialize(This->contextStack[i]);
ITfContext_Release(This->contextStack[i]);
This->contextStack[i] = NULL;
}
ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface);
return S_OK;
}
if (dwFlags)
return E_INVALIDARG;
if (This->contextStack[1] == NULL) /* Cannot pop last context */
return E_FAIL;
ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[0]);
Context_Uninitialize(This->contextStack[0]);
ITfContext_Release(This->contextStack[0]);
This->contextStack[0] = This->contextStack[1];
This->contextStack[1] = NULL;
if (This->contextStack[0] == NULL)
ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface);
return S_OK;
}
static HRESULT WINAPI DocumentMgr_GetTop(ITfDocumentMgr *iface, ITfContext **ppic)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
TRACE("(%p)\n",This);
if (!ppic)
return E_INVALIDARG;
if (This->contextStack[0])
ITfContext_AddRef(This->contextStack[0]);
*ppic = This->contextStack[0];
return S_OK;
}
static HRESULT WINAPI DocumentMgr_GetBase(ITfDocumentMgr *iface, ITfContext **ppic)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
ITfContext *tgt;
TRACE("(%p)\n",This);
if (!ppic)
return E_INVALIDARG;
if (This->contextStack[1])
tgt = This->contextStack[1];
else
tgt = This->contextStack[0];
if (tgt)
ITfContext_AddRef(tgt);
*ppic = tgt;
return S_OK;
}
static HRESULT WINAPI DocumentMgr_EnumContexts(ITfDocumentMgr *iface, IEnumTfContexts **ppEnum)
{
DocumentMgr *This = impl_from_ITfDocumentMgr(iface);
TRACE("(%p) %p\n",This,ppEnum);
return EnumTfContext_Constructor(This, ppEnum);
}
static const ITfDocumentMgrVtbl DocumentMgrVtbl =
{
DocumentMgr_QueryInterface,
DocumentMgr_AddRef,
DocumentMgr_Release,
DocumentMgr_CreateContext,
DocumentMgr_Push,
DocumentMgr_Pop,
DocumentMgr_GetTop,
DocumentMgr_GetBase,
DocumentMgr_EnumContexts
};
static HRESULT WINAPI DocumentMgrSource_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut)
{
DocumentMgr *This = impl_from_ITfSource(iface);
return ITfDocumentMgr_QueryInterface(&This->ITfDocumentMgr_iface, iid, ppvOut);
}
static ULONG WINAPI DocumentMgrSource_AddRef(ITfSource *iface)
{
DocumentMgr *This = impl_from_ITfSource(iface);
return ITfDocumentMgr_AddRef(&This->ITfDocumentMgr_iface);
}
static ULONG WINAPI DocumentMgrSource_Release(ITfSource *iface)
{
DocumentMgr *This = impl_from_ITfSource(iface);
return ITfDocumentMgr_Release(&This->ITfDocumentMgr_iface);
}
/*****************************************************
* ITfSource functions
*****************************************************/
static HRESULT WINAPI DocumentMgrSource_AdviseSink(ITfSource *iface,
REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{
DocumentMgr *This = impl_from_ITfSource(iface);
TRACE("(%p) %s %p %p\n", This, debugstr_guid(riid), punk, pdwCookie);
if (!riid || !punk || !pdwCookie)
return E_INVALIDARG;
if (IsEqualIID(riid, &IID_ITfTransitoryExtensionSink))
{
WARN("semi-stub for ITfTransitoryExtensionSink: callback won't be used.\n");
return advise_sink(&This->TransitoryExtensionSink, &IID_ITfTransitoryExtensionSink,
COOKIE_MAGIC_DMSINK, punk, pdwCookie);
}
FIXME("(%p) Unhandled Sink: %s\n",This,debugstr_guid(riid));
return E_NOTIMPL;
}
static HRESULT WINAPI DocumentMgrSource_UnadviseSink(ITfSource *iface, DWORD pdwCookie)
{
DocumentMgr *This = impl_from_ITfSource(iface);
TRACE("(%p) %x\n",This,pdwCookie);
if (get_Cookie_magic(pdwCookie)!=COOKIE_MAGIC_DMSINK)
return E_INVALIDARG;
return unadvise_sink(pdwCookie);
}
static const ITfSourceVtbl DocumentMgrSourceVtbl =
{
DocumentMgrSource_QueryInterface,
DocumentMgrSource_AddRef,
DocumentMgrSource_Release,
DocumentMgrSource_AdviseSink,
DocumentMgrSource_UnadviseSink,
};
HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *ThreadMgrSink, ITfDocumentMgr **ppOut)
{
DocumentMgr *This;
This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DocumentMgr));
if (This == NULL)
return E_OUTOFMEMORY;
This->ITfDocumentMgr_iface.lpVtbl = &DocumentMgrVtbl;
This->ITfSource_iface.lpVtbl = &DocumentMgrSourceVtbl;
This->refCount = 1;
This->ThreadMgrSink = ThreadMgrSink;
list_init(&This->TransitoryExtensionSink);
CompartmentMgr_Constructor((IUnknown*)&This->ITfDocumentMgr_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr);
*ppOut = &This->ITfDocumentMgr_iface;
TRACE("returning %p\n", *ppOut);
return S_OK;
}
/**************************************************
* IEnumTfContexts implementation
**************************************************/
static void EnumTfContext_Destructor(EnumTfContext *This)
{
TRACE("destroying %p\n", This);
HeapFree(GetProcessHeap(),0,This);
}
static HRESULT WINAPI EnumTfContext_QueryInterface(IEnumTfContexts *iface, REFIID iid, LPVOID *ppvOut)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IEnumTfContexts))
{
*ppvOut = &This->IEnumTfContexts_iface;
}
if (*ppvOut)
{
IEnumTfContexts_AddRef(iface);
return S_OK;
}
WARN("unsupported interface: %s\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
static ULONG WINAPI EnumTfContext_AddRef(IEnumTfContexts *iface)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI EnumTfContext_Release(IEnumTfContexts *iface)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
if (ret == 0)
EnumTfContext_Destructor(This);
return ret;
}
static HRESULT WINAPI EnumTfContext_Next(IEnumTfContexts *iface,
ULONG ulCount, ITfContext **rgContext, ULONG *pcFetched)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
ULONG fetched = 0;
TRACE("(%p)\n",This);
if (rgContext == NULL) return E_POINTER;
while (fetched < ulCount)
{
if (This->index > 1)
break;
if (!This->docmgr->contextStack[This->index])
break;
*rgContext = This->docmgr->contextStack[This->index];
ITfContext_AddRef(*rgContext);
++This->index;
++fetched;
++rgContext;
}
if (pcFetched) *pcFetched = fetched;
return fetched == ulCount ? S_OK : S_FALSE;
}
static HRESULT WINAPI EnumTfContext_Skip( IEnumTfContexts* iface, ULONG celt)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
TRACE("(%p)\n",This);
This->index += celt;
return S_OK;
}
static HRESULT WINAPI EnumTfContext_Reset( IEnumTfContexts* iface)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
TRACE("(%p)\n",This);
This->index = 0;
return S_OK;
}
static HRESULT WINAPI EnumTfContext_Clone( IEnumTfContexts *iface,
IEnumTfContexts **ppenum)
{
EnumTfContext *This = impl_from_IEnumTfContexts(iface);
HRESULT res;
TRACE("(%p)\n",This);
if (ppenum == NULL) return E_POINTER;
res = EnumTfContext_Constructor(This->docmgr, ppenum);
if (SUCCEEDED(res))
{
EnumTfContext *new_This = impl_from_IEnumTfContexts(*ppenum);
new_This->index = This->index;
}
return res;
}
static const IEnumTfContextsVtbl IEnumTfContexts_Vtbl ={
EnumTfContext_QueryInterface,
EnumTfContext_AddRef,
EnumTfContext_Release,
EnumTfContext_Clone,
EnumTfContext_Next,
EnumTfContext_Reset,
EnumTfContext_Skip
};
static HRESULT EnumTfContext_Constructor(DocumentMgr *mgr, IEnumTfContexts **ppOut)
{
EnumTfContext *This;
This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(EnumTfContext));
if (This == NULL)
return E_OUTOFMEMORY;
This->IEnumTfContexts_iface.lpVtbl = &IEnumTfContexts_Vtbl;
This->refCount = 1;
This->docmgr = mgr;
*ppOut = &This->IEnumTfContexts_iface;
TRACE("returning %p\n", *ppOut);
return S_OK;
}

View File

@@ -0,0 +1,461 @@
/*
* PROJECT: ReactOS CTF
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Implementation of ITfDocumentMgr and IEnumTfContexts
* COPYRIGHT: Copyright 2009 Aric Stewart, CodeWeavers
* Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#include <initguid.h>
#include <windef.h>
#include <winbase.h>
#include <oleauto.h>
#include <msctf.h>
#include <msctf_undoc.h>
#include <wine/list.h>
// Cicero
#include <cicbase.h>
#include "documentmgr.h"
#include "msctf_internal.h"
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
EXTERN_C
HRESULT EnumTfContext_Constructor(CDocumentMgr *mgr, IEnumTfContexts **ppOut);
////////////////////////////////////////////////////////////////////////////
// CDocumentMgr
CDocumentMgr::CDocumentMgr(ITfThreadMgrEventSink *threadMgrSink)
: m_cRefs(1)
, m_pCompartmentMgr(NULL)
, m_pThreadMgrSink(threadMgrSink)
{
m_contextStack[1] = m_contextStack[0] = NULL;
list_init(&m_transitoryExtensionSink);
ITfDocumentMgr *pDocMgr = static_cast<ITfDocumentMgr *>(this);
ITfCompartmentMgr **ppCompMgr = static_cast<ITfCompartmentMgr **>(&m_pCompartmentMgr);
CompartmentMgr_Constructor(pDocMgr, IID_IUnknown, reinterpret_cast<IUnknown **>(ppCompMgr));
}
CDocumentMgr::~CDocumentMgr()
{
TRACE("destroying %p\n", this);
ITfThreadMgr *tm = NULL;
TF_GetThreadMgr(&tm);
if (tm)
{
ThreadMgr_OnDocumentMgrDestruction(tm, static_cast<ITfDocumentMgr*>(this));
tm->Release();
}
if (m_contextStack[0])
{
m_contextStack[0]->Release();
m_contextStack[0] = NULL;
}
if (m_contextStack[1])
{
m_contextStack[1]->Release();
m_contextStack[1] = NULL;
}
free_sinks(&m_transitoryExtensionSink);
if (m_pCompartmentMgr)
{
m_pCompartmentMgr->Release();
m_pCompartmentMgr = NULL;
}
}
HRESULT
CDocumentMgr::CreateInstance(
_In_ ITfThreadMgrEventSink *pThreadMgrSink,
_Out_ ITfDocumentMgr **ppOut)
{
if (!ppOut)
{
ERR("!ppOut\n");
return E_POINTER;
}
if (!pThreadMgrSink)
{
ERR("!pThreadMgrSink\n");
return E_INVALIDARG;
}
CDocumentMgr *This = new(cicNoThrow) CDocumentMgr(pThreadMgrSink);
if (!This)
{
ERR("E_OUTOFMEMORY\n");
return E_OUTOFMEMORY;
}
*ppOut = static_cast<ITfDocumentMgr *>(This);
TRACE("returning %p\n", *ppOut);
return S_OK;
}
STDMETHODIMP CDocumentMgr::QueryInterface(REFIID iid, LPVOID *ppvObject)
{
TRACE("%p -> (%s, %p)\n", this, wine_dbgstr_guid(&iid), ppvObject);
*ppvObject = NULL;
if (iid == IID_IUnknown || iid == IID_ITfDocumentMgr)
*ppvObject = static_cast<ITfDocumentMgr *>(this);
else if (iid == IID_ITfSource)
*ppvObject = static_cast<ITfSource *>(this);
else if (iid == IID_ITfCompartmentMgr)
*ppvObject = m_pCompartmentMgr;
if (*ppvObject)
{
AddRef();
return S_OK;
}
ERR("E_NOINTERFACE: %s\n", wine_dbgstr_guid(&iid));
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) CDocumentMgr::AddRef()
{
TRACE("%p -> ()\n", this);
return ::InterlockedIncrement(&m_cRefs);
}
STDMETHODIMP_(ULONG) CDocumentMgr::Release()
{
TRACE("%p -> ()\n", this);
ULONG ret = ::InterlockedDecrement(&m_cRefs);
if (!ret)
delete this;
return ret;
}
STDMETHODIMP
CDocumentMgr::CreateContext(
TfClientId tidOwner,
DWORD dwFlags,
IUnknown *punk,
ITfContext **ppic,
TfEditCookie *pecTextStore)
{
TRACE("%p -> (%d, 0x%lX, %p, %p, %p)\n", this, tidOwner, dwFlags, punk, ppic, pecTextStore);
return Context_Constructor(tidOwner, punk, this, ppic, pecTextStore);
}
STDMETHODIMP CDocumentMgr::Push(ITfContext *pic)
{
TRACE("%p -> (%p)\n", this, pic);
if (m_contextStack[1]) /* Full */
{
ERR("TF_E_STACKFULL\n");
return TF_E_STACKFULL;
}
if (!pic)
{
ERR("!pic\n");
return E_INVALIDARG;
}
ITfContext *check;
HRESULT hr = pic->QueryInterface(IID_ITfContext, reinterpret_cast<LPVOID *>(&check));
if (FAILED(hr))
{
ERR("hr: 0x%lX\n", hr);
return E_INVALIDARG;
}
if (!m_contextStack[0])
m_pThreadMgrSink->OnInitDocumentMgr(this);
m_contextStack[1] = m_contextStack[0];
m_contextStack[0] = check;
Context_Initialize(check, this);
m_pThreadMgrSink->OnPushContext(check);
return S_OK;
}
STDMETHODIMP CDocumentMgr::Pop(DWORD dwFlags)
{
TRACE("%p -> (0x%lX)\n", this, dwFlags);
if (dwFlags == TF_POPF_ALL)
{
for (SIZE_T i = 0; i < _countof(m_contextStack); i++)
{
if (!m_contextStack[i])
continue;
m_pThreadMgrSink->OnPopContext(m_contextStack[i]);
Context_Uninitialize(m_contextStack[i]);
m_contextStack[i]->Release();
m_contextStack[i] = NULL;
}
m_pThreadMgrSink->OnUninitDocumentMgr(this);
return S_OK;
}
if (dwFlags)
{
ERR("E_INVALIDARG: 0x%lX\n", dwFlags);
return E_INVALIDARG;
}
if (!m_contextStack[1]) // Cannot pop last context
{
ERR("!m_contextStack[1]\n");
return E_FAIL;
}
m_pThreadMgrSink->OnPopContext(m_contextStack[0]);
Context_Uninitialize(m_contextStack[0]);
if (m_contextStack[0])
m_contextStack[0]->Release();
m_contextStack[0] = m_contextStack[1];
m_contextStack[1] = NULL;
if (!m_contextStack[0])
m_pThreadMgrSink->OnUninitDocumentMgr(this);
return S_OK;
}
STDMETHODIMP CDocumentMgr::GetTop(ITfContext **ppic)
{
TRACE("%p -> (%p)\n", this, ppic);
if (!ppic)
{
ERR("!ppic\n");
return E_INVALIDARG;
}
if (m_contextStack[0])
m_contextStack[0]->AddRef();
*ppic = m_contextStack[0];
return S_OK;
}
STDMETHODIMP CDocumentMgr::GetBase(ITfContext **ppic)
{
TRACE("%p -> (%p)\n", this, ppic);
if (!ppic)
{
ERR("!ppic\n");
return E_INVALIDARG;
}
ITfContext *target = (m_contextStack[1] ? m_contextStack[1] : m_contextStack[0]);
*ppic = target;
if (target)
target->AddRef();
return S_OK;
}
STDMETHODIMP CDocumentMgr::EnumContexts(IEnumTfContexts **ppEnum)
{
TRACE("%p -> (%p)\n", this, ppEnum);
return EnumTfContext_Constructor(this, ppEnum);
}
STDMETHODIMP CDocumentMgr::AdviseSink(REFIID riid, IUnknown *punk, DWORD *pdwCookie)
{
TRACE("%p -> (%s, %p, %p)\n", this, wine_dbgstr_guid(&riid), punk, pdwCookie);
if (!punk || !pdwCookie)
return E_INVALIDARG;
if (riid != IID_ITfTransitoryExtensionSink)
{
FIXME("E_NOTIMPL: %s\n", wine_dbgstr_guid(&riid));
return E_NOTIMPL;
}
return advise_sink(&m_transitoryExtensionSink, IID_ITfTransitoryExtensionSink,
COOKIE_MAGIC_DMSINK, punk, pdwCookie);
}
STDMETHODIMP CDocumentMgr::UnadviseSink(DWORD pdwCookie)
{
TRACE("%p -> (%p)\n", this, pdwCookie);
if (get_Cookie_magic(pdwCookie) != COOKIE_MAGIC_DMSINK)
return E_INVALIDARG;
return unadvise_sink(pdwCookie);
}
////////////////////////////////////////////////////////////////////////////
// CEnumTfContext
CEnumTfContext::CEnumTfContext(_In_opt_ CDocumentMgr *mgr)
: m_cRefs(1)
, m_index(0)
, m_pDocMgr(mgr)
{
if (mgr)
mgr->AddRef();
}
CEnumTfContext::~CEnumTfContext()
{
if (m_pDocMgr)
{
m_pDocMgr->Release();
m_pDocMgr = NULL;
}
}
HRESULT CEnumTfContext::CreateInstance(_In_opt_ CDocumentMgr *mgr, _Out_ IEnumTfContexts **ppOut)
{
if (!ppOut)
{
ERR("!ppOut\n");
return E_POINTER;
}
CEnumTfContext *This = new(cicNoThrow) CEnumTfContext(mgr);
if (This == NULL)
{
ERR("E_OUTOFMEMORY\n");
return E_OUTOFMEMORY;
}
*ppOut = static_cast<IEnumTfContexts *>(This);
TRACE("returning %p\n", *ppOut);
return S_OK;
}
STDMETHODIMP CEnumTfContext::QueryInterface(REFIID iid, LPVOID *ppvObject)
{
TRACE("%p -> (%s, %p)\n", this, wine_dbgstr_guid(&iid), ppvObject);
*ppvObject = NULL;
if (iid == IID_IUnknown || iid == IID_IEnumTfContexts)
*ppvObject = static_cast<IEnumTfContexts *>(this);
if (*ppvObject)
{
AddRef();
return S_OK;
}
WARN("E_NOINTERFACE: %s\n", wine_dbgstr_guid(&iid));
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) CEnumTfContext::AddRef()
{
TRACE("%p -> ()\n", this);
return ::InterlockedIncrement(&m_cRefs);
}
STDMETHODIMP_(ULONG) CEnumTfContext::Release()
{
TRACE("%p -> ()\n", this);
ULONG ret = ::InterlockedDecrement(&m_cRefs);
if (!ret)
delete this;
return ret;
}
STDMETHODIMP CEnumTfContext::Next(ULONG ulCount, ITfContext **rgContext, ULONG *pcFetched)
{
TRACE("%p -> (%lu, %p, %p)\n",this, ulCount, rgContext, pcFetched);
if (!rgContext)
{
ERR("!rgContext\n");
return E_POINTER;
}
ULONG fetched;
for (fetched = 0; fetched < ulCount; ++fetched, ++m_index, ++rgContext)
{
if (m_index >= _countof(m_pDocMgr->m_contextStack))
break;
if (!m_pDocMgr->m_contextStack[m_index])
break;
*rgContext = m_pDocMgr->m_contextStack[m_index];
(*rgContext)->AddRef();
}
if (pcFetched)
*pcFetched = fetched;
return (fetched == ulCount) ? S_OK : S_FALSE;
}
STDMETHODIMP CEnumTfContext::Skip(ULONG celt)
{
TRACE("%p -> (%lu)\n", this, celt);
m_index += celt;
return S_OK;
}
STDMETHODIMP CEnumTfContext::Reset()
{
TRACE("%p -> ()\n", this);
m_index = 0;
return S_OK;
}
STDMETHODIMP CEnumTfContext::Clone(IEnumTfContexts **ppenum)
{
TRACE("%p -> (%p)\n", this, ppenum);
if (!ppenum)
{
ERR("!ppenum\n");
return E_POINTER;
}
CEnumTfContext *This = new(cicNoThrow) CEnumTfContext(m_pDocMgr);
if (!This)
{
ERR("E_OUTOFMEMORY\n");
return E_OUTOFMEMORY;
}
This->m_index = m_index;
*ppenum = This;
return S_OK;
}
////////////////////////////////////////////////////////////////////////////
EXTERN_C
HRESULT DocumentMgr_Constructor(ITfThreadMgrEventSink *pThreadMgrSink, ITfDocumentMgr **ppOut)
{
return CDocumentMgr::CreateInstance(pThreadMgrSink, ppOut);
}
EXTERN_C
HRESULT EnumTfContext_Constructor(CDocumentMgr *mgr, IEnumTfContexts **ppOut)
{
return CEnumTfContext::CreateInstance(mgr, ppOut);
}

View File

@@ -0,0 +1,86 @@
/*
* PROJECT: ReactOS CTF
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Implementation of ITfDocumentMgr and IEnumTfContexts
* COPYRIGHT: Copyright 2009 Aric Stewart, CodeWeavers
* Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#pragma once
////////////////////////////////////////////////////////////////////////////
// CDocumentMgr
class CDocumentMgr
: public ITfDocumentMgr
, public ITfSource
{
public:
CDocumentMgr(ITfThreadMgrEventSink *threadMgrSink);
virtual ~CDocumentMgr();
static HRESULT
CreateInstance(
_In_ ITfThreadMgrEventSink *pThreadMgrSink,
_Out_ ITfDocumentMgr **ppOut);
// ** IUnknown methods **
STDMETHODIMP QueryInterface(REFIID iid, LPVOID *ppvObject) override;
STDMETHODIMP_(ULONG) AddRef() override;
STDMETHODIMP_(ULONG) Release() override;
// ** ITfDocumentMgr methods **
STDMETHODIMP CreateContext(
TfClientId tidOwner,
DWORD dwFlags,
IUnknown *punk,
ITfContext **ppic,
TfEditCookie *pecTextStore) override;
STDMETHODIMP Push(ITfContext *pic) override;
STDMETHODIMP Pop(DWORD dwFlags) override;
STDMETHODIMP GetTop(ITfContext **ppic) override;
STDMETHODIMP GetBase(ITfContext **ppic) override;
STDMETHODIMP EnumContexts(IEnumTfContexts **ppEnum) override;
// ** ITfSource methods **
STDMETHODIMP AdviseSink(REFIID riid, IUnknown *punk, DWORD *pdwCookie) override;
STDMETHODIMP UnadviseSink(DWORD pdwCookie) override;
friend class CEnumTfContext;
protected:
LONG m_cRefs;
ITfCompartmentMgr *m_pCompartmentMgr;
ITfContext *m_contextStack[2]; // limit of 2 contexts
ITfThreadMgrEventSink *m_pThreadMgrSink;
struct list m_transitoryExtensionSink;
};
////////////////////////////////////////////////////////////////////////////
// CEnumTfContext
class CEnumTfContext
: public IEnumTfContexts
{
public:
CEnumTfContext(_In_opt_ CDocumentMgr *mgr);
virtual ~CEnumTfContext();
static HRESULT CreateInstance(_In_opt_ CDocumentMgr *mgr, _Out_ IEnumTfContexts **ppOut);
// ** IUnknown methods **
STDMETHODIMP QueryInterface(REFIID iid, LPVOID *ppvObject) override;
STDMETHODIMP_(ULONG) AddRef() override;
STDMETHODIMP_(ULONG) Release() override;
// ** IEnumTfContexts methods **
STDMETHODIMP Next(ULONG ulCount, ITfContext **rgContext, ULONG *pcFetched) override;
STDMETHODIMP Skip(ULONG celt) override;
STDMETHODIMP Reset() override;
STDMETHODIMP Clone(IEnumTfContexts **ppenum) override;
protected:
LONG m_cRefs;
DWORD m_index;
CDocumentMgr *m_pDocMgr;
};

View File

@@ -1,365 +0,0 @@
/*
* ITfRange implementation
*
* Copyright 2009 Aric Stewart, CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "wine/debug.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "shlwapi.h"
#include "winerror.h"
#include "objbase.h"
#include "msctf.h"
#include "msctf_internal.h"
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
typedef struct tagRange {
ITfRange ITfRange_iface;
/* const ITfRangeACPVtb *RangeACPVtbl; */
LONG refCount;
ITextStoreACP *pITextStoreACP;
ITfContext *pITfContext;
DWORD lockType;
TfGravity gravityStart, gravityEnd;
DWORD anchorStart, anchorEnd;
} Range;
static inline Range *impl_from_ITfRange(ITfRange *iface)
{
return CONTAINING_RECORD(iface, Range, ITfRange_iface);
}
static void Range_Destructor(Range *This)
{
TRACE("destroying %p\n", This);
HeapFree(GetProcessHeap(),0,This);
}
static HRESULT WINAPI Range_QueryInterface(ITfRange *iface, REFIID iid, LPVOID *ppvOut)
{
Range *This = impl_from_ITfRange(iface);
*ppvOut = NULL;
if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfRange))
{
*ppvOut = &This->ITfRange_iface;
}
if (*ppvOut)
{
ITfRange_AddRef(iface);
return S_OK;
}
WARN("unsupported interface: %s\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
static ULONG WINAPI Range_AddRef(ITfRange *iface)
{
Range *This = impl_from_ITfRange(iface);
return InterlockedIncrement(&This->refCount);
}
static ULONG WINAPI Range_Release(ITfRange *iface)
{
Range *This = impl_from_ITfRange(iface);
ULONG ret;
ret = InterlockedDecrement(&This->refCount);
if (ret == 0)
Range_Destructor(This);
return ret;
}
/*****************************************************
* ITfRange functions
*****************************************************/
static HRESULT WINAPI Range_GetText(ITfRange *iface, TfEditCookie ec,
DWORD dwFlags, WCHAR *pchText, ULONG cchMax, ULONG *pcch)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_SetText(ITfRange *iface, TfEditCookie ec,
DWORD dwFlags, const WCHAR *pchText, LONG cch)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_GetFormattedText(ITfRange *iface, TfEditCookie ec,
IDataObject **ppDataObject)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_GetEmbedded(ITfRange *iface, TfEditCookie ec,
REFGUID rguidService, REFIID riid, IUnknown **ppunk)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_InsertEmbedded(ITfRange *iface, TfEditCookie ec,
DWORD dwFlags, IDataObject *pDataObject)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_ShiftStart(ITfRange *iface, TfEditCookie ec,
LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_ShiftEnd(ITfRange *iface, TfEditCookie ec,
LONG cchReq, LONG *pcch, const TF_HALTCOND *pHalt)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_ShiftStartToRange(ITfRange *iface, TfEditCookie ec,
ITfRange *pRange, TfAnchor aPos)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_ShiftEndToRange(ITfRange *iface, TfEditCookie ec,
ITfRange *pRange, TfAnchor aPos)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_ShiftStartRegion(ITfRange *iface, TfEditCookie ec,
TfShiftDir dir, BOOL *pfNoRegion)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_ShiftEndRegion(ITfRange *iface, TfEditCookie ec,
TfShiftDir dir, BOOL *pfNoRegion)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_IsEmpty(ITfRange *iface, TfEditCookie ec,
BOOL *pfEmpty)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_Collapse(ITfRange *iface, TfEditCookie ec,
TfAnchor aPos)
{
Range *This = impl_from_ITfRange(iface);
TRACE("(%p) %i %i\n",This,ec,aPos);
switch (aPos)
{
case TF_ANCHOR_START:
This->anchorEnd = This->anchorStart;
break;
case TF_ANCHOR_END:
This->anchorStart = This->anchorEnd;
break;
default:
return E_INVALIDARG;
}
return S_OK;
}
static HRESULT WINAPI Range_IsEqualStart(ITfRange *iface, TfEditCookie ec,
ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_IsEqualEnd(ITfRange *iface, TfEditCookie ec,
ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_CompareStart(ITfRange *iface, TfEditCookie ec,
ITfRange *pWith, TfAnchor aPos, LONG *plResult)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_CompareEnd(ITfRange *iface, TfEditCookie ec,
ITfRange *pWith, TfAnchor aPos, LONG *plResult)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_AdjustForInsert(ITfRange *iface, TfEditCookie ec,
ULONG cchInsert, BOOL *pfInsertOk)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_GetGravity(ITfRange *iface,
TfGravity *pgStart, TfGravity *pgEnd)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_SetGravity(ITfRange *iface, TfEditCookie ec,
TfGravity gStart, TfGravity gEnd)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_Clone(ITfRange *iface, ITfRange **ppClone)
{
Range *This = impl_from_ITfRange(iface);
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
}
static HRESULT WINAPI Range_GetContext(ITfRange *iface, ITfContext **ppContext)
{
Range *This = impl_from_ITfRange(iface);
TRACE("(%p)\n",This);
if (!ppContext)
return E_INVALIDARG;
*ppContext = This->pITfContext;
return S_OK;
}
static const ITfRangeVtbl Range_RangeVtbl =
{
Range_QueryInterface,
Range_AddRef,
Range_Release,
Range_GetText,
Range_SetText,
Range_GetFormattedText,
Range_GetEmbedded,
Range_InsertEmbedded,
Range_ShiftStart,
Range_ShiftEnd,
Range_ShiftStartToRange,
Range_ShiftEndToRange,
Range_ShiftStartRegion,
Range_ShiftEndRegion,
Range_IsEmpty,
Range_Collapse,
Range_IsEqualStart,
Range_IsEqualEnd,
Range_CompareStart,
Range_CompareEnd,
Range_AdjustForInsert,
Range_GetGravity,
Range_SetGravity,
Range_Clone,
Range_GetContext
};
HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut)
{
Range *This;
This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Range));
if (This == NULL)
return E_OUTOFMEMORY;
TRACE("(%p) %p %p\n",This, context, textstore);
This->ITfRange_iface.lpVtbl = &Range_RangeVtbl;
This->refCount = 1;
This->pITfContext = context;
This->pITextStoreACP = textstore;
This->lockType = lockType;
This->anchorStart = anchorStart;
This->anchorEnd = anchorEnd;
*ppOut = &This->ITfRange_iface;
TRACE("returning %p\n", *ppOut);
return S_OK;
}
/* Internal conversion functions */
HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
{
Range *This;
if (!tf || !tsAcp || !tf->range)
return E_INVALIDARG;
This = impl_from_ITfRange(tf->range);
tsAcp->acpStart = This->anchorStart;
tsAcp->acpEnd = This->anchorEnd;
tsAcp->style.ase = tf->style.ase;
tsAcp->style.fInterimChar = tf->style.fInterimChar;
return S_OK;
}

425
base/ctf/msctf/range.cpp Normal file
View File

@@ -0,0 +1,425 @@
/*
* PROJECT: ReactOS CTF
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: ITfRangeACP implementation
* COPYRIGHT: Copyright 2009 Aric Stewart, CodeWeavers
* Copyright 2025 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#include <initguid.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <msctf.h>
#include <msctf_undoc.h>
// Cicero
#include <cicbase.h>
#include <cicreg.h>
#include <cicutb.h>
class CInputContext;
#include "range.h"
#include "msctf_internal.h"
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
////////////////////////////////////////////////////////////////////////////
// CRange
CRange::CRange(
_In_ ITfContext *context,
_In_ ITextStoreACP *textstore,
_In_ DWORD lockType,
_In_ TfAnchor anchorStart,
_In_ TfAnchor anchorEnd
)
: m_pContext(context)
, m_pTextStore(textstore)
, m_dwLockType(lockType)
, m_anchorStart(anchorStart)
, m_anchorEnd(anchorEnd)
, m_dwCookie(MAXDWORD)
, m_cRefs(1)
{
}
CRange::~CRange()
{
}
CRange *CRange::_Clone()
{
CRange *pRange = new(cicNoThrow) CRange(m_pContext, m_pTextStore, m_dwLockType,
m_anchorStart, m_anchorEnd);
if (!pRange)
return NULL;
pRange->m_dwCookie = m_dwCookie;
return pRange;
}
HRESULT CRange::_IsEqualX(TfEditCookie ec, BOOL bEnd, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual)
{
return E_NOTIMPL;
}
HRESULT CRange::_CompareX(
TfEditCookie ec,
BOOL bEnd,
ITfRange *pWidth,
TfAnchor aPos,
LONG *plResult)
{
return E_NOTIMPL;
}
HRESULT CRange::TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
{
if (!tf || !tsAcp || !tf->range)
{
ERR("E_INVALIDARG: %p, %p, %p\n", tf, tsAcp, tf->range);
return E_INVALIDARG;
}
CRange *This = static_cast<CRange *>(static_cast<ITfRangeACP *>(tf->range));
tsAcp->acpStart = This->m_anchorStart;
tsAcp->acpEnd = This->m_anchorEnd;
tsAcp->style.ase = static_cast<TsActiveSelEnd>(tf->style.ase);
tsAcp->style.fInterimChar = tf->style.fInterimChar;
return S_OK;
}
////////////////////////////////////////////////////////////////////////////
// ** IUnknown methods **
STDMETHODIMP CRange::QueryInterface(REFIID riid, void **ppvObj)
{
if (IsEqualGUID(riid, IID_PRIV_CRANGE))
{
*ppvObj = this;
return S_OK; // No AddRef
}
if (IsEqualGUID(riid, IID_ITfRange) || IsEqualGUID(riid, IID_IUnknown))
*ppvObj = this;
else if (IsEqualGUID(riid, IID_ITfRangeACP))
*ppvObj = static_cast<ITfRangeACP *>(this);
else if (IsEqualGUID(riid, IID_ITfRangeAnchor))
*ppvObj = static_cast<ITfRangeAnchor *>(this);
else if (IsEqualGUID(riid, IID_ITfSource))
*ppvObj = static_cast<ITfSource *>(this);
else
*ppvObj = NULL;
if (*ppvObj)
{
AddRef();
return S_OK;
}
ERR("E_NOINTERFACE: %s\n", wine_dbgstr_guid(&riid));
return E_NOINTERFACE;
}
STDMETHODIMP_(ULONG) CRange::AddRef()
{
TRACE("%p -> ()\n", this);
return InterlockedIncrement(&m_cRefs);
}
STDMETHODIMP_(ULONG) CRange::Release()
{
TRACE("%p -> ()\n", this);
if (InterlockedDecrement(&m_cRefs) == 0)
{
delete this;
return 0;
}
return m_cRefs;
}
////////////////////////////////////////////////////////////////////////////
// ** ITfRange methods **
STDMETHODIMP CRange::GetText(
_In_ TfEditCookie ec,
_In_ DWORD dwFlags,
_Out_ WCHAR *pchText,
_In_ ULONG cchMax,
_Out_ ULONG *pcch)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::SetText(
_In_ TfEditCookie ec,
_In_ DWORD dwFlags,
_In_ const WCHAR *pchText,
_In_ LONG cch)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::GetFormattedText(
_In_ TfEditCookie ec,
_Out_ IDataObject **ppDataObject)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::GetEmbedded(
_In_ TfEditCookie ec,
_In_ REFGUID rguidService,
_In_ REFIID riid,
_Out_ IUnknown **ppunk)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::InsertEmbedded(
_In_ TfEditCookie ec,
_In_ DWORD dwFlags,
_In_ IDataObject *pDataObject)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::ShiftStart(
_In_ TfEditCookie ec,
_In_ LONG cchReq,
_Out_ LONG *pcch,
_In_ const TF_HALTCOND *pHalt)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::ShiftEnd(
_In_ TfEditCookie ec,
_In_ LONG cchReq,
_Out_ LONG *pcch,
_In_ const TF_HALTCOND *pHalt)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::ShiftStartToRange(
_In_ TfEditCookie ec,
_In_ ITfRange *pRange,
_In_ TfAnchor aPos)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::ShiftEndToRange(
_In_ TfEditCookie ec,
_In_ ITfRange *pRange,
_In_ TfAnchor aPos)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::ShiftStartRegion(
_In_ TfEditCookie ec,
_In_ TfShiftDir dir,
_Out_ BOOL *pfNoRegion)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::ShiftEndRegion(
_In_ TfEditCookie ec,
_In_ TfShiftDir dir,
_Out_ BOOL *pfNoRegion)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::IsEmpty(
_In_ TfEditCookie ec,
_Out_ BOOL *pfEmpty)
{
TRACE("(%d, %p)\n", ec, pfEmpty);
return IsEqualStart(ec, static_cast<ITfRangeACP *>(this), TF_ANCHOR_END, pfEmpty);
}
STDMETHODIMP CRange::Collapse(
_In_ TfEditCookie ec,
_In_ TfAnchor aPos)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::IsEqualStart(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ BOOL *pfEqual)
{
FIXME("\n");
return _IsEqualX(ec, FALSE, pWith, aPos, pfEqual);
}
STDMETHODIMP CRange::IsEqualEnd(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ BOOL *pfEqual)
{
FIXME("\n");
return _IsEqualX(ec, TRUE, pWith, aPos, pfEqual);
}
STDMETHODIMP CRange::CompareStart(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ LONG *plResult)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::CompareEnd(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ LONG *plResult)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::AdjustForInsert(
_In_ TfEditCookie ec,
_In_ ULONG cchInsert,
_Out_ BOOL *pfInsertOk)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::GetGravity(
_Out_ TfGravity *pgStart,
_Out_ TfGravity *pgEnd)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::SetGravity(
_In_ TfEditCookie ec,
_In_ TfGravity gStart,
_In_ TfGravity gEnd)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::Clone(
_Out_ ITfRange **ppClone)
{
TRACE("%p\n", ppClone);
if (!ppClone)
return E_INVALIDARG;
CRange *pCloned = _Clone();
if (!pCloned)
return E_OUTOFMEMORY;
*ppClone = static_cast<ITfRangeACP *>(pCloned);
return S_OK;
}
STDMETHODIMP CRange::GetContext(
_Out_ ITfContext **ppContext)
{
FIXME("%p\n", ppContext);
return E_NOTIMPL;
}
////////////////////////////////////////////////////////////////////////////
// ** ITfRangeACP methods **
STDMETHODIMP CRange::GetExtent(_Out_ LONG *pacpAnchor, _Out_ LONG *pcch)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::SetExtent(_In_ LONG acpAnchor, _In_ LONG cch)
{
FIXME("\n");
return E_NOTIMPL;
}
////////////////////////////////////////////////////////////////////////////
// ** ITfRangeAnchor methods **
STDMETHODIMP CRange::GetExtent(_Out_ IAnchor **ppStart, _Out_ IAnchor **ppEnd)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::SetExtent(_In_ IAnchor *pAnchorStart, _In_ IAnchor *pAnchorEnd)
{
FIXME("\n");
return E_NOTIMPL;
}
////////////////////////////////////////////////////////////////////////////
// ** ITfSource methods **
STDMETHODIMP CRange::AdviseSink(
_In_ REFIID riid,
_In_ IUnknown *punk,
_Out_ DWORD *pdwCookie)
{
FIXME("\n");
return E_NOTIMPL;
}
STDMETHODIMP CRange::UnadviseSink(
_In_ DWORD dwCookie)
{
FIXME("\n");
return E_NOTIMPL;
}
////////////////////////////////////////////////////////////////////////////
EXTERN_C
HRESULT
Range_Constructor(ITfContext *context, ITextStoreACP *textstore,
DWORD lockType, DWORD anchorStart, DWORD anchorEnd, ITfRange **ppOut)
{
CRange *This = new(cicNoThrow) CRange(context, textstore, lockType,
(TfAnchor)anchorStart, (TfAnchor)anchorEnd);
if (!This)
return E_OUTOFMEMORY;
*ppOut = static_cast<ITfRangeACP *>(This);
return S_OK;
}
/* Internal conversion functions */
EXTERN_C
HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp)
{
return CRange::TF_SELECTION_to_TS_SELECTION_ACP(tf, tsAcp);
}

142
base/ctf/msctf/range.h Normal file
View File

@@ -0,0 +1,142 @@
#pragma once
DEFINE_GUID(IID_PRIV_CRANGE, 0xB68832F0, 0x34B9, 0x11D3, 0xA7, 0x45, 0x00, 0x50, 0x04, 0x0A, 0xB4, 0x07);
class CRange
: public ITfRangeACP
, public ITfRangeAnchor
, public ITfSource
{
protected:
ITfContext *m_pContext;
ITextStoreACP *m_pTextStore;
DWORD m_dwLockType;
TfAnchor m_anchorStart;
TfAnchor m_anchorEnd;
DWORD m_dwCookie;
LONG m_cRefs;
public:
CRange(
_In_ ITfContext *context,
_In_ ITextStoreACP *textstore,
_In_ DWORD lockType,
_In_ TfAnchor anchorStart,
_In_ TfAnchor anchorEnd);
virtual ~CRange();
static HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp);
// ** IUnknown methods **
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj) override;
STDMETHODIMP_(ULONG) AddRef() override;
STDMETHODIMP_(ULONG) Release() override;
// ** ITfRange methods **
STDMETHODIMP GetText(
_In_ TfEditCookie ec,
_In_ DWORD dwFlags,
_Out_ WCHAR *pchText,
_In_ ULONG cchMax,
_Out_ ULONG *pcch) override;
STDMETHODIMP SetText(
_In_ TfEditCookie ec,
_In_ DWORD dwFlags,
_In_ const WCHAR *pchText,
_In_ LONG cch) override;
STDMETHODIMP GetFormattedText(
_In_ TfEditCookie ec,
_Out_ IDataObject **ppDataObject) override;
STDMETHODIMP GetEmbedded(
_In_ TfEditCookie ec,
_In_ REFGUID rguidService,
_In_ REFIID riid,
_Out_ IUnknown **ppunk) override;
STDMETHODIMP InsertEmbedded(
_In_ TfEditCookie ec,
_In_ DWORD dwFlags,
_In_ IDataObject *pDataObject) override;
STDMETHODIMP ShiftStart(
_In_ TfEditCookie ec,
_In_ LONG cchReq,
_Out_ LONG *pcch,
_In_ const TF_HALTCOND *pHalt) override;
STDMETHODIMP ShiftEnd(
_In_ TfEditCookie ec,
_In_ LONG cchReq,
_Out_ LONG *pcch,
_In_ const TF_HALTCOND *pHalt) override;
STDMETHODIMP ShiftStartToRange(
_In_ TfEditCookie ec,
_In_ ITfRange *pRange,
_In_ TfAnchor aPos) override;
STDMETHODIMP ShiftEndToRange(
_In_ TfEditCookie ec,
_In_ ITfRange *pRange,
_In_ TfAnchor aPos) override;
STDMETHODIMP ShiftStartRegion(
_In_ TfEditCookie ec,
_In_ TfShiftDir dir,
_Out_ BOOL *pfNoRegion) override;
STDMETHODIMP ShiftEndRegion(
_In_ TfEditCookie ec,
_In_ TfShiftDir dir,
_Out_ BOOL *pfNoRegion) override;
STDMETHODIMP IsEmpty(_In_ TfEditCookie ec, _Out_ BOOL *pfEmpty) override;
STDMETHODIMP Collapse(_In_ TfEditCookie ec, _In_ TfAnchor aPos) override;
STDMETHODIMP IsEqualStart(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ BOOL *pfEqual) override;
STDMETHODIMP IsEqualEnd(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ BOOL *pfEqual) override;
STDMETHODIMP CompareStart(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ LONG *plResult) override;
STDMETHODIMP CompareEnd(
_In_ TfEditCookie ec,
_In_ ITfRange *pWith,
_In_ TfAnchor aPos,
_Out_ LONG *plResult) override;
STDMETHODIMP AdjustForInsert(
_In_ TfEditCookie ec,
_In_ ULONG cchInsert,
_Out_ BOOL *pfInsertOk) override;
STDMETHODIMP GetGravity(_Out_ TfGravity *pgStart, _Out_ TfGravity *pgEnd) override;
STDMETHODIMP SetGravity(
_In_ TfEditCookie ec,
_In_ TfGravity gStart,
_In_ TfGravity gEnd) override;
STDMETHODIMP Clone(_Out_ ITfRange **ppClone) override;
STDMETHODIMP GetContext(_Out_ ITfContext **ppContext) override;
// ** ITfRangeACP methods **
STDMETHODIMP GetExtent(_Out_ LONG *pacpAnchor, _Out_ LONG *pcch) override;
STDMETHODIMP SetExtent(_In_ LONG acpAnchor, _In_ LONG cch) override;
// ** ITfRangeAnchor methods **
STDMETHODIMP GetExtent(_Out_ IAnchor **ppStart, _Out_ IAnchor **ppEnd) override;
STDMETHODIMP SetExtent(_In_ IAnchor *pAnchorStart, _In_ IAnchor *pAnchorEnd) override;
// ** ITfSource methods **
STDMETHODIMP AdviseSink(_In_ REFIID riid, _In_ IUnknown *punk, _Out_ DWORD *pdwCookie) override;
STDMETHODIMP UnadviseSink(_In_ DWORD dwCookie) override;
protected:
CRange *_Clone();
HRESULT _IsEqualX(TfEditCookie ec, BOOL bEnd, ITfRange *pWith, TfAnchor aPos, BOOL *pfEqual);
HRESULT _CompareX(
TfEditCookie ec,
BOOL bEnd,
ITfRange *pWidth,
TfAnchor aPos,
LONG *plResult);
};

View File

@@ -32,7 +32,6 @@
#include "mlng.h"
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(msctf);
BOOL gf_CRT_INIT = FALSE;
@@ -93,6 +92,13 @@ UINT g_uKeyTipHotKeyModifiers = 0;
UINT g_uKeyTipHotKeyVKey = 0;
UINT g_uKeyTipHotKeyVKey2 = 0;
// Handle pure virtual function call errors
extern "C" void __cxa_pure_virtual(void)
{
ERR("__cxa_pure_virtual\n");
DebugBreak();
}
/**
* @implemented
*/

View File

@@ -2638,8 +2638,45 @@ PNP_GetInterfaceDeviceAlias(
PNP_RPC_STRING_LEN *pulTransferLen,
DWORD ulFlags)
{
UNIMPLEMENTED;
return CR_CALL_NOT_IMPLEMENTED;
NTSTATUS Status;
PLUGPLAY_CONTROL_INTERFACE_ALIAS_DATA PlugPlayData;
DWORD ret = CR_SUCCESS;
UNREFERENCED_PARAMETER(hBinding);
DPRINT("PNP_GetInterfaceDeviceAlias(%p %S %p %p %p %p 0x%08lx)\n",
hBinding, pszInterfaceDevice, AliasInterfaceGuid, pszAliasInterfaceDevice, pulLength,
pulTransferLen, ulFlags);
if ((AliasInterfaceGuid == NULL) ||
(pulLength == NULL))
return CR_INVALID_POINTER;
if (ulFlags != 0)
return CR_INVALID_FLAG;
RtlInitUnicodeString(&PlugPlayData.SymbolicLinkName, pszInterfaceDevice);
PlugPlayData.AliasInterfaceClassGuid = AliasInterfaceGuid;
PlugPlayData.AliasSymbolicLinkName = pszAliasInterfaceDevice;
PlugPlayData.AliasSymbolicLinkNameLength = *pulTransferLen;
Status = NtPlugPlayControl(PlugPlayControlGetInterfaceDeviceAlias,
&PlugPlayData,
sizeof(PLUGPLAY_CONTROL_INTERFACE_ALIAS_DATA));
if (NT_SUCCESS(Status))
{
*pulLength = PlugPlayData.AliasSymbolicLinkNameLength;
*pulTransferLen = *pulLength + 1;
}
else
{
*pulLength = 0;
*pulTransferLen = 0;
ret = NtStatusToCrError(Status);
}
DPRINT("PNP_GetInterfaceDeviceAlias() done (returns %lx)\n", ret);
return ret;
}

View File

@@ -133,7 +133,6 @@ HRESULT WINAPI _CBandSite_CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void
#define TWM_OPENSTARTMENU (WM_USER + 260)
#define TWM_SETTINGSCHANGED (WM_USER + 300)
#define TWM_SETZORDER (WM_USER + 338)
#define TWM_PULSE (WM_USER + 400)
extern const GUID IID_IShellDesktopTray;
@@ -154,6 +153,7 @@ DECLARE_INTERFACE_(ITrayWindow, IUnknown)
STDMETHOD_(BOOL, ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
STDMETHOD_(BOOL, Lock) (THIS_ BOOL bLock) PURE;
STDMETHOD_(BOOL, IsTaskWnd) (THIS_ HWND hWnd) PURE;
STDMETHOD_(HRESULT, NotifyFullScreenToAppBars)(THIS_ HMONITOR hMonitor, BOOL bFullOpening) PURE;
};
#undef INTERFACE
@@ -172,6 +172,7 @@ DECLARE_INTERFACE_(ITrayWindow, IUnknown)
#define ITrayWindow_ExecContextMenuCmd(p,a) (p)->lpVtbl->ExecContextMenuCmd(p,a)
#define ITrayWindow_Lock(p,a) (p)->lpVtbl->Lock(p,a)
#define ITrayWindow_IsTaskWnd(p,a) (p)->lpVtbl->IsTaskWnd(p,a)
#define ITrayWindow_NotifyFullScreenToAppBars(p,a,b) (p)->lpVtbl->NotifyFullScreenToAppBars(p,a,b)
#endif
HRESULT CreateTrayWindow(ITrayWindow ** ppTray);

View File

@@ -31,6 +31,89 @@
#define MAX_TASKS_COUNT (0x7FFF)
#define TASK_ITEM_ARRAY_ALLOC 64
//************************************************************************
// Fullscreen windows (a.k.a. rude apps) checker
#define TIMER_ID_VALIDATE_RUDE_APP 5
#define VALIDATE_RUDE_INTERVAL 1000
#define VALIDATE_RUDE_MAX_COUNT 5
static BOOL
SHELL_GetMonitorRect(
_In_opt_ HMONITOR hMonitor,
_Out_opt_ PRECT prcDest,
_In_ BOOL bWorkAreaOnly)
{
MONITORINFO mi = { sizeof(mi) };
if (!hMonitor || !::GetMonitorInfoW(hMonitor, &mi))
{
if (!prcDest)
return FALSE;
if (bWorkAreaOnly)
::SystemParametersInfoW(SPI_GETWORKAREA, 0, prcDest, 0);
else
::SetRect(prcDest, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
return FALSE;
}
if (prcDest)
*prcDest = (bWorkAreaOnly ? mi.rcWork : mi.rcMonitor);
return TRUE;
}
static BOOL
SHELL_IsParentOwnerOrSelf(_In_ HWND hwndTarget, _In_ HWND hWnd)
{
for (; hWnd; hWnd = ::GetParent(hWnd))
{
if (hWnd == hwndTarget)
return TRUE;
}
return FALSE;
}
static BOOL
SHELL_IsRudeWindowActive(_In_ HWND hWnd)
{
HWND hwndFore = ::GetForegroundWindow();
DWORD dwThreadId = ::GetWindowThreadProcessId(hWnd, NULL);
return dwThreadId == ::GetWindowThreadProcessId(hwndFore, NULL) ||
SHELL_IsParentOwnerOrSelf(hWnd, hwndFore);
}
static BOOL
SHELL_IsRudeWindow(_In_opt_ HMONITOR hMonitor, _In_ HWND hWnd, _In_ BOOL bDontCheckActive)
{
if (!::IsWindowVisible(hWnd) || hWnd == ::GetDesktopWindow())
return FALSE;
RECT rcMonitor;
SHELL_GetMonitorRect(hMonitor, &rcMonitor, FALSE);
DWORD style = ::GetWindowLongPtrW(hWnd, GWL_STYLE);
RECT rcWnd;
enum { CHECK_STYLE = WS_THICKFRAME | WS_DLGFRAME | WS_BORDER };
if ((style & CHECK_STYLE) == CHECK_STYLE)
{
::GetClientRect(hWnd, &rcWnd); // Ignore frame
::MapWindowPoints(hWnd, NULL, (PPOINT)&rcWnd, sizeof(RECT) / sizeof(POINT));
}
else
{
::GetWindowRect(hWnd, &rcWnd);
}
RECT rcUnion;
::UnionRect(&rcUnion, &rcWnd, &rcMonitor);
return ::EqualRect(&rcUnion, &rcWnd) && (bDontCheckActive || SHELL_IsRudeWindowActive(hWnd));
}
////////////////////////////////////////////////////////////////
const WCHAR szTaskSwitchWndClass[] = L"MSTaskSwWClass";
const WCHAR szRunningApps[] = L"Running Applications";
@@ -322,6 +405,8 @@ class CTaskSwitchWnd :
BOOL m_IsGroupingEnabled;
BOOL m_IsDestroying;
INT m_nRudeAppValidationCounter;
SIZE m_ButtonSize;
UINT m_uHardErrorMsg;
@@ -340,7 +425,8 @@ public:
m_ButtonCount(0),
m_ImageList(NULL),
m_IsGroupingEnabled(FALSE),
m_IsDestroying(FALSE)
m_IsDestroying(FALSE),
m_nRudeAppValidationCounter(0)
{
ZeroMemory(&m_ButtonSize, sizeof(m_ButtonSize));
m_uHardErrorMsg = RegisterWindowMessageW(L"HardError");
@@ -1464,6 +1550,8 @@ public:
{
m_IsDestroying = TRUE;
KillTimer(TIMER_ID_VALIDATE_RUDE_APP);
/* Unregister the shell hook */
RegisterShellHook(m_hWnd, FALSE);
@@ -1472,12 +1560,6 @@ public:
return TRUE;
}
VOID SendPulseToTray(BOOL bDelete, HWND hwndActive)
{
HWND hwndTray = m_Tray->GetHWND();
::SendMessage(hwndTray, TWM_PULSE, bDelete, (LPARAM)hwndActive);
}
static BOOL InvokeRegistryAppKeyCommand(UINT uAppCmd)
{
BOOL bResult = FALSE;
@@ -1554,19 +1636,18 @@ public:
break;
case HSHELL_WINDOWCREATED:
SendPulseToTray(FALSE, (HWND)lParam);
AddTask((HWND) lParam);
break;
case HSHELL_WINDOWDESTROYED:
/* The window still exists! Delay destroying it a bit */
SendPulseToTray(TRUE, (HWND)lParam);
OnWindowDestroyed((HWND)lParam);
DeleteTask((HWND)lParam);
break;
case HSHELL_RUDEAPPACTIVATED:
case HSHELL_WINDOWACTIVATED:
SendPulseToTray(FALSE, (HWND)lParam);
OnWindowActivated((HWND)lParam);
ActivateTask((HWND)lParam);
break;
@@ -1674,7 +1755,6 @@ public:
TaskItem = FindTaskItemByIndex((INT) wIndex);
if (TaskItem != NULL)
{
SendPulseToTray(FALSE, TaskItem->hWnd);
HandleTaskItemClick(TaskItem);
return TRUE;
}
@@ -1810,6 +1890,130 @@ public:
return Ret;
}
// Internal structure for IsRudeEnumProc
typedef struct tagRUDEAPPDATA
{
HMONITOR hTargetMonitor;
HWND hwndFound;
HWND hwndFirstCheck;
} RUDEAPPDATA, *PRUDEAPPDATA;
// Find any rude app
static BOOL CALLBACK
IsRudeEnumProc(_In_ HWND hwnd, _In_ LPARAM lParam)
{
PRUDEAPPDATA pData = (PRUDEAPPDATA)lParam;
HMONITOR hMon = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
if (!hMon ||
(pData->hTargetMonitor && pData->hTargetMonitor != hMon) ||
!SHELL_IsRudeWindow(hMon, hwnd, (hwnd == pData->hwndFirstCheck)))
{
return TRUE; // Continue
}
pData->hwndFound = hwnd;
return FALSE; // Finish
}
// Internal structure for FullScreenEnumProc
typedef struct tagFULLSCREENDATA
{
const RECT *pRect;
HMONITOR hTargetMonitor;
ITrayWindow *pTray;
} FULLSCREENDATA, *PFULLSCREENDATA;
// Notify ABN_FULLSCREENAPP for each monitor
static BOOL CALLBACK
FullScreenEnumProc(_In_ HMONITOR hMonitor, _In_opt_ HDC hDC, _In_ LPRECT prc, _In_ LPARAM lParam)
{
PFULLSCREENDATA pData = (PFULLSCREENDATA)lParam;
BOOL bFullOpening = (pData->hTargetMonitor == hMonitor);
if (!bFullOpening && pData->pRect)
{
RECT rc, rcMon;
SHELL_GetMonitorRect(hMonitor, &rcMon, FALSE);
::IntersectRect(&rc, &rcMon, pData->pRect);
bFullOpening = ::EqualRect(&rc, &rcMon);
}
// Notify ABN_FULLSCREENAPP to appbars
pData->pTray->NotifyFullScreenToAppBars(hMonitor, bFullOpening);
return TRUE;
}
void HandleFullScreenApp(_In_opt_ HWND hwndRude)
{
// Notify ABN_FULLSCREENAPP for every monitor
RECT rc;
FULLSCREENDATA Data = { NULL, NULL, NULL };
if (hwndRude && ::GetWindowRect(hwndRude, &rc))
{
Data.pRect = &rc;
Data.hTargetMonitor = ::MonitorFromWindow(hwndRude, MONITOR_DEFAULTTONULL);
}
Data.pTray = m_Tray;
::EnumDisplayMonitors(NULL, NULL, FullScreenEnumProc, (LPARAM)&Data);
// Make the taskbar bottom or top
UINT uFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOOWNERZORDER;
HWND hwndTray = m_Tray->GetHWND();
::SetWindowPos(hwndTray, (hwndRude ? HWND_BOTTOM : HWND_TOP), 0, 0, 0, 0, uFlags);
if (hwndRude)
{
DWORD exstyle = (DWORD)::GetWindowLongPtrW(hwndRude, GWL_EXSTYLE);
if (!(exstyle & WS_EX_TOPMOST) && !SHELL_IsRudeWindowActive(hwndRude))
::SwitchToThisWindow(hwndRude, TRUE);
}
// FIXME: NIN_BALLOONHIDE
// FIXME: NIN_POPUPCLOSE
}
HWND FindRudeApp(_In_opt_ HWND hwndFirstCheck)
{
// Quick check
HMONITOR hMon = MonitorFromWindow(hwndFirstCheck, MONITOR_DEFAULTTONEAREST);
RUDEAPPDATA data = { hMon, NULL, hwndFirstCheck };
if (::IsWindow(hwndFirstCheck) && !IsRudeEnumProc(hwndFirstCheck, (LPARAM)&data))
return hwndFirstCheck;
// Slow check
::EnumWindows(IsRudeEnumProc, (LPARAM)&data);
return data.hwndFound;
}
// WM_WINDOWPOSCHANGED
LRESULT OnWindowPosChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// Re-start rude app validation
KillTimer(TIMER_ID_VALIDATE_RUDE_APP);
SetTimer(TIMER_ID_VALIDATE_RUDE_APP, VALIDATE_RUDE_INTERVAL, NULL);
m_nRudeAppValidationCounter = 0;
bHandled = FALSE;
return 0;
}
// HSHELL_WINDOWACTIVATED, HSHELL_RUDEAPPACTIVATED
void OnWindowActivated(_In_ HWND hwndTarget)
{
// Re-start rude app validation
KillTimer(TIMER_ID_VALIDATE_RUDE_APP);
SetTimer(TIMER_ID_VALIDATE_RUDE_APP, VALIDATE_RUDE_INTERVAL, NULL);
m_nRudeAppValidationCounter = 0;
}
// HSHELL_WINDOWDESTROYED
void OnWindowDestroyed(_In_ HWND hwndTarget)
{
HWND hwndRude = FindRudeApp(hwndTarget);
HandleFullScreenApp(hwndRude);
}
LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
HDC hdc = (HDC) wParam;
@@ -1963,14 +2167,32 @@ public:
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
#if DUMP_TASKS != 0
switch (wParam)
{
case 1:
DumpTasks();
break;
}
#if DUMP_TASKS != 0
case 1:
DumpTasks();
break;
#endif
case TIMER_ID_VALIDATE_RUDE_APP:
{
// Real activation of rude app might take some time after HSHELL_...ACTIVATED.
// Wait up to 5 seconds with validating the rude app at each second.
HWND hwndRude = FindRudeApp(NULL);
HandleFullScreenApp(hwndRude);
KillTimer(wParam);
++m_nRudeAppValidationCounter;
if (m_nRudeAppValidationCounter < VALIDATE_RUDE_MAX_COUNT && !hwndRude)
SetTimer(wParam, VALIDATE_RUDE_INTERVAL, NULL);
break;
}
default:
{
WARN("Unknown timer ID: %p\n", wParam);
break;
}
}
return TRUE;
}
@@ -2054,6 +2276,7 @@ public:
MESSAGE_HANDLER(WM_MOUSEACTIVATE, OnMouseActivate)
MESSAGE_HANDLER(WM_KLUDGEMINRECT, OnKludgeItemRect)
MESSAGE_HANDLER(WM_COPYDATA, OnCopyData)
MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)
END_MSG_MAP()
DECLARE_NOT_AGGREGATABLE(CTaskSwitchWnd)

View File

@@ -300,7 +300,6 @@ public:
BEGIN_MSG_MAP(CStartButton)
MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
END_MSG_MAP()
};
class CTrayWindow :
@@ -362,7 +361,6 @@ public:
DWORD InSizeMove : 1;
DWORD IsDragging : 1;
DWORD NewPosSize : 1;
DWORD IgnorePulse : 1;
};
};
@@ -391,7 +389,6 @@ public:
ZeroMemory(&m_TraySize, sizeof(m_TraySize));
ZeroMemory(&m_AutoHideOffset, sizeof(m_AutoHideOffset));
ZeroMemory(&m_MouseTrackingInfo, sizeof(m_MouseTrackingInfo));
IgnorePulse = TRUE;
}
virtual ~CTrayWindow()
@@ -2392,12 +2389,8 @@ ChangePos:
return TRUE;
}
#define TIMER_ID_IGNOREPULSERESET 888
#define TIMER_IGNOREPULSERESET_TIMEOUT 200
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
KillTimer(TIMER_ID_IGNOREPULSERESET);
return 0;
}
@@ -3035,39 +3028,6 @@ HandleTrayContextMenu:
return (LRESULT)m_TaskSwitch;
}
void RestoreMinimizedNonTaskWnds(BOOL bDestroyed, HWND hwndActive)
{
for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
{
HWND hwnd = g_MinimizedAll[i].hwnd;
if (!hwnd || hwndActive == hwnd)
continue;
if (::IsWindowVisible(hwnd) && ::IsIconic(hwnd) &&
(!IsTaskWnd(hwnd) || !::IsWindowEnabled(hwnd)))
{
::SetWindowPlacement(hwnd, &g_MinimizedAll[i].wndpl); // Restore
}
}
if (bDestroyed)
g_MinimizedAll.RemoveAll();
else
::SetForegroundWindow(hwndActive);
}
LRESULT OnPulse(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if (IgnorePulse)
return 0;
KillTimer(TIMER_ID_IGNOREPULSERESET);
IgnorePulse = TRUE;
RestoreMinimizedNonTaskWnds((BOOL)wParam, (HWND)lParam);
SetTimer(TIMER_ID_IGNOREPULSERESET, TIMER_IGNOREPULSERESET_TIMEOUT, NULL);
return 0;
}
// TWM_SETZORDER
LRESULT OnSetZOrder(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
@@ -3075,6 +3035,12 @@ HandleTrayContextMenu:
SWP_NOOWNERZORDER | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
STDMETHODIMP NotifyFullScreenToAppBars(HMONITOR hMonitor, BOOL bFullOpening) override
{
OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
return S_OK;
}
LRESULT OnHotkey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return HandleHotKey(wParam);
@@ -3126,9 +3092,6 @@ HandleTrayContextMenu:
VOID MinimizeAll(BOOL bShowDesktop = FALSE)
{
IgnorePulse = TRUE;
KillTimer(TIMER_ID_IGNOREPULSERESET);
MINIMIZE_INFO info;
info.hwndDesktop = GetDesktopWindow();;
info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
@@ -3139,7 +3102,6 @@ HandleTrayContextMenu:
::SetForegroundWindow(m_DesktopWnd);
::SetFocus(m_DesktopWnd);
SetTimer(TIMER_ID_IGNOREPULSERESET, TIMER_IGNOREPULSERESET_TIMEOUT, NULL);
}
VOID ShowDesktop()
@@ -3149,9 +3111,6 @@ HandleTrayContextMenu:
VOID RestoreAll()
{
IgnorePulse = TRUE;
KillTimer(TIMER_ID_IGNOREPULSERESET);
for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
{
HWND hwnd = g_MinimizedAll[i].hwnd;
@@ -3160,7 +3119,6 @@ HandleTrayContextMenu:
}
g_MinimizedAll.RemoveAll();
SetTimer(TIMER_ID_IGNOREPULSERESET, TIMER_IGNOREPULSERESET_TIMEOUT, NULL);
}
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
@@ -3193,18 +3151,18 @@ HandleTrayContextMenu:
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
if (wParam == TIMER_ID_MOUSETRACK)
switch (wParam)
{
ProcessMouseTracking();
}
else if (wParam == TIMER_ID_AUTOHIDE)
{
ProcessAutoHide();
}
else if (wParam == TIMER_ID_IGNOREPULSERESET)
{
KillTimer(TIMER_ID_IGNOREPULSERESET);
IgnorePulse = FALSE;
case TIMER_ID_MOUSETRACK:
ProcessMouseTracking();
break;
case TIMER_ID_AUTOHIDE:
ProcessAutoHide();
break;
default:
WARN("Invalid timer ID: %u\n", (UINT)wParam);
bHandled = FALSE;
break;
}
return 0;
}
@@ -3301,6 +3259,16 @@ HandleTrayContextMenu:
return 0;
}
// WM_GETMINMAXINFO
LRESULT OnGetMinMaxInfo(INT code, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
PMINMAXINFO pInfo = (PMINMAXINFO)lParam;
SIZE StartSize = m_StartButton.GetSize();
pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
return 0;
}
LRESULT OnRebarAutoSize(INT code, LPNMHDR nmhdr, BOOL& bHandled)
{
#if 0
@@ -3437,12 +3405,12 @@ HandleTrayContextMenu:
MESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo)
MESSAGE_HANDLER(TWM_SETTINGSCHANGED, OnTaskbarSettingsChanged)
MESSAGE_HANDLER(TWM_OPENSTARTMENU, OnOpenStartMenu)
MESSAGE_HANDLER(TWM_DOEXITWINDOWS, OnDoExitWindows)
MESSAGE_HANDLER(TWM_GETTASKSWITCH, OnGetTaskSwitch)
MESSAGE_HANDLER(TWM_SETZORDER, OnSetZOrder)
MESSAGE_HANDLER(TWM_PULSE, OnPulse)
ALT_MSG_MAP(1)
END_MSG_MAP()

View File

@@ -501,9 +501,14 @@ HandleLogon(
/* Loading personal settings */
DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_LOADINGYOURPERSONALSETTINGS);
ProfileInfo.hProfile = INVALID_HANDLE_VALUE;
if (0 == (Session->Options & WLX_LOGON_OPT_NO_PROFILE))
if (!(Session->Options & WLX_LOGON_OPT_NO_PROFILE))
{
HKEY hKey;
LONG lError;
BOOL bNoPopups = FALSE;
if (Session->Profile == NULL
|| (Session->Profile->dwType != WLX_PROFILE_TYPE_V1_0
&& Session->Profile->dwType != WLX_PROFILE_TYPE_V2_0))
@@ -512,10 +517,28 @@ HandleLogon(
goto cleanup;
}
/* Check whether error messages may be displayed when loading the user profile */
lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"System\\CurrentControlSet\\Control\\Windows",
0,
KEY_QUERY_VALUE,
&hKey);
if (lError == ERROR_SUCCESS)
{
DWORD dwValue, dwType, cbData = sizeof(dwValue);
lError = RegQueryValueExW(hKey, L"NoPopupsOnBoot", NULL,
&dwType, (PBYTE)&dwValue, &cbData);
if ((lError == ERROR_SUCCESS) && (dwType == REG_DWORD) && (cbData == sizeof(dwValue)))
bNoPopups = !!dwValue;
RegCloseKey(hKey);
}
/* Load the user profile */
ZeroMemory(&ProfileInfo, sizeof(PROFILEINFOW));
ProfileInfo.dwSize = sizeof(PROFILEINFOW);
ProfileInfo.dwFlags = 0;
ZeroMemory(&ProfileInfo, sizeof(ProfileInfo));
ProfileInfo.dwSize = sizeof(ProfileInfo);
if (bNoPopups)
ProfileInfo.dwFlags |= PI_NOUI;
ProfileInfo.lpUserName = Session->MprNotifyInfo.pszUserName;
ProfileInfo.lpProfilePath = Session->Profile->pszProfile;
if (Session->Profile->dwType >= WLX_PROFILE_TYPE_V2_0)
@@ -1049,7 +1072,10 @@ HandleShutdown(
DialogBox(hAppInstance, MAKEINTRESOURCE(IDD_SHUTDOWNCOMPUTER),
GetDesktopWindow(), ShutdownComputerWindowProc);
}
NtShutdownSystem(ShutdownNoReboot);
if (wlxAction == WLX_SAS_ACTION_SHUTDOWN_POWER_OFF)
NtShutdownSystem(ShutdownPowerOff);
else // if (wlxAction == WLX_SAS_ACTION_SHUTDOWN)
NtShutdownSystem(ShutdownNoReboot);
}
RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, Old, FALSE, &Old);
return STATUS_SUCCESS;
@@ -1068,6 +1094,7 @@ DoGenericAction(
{
if (!HandleLogon(Session))
{
Session->LogonState = STATE_LOGGED_OFF;
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
CallNotificationDlls(Session, LogonHandler);
}
@@ -1090,12 +1117,19 @@ DoGenericAction(
}
break;
case WLX_SAS_ACTION_LOCK_WKSTA: /* 0x03 */
if (Session->Gina.Functions.WlxIsLockOk(Session->Gina.Context))
if ((Session->LogonState == STATE_LOGGED_ON) ||
(Session->LogonState == STATE_LOGGED_ON_SAS))
{
SwitchDesktop(Session->WinlogonDesktop);
Session->LogonState = STATE_LOCKED;
Session->Gina.Functions.WlxDisplayLockedNotice(Session->Gina.Context);
CallNotificationDlls(Session, LockHandler);
if (Session->Gina.Functions.WlxIsLockOk(Session->Gina.Context))
{
Session->LogonState = STATE_LOCKED;
SwitchDesktop(Session->WinlogonDesktop);
/* We may be on the Logged-On SAS dialog, in which case
* we need to close it if the lock action came via Win-L */
CloseAllDialogWindows();
CallNotificationDlls(Session, LockHandler);
Session->Gina.Functions.WlxDisplayLockedNotice(Session->Gina.Context);
}
}
break;
case WLX_SAS_ACTION_LOGOFF: /* 0x04 */
@@ -1122,24 +1156,35 @@ DoGenericAction(
if (!NT_SUCCESS(HandleShutdown(Session, wlxAction)))
{
RemoveStatusMessage(Session);
Session->LogonState = STATE_LOGGED_OFF;
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
}
}
else
{
RemoveStatusMessage(Session);
Session->LogonState = STATE_LOGGED_OFF;
Session->Gina.Functions.WlxDisplaySASNotice(Session->Gina.Context);
}
break;
case WLX_SAS_ACTION_TASKLIST: /* 0x07 */
SwitchDesktop(Session->ApplicationDesktop);
Session->LogonState = STATE_LOGGED_ON;
StartTaskManager(Session);
if ((Session->LogonState == STATE_LOGGED_ON) ||
(Session->LogonState == STATE_LOGGED_ON_SAS))
{
/* Start a Task-Manager instance on the application desktop.
* If the user pressed Ctrl-Shift-Esc while being on the
* Logged-On SAS dialog (on the Winlogon desktop), stay there. */
StartTaskManager(Session);
}
break;
case WLX_SAS_ACTION_UNLOCK_WKSTA: /* 0x08 */
SwitchDesktop(Session->ApplicationDesktop);
Session->LogonState = STATE_LOGGED_ON;
CallNotificationDlls(Session, UnlockHandler);
if ((Session->LogonState == STATE_LOCKED) ||
(Session->LogonState == STATE_LOCKED_SAS))
{
CallNotificationDlls(Session, UnlockHandler);
SwitchDesktop(Session->ApplicationDesktop);
Session->LogonState = STATE_LOGGED_ON;
}
break;
default:
WARN("Unknown SAS action 0x%lx\n", wlxAction);
@@ -1190,7 +1235,26 @@ DispatchSAS(
case STATE_LOGGED_ON:
Session->LogonState = STATE_LOGGED_ON_SAS;
SwitchDesktop(Session->WinlogonDesktop);
wlxAction = (DWORD)Session->Gina.Functions.WlxLoggedOnSAS(Session->Gina.Context, dwSasType, NULL);
if ((wlxAction == WLX_SAS_ACTION_NONE) ||
(wlxAction == WLX_SAS_ACTION_TASKLIST))
{
/*
* If the user canceled (WLX_SAS_ACTION_NONE) the
* Logged-On SAS dialog, or clicked on the Task-Manager
* button (WLX_SAS_ACTION_TASKLIST), switch back to
* the application desktop and return to log-on state.
* In the latter case, the Task-Manager is launched
* by DoGenericAction(WLX_SAS_ACTION_TASKLIST), which
* doesn't automatically do the switch back, because
* the user may have also pressed on Ctrl-Shift-Esc
* to start it while being on the Logged-On SAS dialog
* and wanting to stay there.
*/
SwitchDesktop(Session->ApplicationDesktop);
Session->LogonState = STATE_LOGGED_ON;
}
break;
case STATE_LOGGED_ON_SAS:
@@ -1358,8 +1422,7 @@ SASWindowProc(
case IDHK_CTRL_SHIFT_ESC:
{
TRACE("SAS: CONTROL+SHIFT+ESCAPE\n");
if (Session->LogonState == STATE_LOGGED_ON)
DoGenericAction(Session, WLX_SAS_ACTION_TASKLIST);
DoGenericAction(Session, WLX_SAS_ACTION_TASKLIST);
return TRUE;
}
case IDHK_WIN_L:

View File

@@ -104,7 +104,7 @@ CloseAllDialogWindows(VOID)
DIALOG_LIST_ENTRY,
Entry);
PostMessage(Current->hWnd, WLX_WM_SAS, 0, 0);
PostMessage(Current->hWnd, WLX_WM_SAS, WLX_SAS_TYPE_TIMEOUT, 0);
ListEntry = ListEntry->Flink;
}
@@ -141,8 +141,25 @@ DefaultWlxWindowProc(
if (uMsg == WLX_WM_SAS)
{
EndDialog(hwndDlg, WLX_DLG_SAS);
return 0;
/* Determine which result to return */
switch (wParam)
{
case WLX_SAS_TYPE_CTRL_ALT_DEL:
default:
ret = WLX_DLG_SAS;
break;
case WLX_SAS_TYPE_TIMEOUT:
ret = WLX_DLG_INPUT_TIMEOUT;
break;
case WLX_SAS_TYPE_SCRNSVR_TIMEOUT:
ret = WLX_DLG_SCREEN_SAVER_TIMEOUT;
break;
case WLX_SAS_TYPE_USER_LOGOFF:
ret = WLX_DLG_USER_LOGOFF;
break;
}
EndDialog(hwndDlg, ret);
return TRUE;
}
ret = ListEntry->DlgProc(hwndDlg, uMsg, wParam, lParam);
@@ -394,10 +411,14 @@ WlxSwitchDesktopToUser(
HANDLE hWlx)
{
PWLSESSION Session = (PWLSESSION)hWlx;
BOOL bRet;
TRACE("WlxSwitchDesktopToUser()\n");
return (int)SwitchDesktop(Session->ApplicationDesktop);
bRet = SwitchDesktop(Session->ApplicationDesktop);
if (bRet)
SetThreadDesktop(Session->ApplicationDesktop);
return (int)bRet;
}
/*
@@ -409,10 +430,14 @@ WlxSwitchDesktopToWinlogon(
HANDLE hWlx)
{
PWLSESSION Session = (PWLSESSION)hWlx;
BOOL bRet;
TRACE("WlxSwitchDesktopToWinlogon()\n");
return (int)SwitchDesktop(Session->WinlogonDesktop);
bRet = SwitchDesktop(Session->WinlogonDesktop);
if (bRet)
SetThreadDesktop(Session->WinlogonDesktop);
return (int)bRet;
}
/*

View File

@@ -448,6 +448,29 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\WebView
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\WebViewBarricade","DefaultValue",0x00010001,0x00000000
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\WebViewBarricade",Grayed,0x10001,6
; Sysdm.cpl Visual Effects
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","ValueName",,"ListviewShadow"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","RegPath",,"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","Text",,"@shell32.dll,-30541"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","Type",,"checkbox"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","DefaultValue",0x00010001,1
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","CheckedValue",0x00010001,1
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow","UncheckedValue",0x00010001,0
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","SPIActionSet",0x00010001,37
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","SPIActionGet",0x00010001,38
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","Text",,"@shell32.dll,-30533"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","Type",,"checkbox"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","DefaultValue",0x00010001,1
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","CheckedValue",0x00010001,1
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows","UncheckedValue",0x00010001,0
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","SPIActionSet",0x00010001,75
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","SPIActionGet",0x00010001,74
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","Text",,"@shell32.dll,-30535"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","Type",,"checkbox"
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","DefaultValue",0x00010001,1
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","CheckedValue",0x00010001,1
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing","UncheckedValue",0x00010001,0
; Common shell folders
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012
@@ -525,7 +548,7 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IME Compatibility",,0x0000001
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","IME File",2,"msctfime.ime"
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","LoadIMM",0x00010003,0 ; "LoadIMM" means Cicero despite its name
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","LoadCTFIME",0x00010003,0
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","DontLoadCTFIME",0x00010003,1 ; Disable CTF IME
; DOS Device ports
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports","COM1:",2,"9600,n,8,1"

View File

@@ -762,6 +762,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000426","Layout Displa
; HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010426","Layout File",0x00000000,"kbdlv1.dll"
; HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010426","Layout Text",0x00000000,%LATVIAN_QWERTY%
; HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010426","Layout Id",0x00000000,"0015"
; HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010426","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5044"
HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010427","Layout File",0x00000000,"kbdlt1.dll"
@@ -779,6 +780,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042b","Layout Displa
HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout File",0x00000000,"kbdarmw.dll"
HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout Text",0x00000000,%ARMENIAN_WESTERN%
HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout Id",0x00000000,"0025"
HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0001042b","Layout Display Name",0x00000000,"@%SystemRoot%\system32\input.dll,-5121"
HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000042c","Layout File",0x00000000,"kbdazel.dll"
@@ -989,11 +991,16 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","1255",0x00000000,"c_1255.n
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","1256",0x00000000,"c_1256.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","1257",0x00000000,"c_1257.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","1258",0x00000000,"c_1258.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","1361",0x00000000,"c_1361.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10000",0x00000000,"c_10000.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10001",0x00000000,"c_10001.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10002",0x00000000,"c_10002.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10003",0x00000000,"c_10003.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10004",0x00000000,"c_10004.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10005",0x00000000,"c_10005.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10006",0x00000000,"c_10006.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10007",0x00000000,"c_10007.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10008",0x00000000,"c_10008.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10010",0x00000000,"c_10010.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10017",0x00000000,"c_10017.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10021",0x00000000,"c_10021.nls"
@@ -1001,11 +1008,18 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10029",0x00000000,"c_10029
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10079",0x00000000,"c_10079.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10081",0x00000000,"c_10081.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","10082",0x00000000,"c_10082.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20000",0x00000000,"c_20000.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20001",0x00000000,"c_20001.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20002",0x00000000,"c_20002.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20003",0x00000000,"c_20003.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20004",0x00000000,"c_20004.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20005",0x00000000,"c_20005.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20105",0x00000000,"c_20105.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20106",0x00000000,"c_20106.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20107",0x00000000,"c_20107.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20108",0x00000000,"c_20108.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20127",0x00000000,"c_20127.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20261",0x00000000,"c_20261.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20269",0x00000000,"c_20269.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20273",0x00000000,"c_20273.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","20277",0x00000000,"c_20277.nls"
@@ -1043,6 +1057,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","28603",0x00000000,"c_28603
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","28604",0x00000000,"c_28604.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","28605",0x00000000,"c_28605.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","28606",0x00000000,"c_28606.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","29001",0x00000000,"c_29001.nls"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","ACP",0x00000000,"1252"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","OEMCP",0x00000000,"437"
HKLM,"SYSTEM\CurrentControlSet\Control\Nls\CodePage","MACCP",0x00000000,"10000"

View File

@@ -204,7 +204,7 @@ LoadCurrentScheme(OUT COLOR_SCHEME *scheme)
0);
if (!ret) return FALSE;
/* Show shadows under menus */
/* Show shadows under windows */
ret = SystemParametersInfoW(SPI_GETDROPSHADOW,
0,
&scheme->Effects.bDropShadow,
@@ -402,7 +402,7 @@ ApplyScheme(IN COLOR_SCHEME *scheme, IN PTHEME_SELECTION pSelectedTheme)
/* Use large icons */
//SYS_CONFIG(SPI_GETDRAGFULLWINDOWS, (PVOID) g->SchemeAdv.Effects.bMenuFade);
/* Show shadows under menus */
/* Show shadows under windows */
SYS_CONFIG(SPI_SETDROPSHADOW, 0, IntToPtr(scheme->Effects.bDropShadow));
/* Show window contents while dragging */

View File

@@ -11,6 +11,7 @@ list(APPEND SOURCE
hardprof.c
hardware.c
licence.c
performance.c
smbios.c
startrec.c
sysdm.c
@@ -27,7 +28,7 @@ add_library(sysdm MODULE
${CMAKE_CURRENT_BINARY_DIR}/sysdm.def)
set_module_type(sysdm cpl UNICODE)
target_link_libraries(sysdm udmihelp)
target_link_libraries(sysdm udmihelp uuid)
add_importlibs(sysdm advapi32 setupapi user32 gdi32 comctl32 comdlg32 msimg32 shell32 shlwapi ole32 powrprof msvcrt kernel32 ntdll)
add_pch(sysdm precomp.h SOURCE)
add_cd_file(TARGET sysdm DESTINATION reactos/system32 FOR all)

View File

@@ -133,10 +133,7 @@ AdvancedPageProc(HWND hwndDlg,
switch (LOWORD(wParam))
{
case IDC_PERFOR:
DialogBox(hApplet,
MAKEINTRESOURCE(IDD_VIRTMEM),
hwndDlg,
VirtMemDlgProc);
ShowPerformanceOptions(hwndDlg);
break;
case IDC_USERPROFILE:

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "Добре", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Система"
IDS_CPLSYSTEMDESCRIPTION "Можете да видите сведения за компютъра ви и за различни настройки"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "МБ"
IDS_GIGABYTE "ГБ"
IDS_TERABYTE "ТБ"

View File

@@ -328,10 +328,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Systém"
IDS_CPLSYSTEMDESCRIPTION "Zde lze zobrazit informace o tomto počítači a změnit různá systémová a hardwarová nastavení."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "System Indstillinger"
IDS_CPLSYSTEMDESCRIPTION "Se mere information omkring din computer, og skift diverse system og hardware indstillinger."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB of RAM"
IDS_GIGABYTE "GB of RAM"
IDS_TERABYTE "TB of RAM"

View File

@@ -332,10 +332,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "System"
IDS_CPLSYSTEMDESCRIPTION "Zeigt Informationen über Ihren Computer an und ändert verschiedene Computer- und Hardware-Einstellungen"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Σύστημα"
IDS_CPLSYSTEMDESCRIPTION "Δείτε πληροφορίες για το σύστημα του υπολογιστή σας και αλλάξτε ρυθμίσεις υλικού, επιδόσεων και αυτόματης ενημέρωσης."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB μνήμης RAM"
IDS_GIGABYTE "GB μνήμης RAM"
IDS_TERABYTE "TB μνήμης RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "System"
IDS_CPLSYSTEMDESCRIPTION "See information about your computer and change various system and hardware settings."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB of RAM"
IDS_GIGABYTE "GB of RAM"
IDS_TERABYTE "TB of RAM"

View File

@@ -325,10 +325,34 @@ BEGIN
DEFPUSHBUTTON "Aceptar", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistema"
IDS_CPLSYSTEMDESCRIPTION "Muestra información sobre el sistema de su equipo y cambia la configuración del hardware, rendimiento y actualizaciones automáticas."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB de RAM"
IDS_GIGABYTE "GB de RAM"
IDS_TERABYTE "TB de RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Système"
IDS_CPLSYSTEMDESCRIPTION "Affiche des informations à propos de l'ordinateur et change des réglages systèmes et matériels."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "Mo de RAM"
IDS_GIGABYTE "Go de RAM"
IDS_TERABYTE "To de RAM"

View File

@@ -325,10 +325,34 @@ BEGIN
DEFPUSHBUTTON "אישור", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "מערכת"
IDS_CPLSYSTEMDESCRIPTION "See information about your computer and change various system and hardware settings."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB זיכרון פיזי"
IDS_GIGABYTE "GB זיכרון פיזי"
IDS_TERABYTE "TB זיכרון פיזי"

View File

@@ -325,10 +325,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Rendszer"
IDS_CPLSYSTEMDESCRIPTION "A számítógéppel kapcsolatos információk megjelenítése, különböző rendszer és hardver beállítások módosítása."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistem"
IDS_CPLSYSTEMDESCRIPTION "Lihat informasi tentang komputer anda dan ubah berbagai setelan sistem dan perangkat keras."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistema"
IDS_CPLSYSTEMDESCRIPTION "Visualizza informazioni sul vostro computer e modifica varie impostazioni di sistema."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB di RAM"
IDS_GIGABYTE "GB di RAM"
IDS_TERABYTE "TB di RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "システム"
IDS_CPLSYSTEMDESCRIPTION "コンピュータのさまざまなシステムおよびハードウェアの設定を変更するには情報をご覧ください。"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Systeem"
IDS_CPLSYSTEMDESCRIPTION "Systeeminformatie weergeven en omgevingsinstellingen wijzigen."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB of RAM"
IDS_GIGABYTE "GB of RAM"
IDS_TERABYTE "TB of RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "System"
IDS_CPLSYSTEMDESCRIPTION "Se informasjon om din datamaskin og endre forskjellig system og maskinvare innstilling."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB Systemminne"
IDS_GIGABYTE "GB Systemminne"
IDS_TERABYTE "TB Systemminne"

View File

@@ -332,10 +332,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "System"
IDS_CPLSYSTEMDESCRIPTION "Wyświetl informacje o Twoim systemie komputerowym, zmień ustawienia dotyczące sprzętu i wydajności"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -330,10 +330,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistema"
IDS_CPLSYSTEMDESCRIPTION "Veja informações sobre o computador e altere várias definições do sistema e hardware."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB de RAM"
IDS_GIGABYTE "GB de RAM"
IDS_TERABYTE "TB de RAM"

View File

@@ -332,10 +332,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistem"
IDS_CPLSYSTEMDESCRIPTION "Se vizualizează informaţii despre computerul personal şi se modifică setările pentru echipamentele hardware, pentru performanţă şi pentru actualizările automate."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MO de RAM"
IDS_GIGABYTE "GO de RAM"
IDS_TERABYTE "TO de RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "ОК", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Система"
IDS_CPLSYSTEMDESCRIPTION "Просмотр информации о вашем компьютере и изменение различных системных и аппаратных параметров."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "Мб ОЗУ"
IDS_GIGABYTE "Гб ОЗУ"
IDS_TERABYTE "Тб ОЗУ"

View File

@@ -331,10 +331,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Systém"
IDS_CPLSYSTEMDESCRIPTION "Zobrazí informácie o počítači, zmenách rôznych systémových a hardvérových nastavení."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB pamäte RAM"
IDS_GIGABYTE "GB pamäte RAM"
IDS_TERABYTE "TB pamäte RAM"

View File

@@ -323,10 +323,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistemi"
IDS_CPLSYSTEMDESCRIPTION "Shih informacionin në lidhje me kompjuterin tuaj dhe ndrysho sistemin dhe konfigurimin e pjesëve elektronike të ndryshme."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB e RAM"
IDS_GIGABYTE "GB e RAM"
IDS_TERABYTE "TB e RAM"

View File

@@ -325,10 +325,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "System"
IDS_CPLSYSTEMDESCRIPTION "Se information om din dator och ändra olika system- och hårdvaruinställningar."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB RAM"
IDS_GIGABYTE "GB RAM"
IDS_TERABYTE "TB RAM"

View File

@@ -325,10 +325,34 @@ BEGIN
DEFPUSHBUTTON "Tamam", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Sistem"
IDS_CPLSYSTEMDESCRIPTION "Bilgisayar hakkında bilgi görüntüler ve türlü sistem ve donanım ayarlarını değiştirir."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB Bellek"
IDS_GIGABYTE "GB Bellek"
IDS_TERABYTE "TB Bellek"

View File

@@ -331,10 +331,34 @@ BEGIN
DEFPUSHBUTTON "OK", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Система"
IDS_CPLSYSTEMDESCRIPTION "Перегляд відомостей про систему комп'ютера та зміна параметрів обладнання, швидкодії, автоматичних оновлень."
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "Мб ОЗП"
IDS_GIGABYTE "Гб ОЗП"
IDS_TERABYTE "Тб ОЗП"

View File

@@ -332,10 +332,34 @@ BEGIN
DEFPUSHBUTTON "确定", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "系统"
IDS_CPLSYSTEMDESCRIPTION "查看您的计算机系统的信息并更改各种系统及硬件设置"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB 内存"
IDS_GIGABYTE "GB 内存"
IDS_TERABYTE "TB 内存"

View File

@@ -331,10 +331,34 @@ BEGIN
DEFPUSHBUTTON "確定", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "系統"
IDS_CPLSYSTEMDESCRIPTION "查看您的電腦系統的訊息並更改各種系統及硬件設定"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB 記憶體"
IDS_GIGABYTE "GB 記憶體"
IDS_TERABYTE "TB 記憶體"

View File

@@ -332,10 +332,34 @@ BEGIN
DEFPUSHBUTTON "確定", IDOK, 106, 140, 54, 15
END
IDD_VISUALEFFECTS DIALOGEX 6, 18, 227, 204
CAPTION "Visual Effects"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
LTEXT "Select the settings you want to use for the appearance and performance of ReactOS on this computer.", IDC_STATIC, 7, 6, 208, 18
CONTROL "", IDC_TREE, "SysTreeView32", TVS_LINESATROOT | TVS_DISABLEDRAGDROP | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 7, 32, 213, 168
END
IDD_ADVANCEDPERF DIALOGEX 6, 18, 227, 128
CAPTION "Advanced"
FONT 8, "MS Shell Dlg"
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
GROUPBOX "CPU scheduling", IDC_STATIC, 7, 8, 213, 46
LTEXT "Adjust for best performance of:", IDC_STATIC, 14, 23, 199, 8
AUTORADIOBUTTON "&Programs", IDC_CPUCLIENT, 14, 36, 75, 12
AUTORADIOBUTTON "Background &services", IDC_CPUSERVER, 96, 36, 85, 12
GROUPBOX "Virtual memory", IDC_STATIC, 7, 60, 213, 57
LTEXT "A paging file is an area on the hard disk that ReactOS uses as if it were RAM.", IDC_STATIC, 14, 74, 199, 16
PUSHBUTTON "&Change...", IDC_CHANGESWAP, 163, 97, 50, 14
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "系統"
IDS_CPLSYSTEMDESCRIPTION "查看您的電腦系統的資訊並更改各種系統及硬體設定"
IDS_PERFORMANCEOPTIONS "Performance Options"
IDS_MEGABYTE "MB 記憶體"
IDS_GIGABYTE "GB 記憶體"
IDS_TERABYTE "TB 記憶體"

163
dll/cpl/sysdm/performance.c Normal file
View File

@@ -0,0 +1,163 @@
/*
* PROJECT: ReactOS System Control Panel Applet
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
* FILE: dll/cpl/sysdm/performance.c
* PURPOSE: Performance settings property sheets
* COPYRIGHT: Copyright 2024 Whindmar Saksit <whindsaks@proton.me>
*
*/
#include "precomp.h"
#include <shlguid_undoc.h> // CLSID_CRegTreeOptions
#include <shlobj_undoc.h> // IRegTreeOptions
static VOID
RegTreeOpt_OnDestroy(IRegTreeOptions *pRTO)
{
if (pRTO)
{
IRegTreeOptions_WalkTree(pRTO, WALK_TREE_DESTROY);
IRegTreeOptions_Release(pRTO);
}
}
static BOOL
RegTreeOpt_ToggleCheckItem(IRegTreeOptions *pRTO, HTREEITEM hItem)
{
return pRTO && SUCCEEDED(IRegTreeOptions_ToggleItem(pRTO, hItem));
}
static BOOL
RegTreeOpt_OnTreeViewClick(IRegTreeOptions *pRTO, HWND hWndTree)
{
TV_HITTESTINFO HitTest;
DWORD dwPos = GetMessagePos();
HitTest.pt.x = GET_X_LPARAM(dwPos);
HitTest.pt.y = GET_Y_LPARAM(dwPos);
ScreenToClient(hWndTree, &HitTest.pt);
HTREEITEM hItem = TreeView_HitTest(hWndTree, &HitTest);
return RegTreeOpt_ToggleCheckItem(pRTO, hItem);
}
static BOOL
RegTreeOpt_OnTreeViewKeyDown(IRegTreeOptions *pRTO, HWND hWndTree, TV_KEYDOWN *pKey)
{
if (pKey->wVKey == VK_SPACE)
return RegTreeOpt_ToggleCheckItem(pRTO, TreeView_GetSelection(hWndTree));
else if (pKey->wVKey == VK_F5 && pRTO)
IRegTreeOptions_WalkTree(pRTO, WALK_TREE_REFRESH);
return FALSE;
}
static INT_PTR CALLBACK
VisualEffectsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
IRegTreeOptions *pRTO = (IRegTreeOptions*)GetWindowLongPtrW(hDlg, DWLP_USER);
HWND hWndTree = GetDlgItem(hDlg, IDC_TREE);
switch (uMsg)
{
case WM_INITDIALOG:
{
IRegTreeOptions *pRTO = NULL;
if (SUCCEEDED(CoCreateInstance(&CLSID_CRegTreeOptions, NULL, CLSCTX_INPROC_SERVER,
&IID_IRegTreeOptions, (void**)&pRTO)))
{
LPCSTR pszPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VisualEffects";
SetWindowLongPtrW(hDlg, DWLP_USER, (LPARAM)pRTO);
IRegTreeOptions_InitTree(pRTO, hWndTree, HKEY_LOCAL_MACHINE, pszPath, NULL);
}
else
{
// Without IRegTreeOptions, our page is pointless so we remove it.
// MSDN says we have to post the remove message from inside WM_INITDIALOG.
HWND hWndPS = GetParent(hDlg);
int iPage = PropSheet_HwndToIndex(hWndPS, hDlg);
PostMessage(hWndPS, PSM_REMOVEPAGE, 0, SendMessageW(hWndPS, PSM_INDEXTOPAGE, iPage, 0));
}
return TRUE;
}
case WM_DESTROY:
RegTreeOpt_OnDestroy(pRTO);
SetWindowLongPtrW(hDlg, DWLP_USER, (LPARAM)NULL);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
case NM_CLICK:
if (RegTreeOpt_OnTreeViewClick(pRTO, hWndTree))
PropSheet_Changed(GetParent(hDlg), hDlg);
break;
case TVN_KEYDOWN:
if (RegTreeOpt_OnTreeViewKeyDown(pRTO, hWndTree, (TV_KEYDOWN*)lParam))
PropSheet_Changed(GetParent(hDlg), hDlg);
break;
case PSN_APPLY:
{
if (pRTO)
IRegTreeOptions_WalkTree(pRTO, WALK_TREE_SAVE);
SHSendMessageBroadcastW(WM_SETTINGCHANGE, 0, 0); // For the ListviewShadow setting
return TRUE;
}
}
break;
}
return FALSE;
}
static INT_PTR CALLBACK
AdvancedDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
// TODO: Not implemented yet
EnableWindow(GetDlgItem(hDlg, IDC_CPUCLIENT), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_CPUSERVER), FALSE);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_CHANGESWAP:
DialogBoxW(hApplet, MAKEINTRESOURCEW(IDD_VIRTMEM), hDlg, VirtMemDlgProc);
break;
}
break;
}
return FALSE;
}
VOID
ShowPerformanceOptions(HWND hDlg)
{
HRESULT hrInit = CoInitialize(NULL); // For IRegTreeOptions
PROPSHEETHEADERW psh = { sizeof(psh), PSH_PROPSHEETPAGE | PSH_NOCONTEXTHELP };
PROPSHEETPAGEW pages[2] = { 0 };
pages[0].dwSize = sizeof(*pages);
pages[0].hInstance = hApplet;
pages[0].pszTemplate = MAKEINTRESOURCEW(IDD_VISUALEFFECTS);
pages[0].pfnDlgProc = VisualEffectsDlgProc;
pages[1].dwSize = sizeof(*pages);
pages[1].hInstance = hApplet;
pages[1].pszTemplate = MAKEINTRESOURCEW(IDD_ADVANCEDPERF);
pages[1].pfnDlgProc = AdvancedDlgProc;
psh.hwndParent = hDlg;
psh.hInstance = hApplet;
psh.pszCaption = MAKEINTRESOURCEW(IDS_PERFORMANCEOPTIONS);
psh.nPages = _countof(pages);
psh.ppsp = pages;
PropertySheetW(&psh);
if (SUCCEEDED(hrInit))
CoUninitialize();
}

View File

@@ -5,6 +5,7 @@
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include <ntstatus.h>
#define WIN32_NO_STATUS
@@ -43,6 +44,7 @@ void ShowLastWin32Error(HWND hWndOwner);
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK AdvancedPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
VOID ShowPerformanceOptions(HWND hDlg);
/* Dialogs */
INT_PTR CALLBACK HardProfDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

View File

@@ -14,6 +14,8 @@
#define IDB_ROSBMP 55
#define IDB_ROSMASK 56
#define IDS_PERFORMANCEOPTIONS 35
#define IDS_CPLSYSTEMNAME 60
#define IDS_CPLSYSTEMDESCRIPTION 61
@@ -152,6 +154,16 @@
#define IDC_BUTTON_MOVE_DOWN 711
#define IDC_BUTTON_EDIT_TEXT 712
/* Visual Effects */
#define IDD_VISUALEFFECTS 112
#define IDC_TREE 100
/* Advanced Performance */
#define IDD_ADVANCEDPERF 115
#define IDC_CPUCLIENT 100
#define IDC_CPUSERVER 101
#define IDC_CHANGESWAP 102
/* Virtual memory */
#define IDD_VIRTMEM 900
#define IDC_PAGEFILELIST 901

View File

@@ -164,6 +164,12 @@ SystemApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
nPage = _wtoi((PWSTR)lParam);
}
if (nPage == -1)
{
ShowPerformanceOptions(hwnd);
return TRUE;
}
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPTITLE | PSH_USEICONID | PSH_USECALLBACK;

View File

@@ -1,15 +1,27 @@
#include "ntdll_vista.h"
NTSTATUS
NTAPI
RtlpInitializeLocaleTable(VOID);
BOOL
WINAPI
DllMain(HANDLE hDll,
DWORD dwReason,
LPVOID lpReserved)
{
NTSTATUS Status;
if (dwReason == DLL_PROCESS_ATTACH)
{
LdrDisableThreadCalloutsForDll(hDll);
RtlpInitializeKeyedEvent();
Status = RtlpInitializeLocaleTable();
if (!NT_SUCCESS(Status))
{
RtlpCloseKeyedEvent();
return FALSE;
}
}
else if (dwReason == DLL_PROCESS_DETACH)
{

View File

@@ -18,3 +18,5 @@
@ stdcall RtlConnectToSm(ptr ptr long ptr) SmConnectToSm
@ stdcall RtlSendMsgToSm(ptr ptr) SmSendMsgToSm
@ stdcall RtlLcidToLocaleName(long ptr long long)
@ stdcall RtlLocaleNameToLcid(wstr ptr long)

View File

@@ -672,6 +672,7 @@ HRESULT WINAPI CNetConUiObject::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
}
case IDS_NET_STATUS:
{
// TODO: Windows does not display this with an owner window
return ShowNetConnectionStatus(m_lpOleCmd, m_pidl, lpcmi->hwnd);
}
case IDS_NET_REPAIR:
@@ -837,27 +838,6 @@ HRESULT WINAPI CNetworkConnections::GetCurFolder(PIDLIST_ABSOLUTE *pidl)
return S_OK;
}
/************************************************************************
* ISF_NetConnect_ShellExecuteHookW_Execute
*/
HRESULT WINAPI CNetworkConnections::Execute(LPSHELLEXECUTEINFOW pei)
{
PCUITEMID_CHILD pidl = ILFindLastID((ITEMIDLIST*)pei->lpIDList);
PNETCONIDSTRUCT pdata = ILGetConnData(pidl);
if (!pdata)
{
ERR("Got invalid pidl\n");
return E_FAIL;
}
if (pdata->Status == NCS_CONNECTED)
{
return ShowNetConnectionStatus(m_lpOleCmd, pidl, pei->hwnd);
}
return S_OK;
}
HRESULT WINAPI CNetworkConnections::Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
{
FIXME("CNetworkConnections::Initialize()\n");

Some files were not shown because too many files have changed in this diff Show More