Skip to content

Use explicit ANSI Win32 APIs for Windows IPC#1117

Merged
stloeffler merged 1 commit into
TeXworks:mainfrom
aycph:fix/win-ipc-ansi
Jun 13, 2026
Merged

Use explicit ANSI Win32 APIs for Windows IPC#1117
stloeffler merged 1 commit into
TeXworks:mainfrom
aycph:fix/win-ipc-ansi

Conversation

@aycph

@aycph aycph commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #1116.

This PR makes the Windows IPC code use explicit ANSI Win32 APIs consistently in InterProcessCommunicatorWin.cpp.

In particular, it changes DefWindowProc to DefWindowProcA in TW_HiddenWindowProc. On my affected Windows setup, this restores successful creation of the hidden IPC message window, and second-instance forwarding works normally again.

For consistency with the rest of this file, this PR also changes:

  • GetModuleHandle -> GetModuleHandleA
  • GetWindowLongPtr -> GetWindowLongPtrA
  • SetWindowLongPtr -> SetWindowLongPtrA

@aycph

aycph commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

For GetModuleHandle, since the argument here is NULL, the A/W distinction does not appear to make a practical difference at this call site. I still changed it to the A version to match the other explicit ANSI calls in this file, as the file does not use wide string literals.

If any part of this approach is not appropriate, please feel free to adjust it as you see fit.

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.18%. Comparing base (9f55638) to head (5c3ced9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1117      +/-   ##
==========================================
- Coverage   34.46%   34.18%   -0.29%     
==========================================
  Files         153      153              
  Lines       17592    19038    +1446     
  Branches     2420     2420              
==========================================
+ Hits         6063     6508     +445     
- Misses      11529    12530    +1001     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stloeffler stloeffler merged commit 8b52c3a into TeXworks:main Jun 13, 2026
17 of 19 checks passed
@aycph aycph deleted the fix/win-ipc-ansi branch June 13, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows 11 25H2: second TeXworks instance silently exits because hidden IPC message window is not created

2 participants