Program crash when creating MagnificationAPI window in Windows 11

RL Chen 230 Reputation points
2024-07-05T04:07:40.6+00:00

While executing the following statement, programs on the target computer crash without warning and without a runtime error pop-up box.

hwndMag = CreateWindow(WC_MAGNIFIER, TEXT("IdtScreenMagnifierMag"), WS_CHILD | MS_CLIPAROUNDCURSOR | WS_VISIBLE, hostWindowRect.left, hostWindowRect.top, hostWindowRect.right, hostWindowRect.bottom, hwndHost, NULL, hInst, NULL);

And,

LONG WINAPI MyUnhandledExceptionFilter(EXCEPTION_POINTERS* ExceptionInfo) {
	std::cerr << "Unhandled exception occurred. Exception code: " << ExceptionInfo->ExceptionRecord->ExceptionCode << std::endl;
	return EXCEPTION_EXECUTE_HANDLER;
}

No error messages were captured either.

We make sure that the parameters are correct because it runs fine on my computer and only a small percentage of computers experience it.

The error log given by win eventvwr is:

日志名称:          Application
来源:            Application Error
日期:            2024/7/5 11:18:54
事件 ID:         1000
任务类别:          应用程序崩溃事件
级别:            错误
关键字:           
用户:            DESKTOP-22AG3BV\mujingfantasy
计算机:           DESKTOP-22AG3BV
描述:
错误应用程序名称: 智绘教 (1).exe,版本: 1.0.0.0,时间戳: 0x66860d65
错误模块名称: ucrtbase.dll,版本: 10.0.22621.3593,时间戳: 0x84b62951
异常代码: 0xc0000409
错误偏移量: 0x0009e3bb
错误进程 ID: 0x0xA7B8
错误应用程序启动时间: 0x0x1DACE8A0911C6A7
错误应用程序路径: C:\Users\mujingfantasy\Desktop\智绘教\new2\智绘教 (1).exe
错误模块路径: C:\WINDOWS\System32\ucrtbase.dll
报告 ID: 9faf5ffd-9498-4920-9295-8dceddd13021
错误程序包全名: 
错误程序包相对应用程序 ID: 
事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" Guid="{a0e9b465-b939-57d7-b27d-95d8e925ff57}" />
    <EventID>1000</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>100</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-07-05T03:18:54.7971636Z" />
    <EventRecordID>274918</EventRecordID>
    <Correlation />
    <Execution ProcessID="30028" ThreadID="39968" />
    <Channel>Application</Channel>
    <Computer>DESKTOP-22AG3BV</Computer>
    <Security UserID="S-1-5-21-1210085055-1240170532-568537777-1001" />
  </System>
  <EventData>
    <Data Name="AppName">智绘教 (1).exe</Data>
    <Data Name="AppVersion">1.0.0.0</Data>
    <Data Name="AppTimeStamp">66860d65</Data>
    <Data Name="ModuleName">ucrtbase.dll</Data>
    <Data Name="ModuleVersion">10.0.22621.3593</Data>
    <Data Name="ModuleTimeStamp">84b62951</Data>
    <Data Name="ExceptionCode">c0000409</Data>
    <Data Name="FaultingOffset">0009e3bb</Data>
    <Data Name="ProcessId">0xa7b8</Data>
    <Data Name="ProcessCreationTime">0x1dace8a0911c6a7</Data>
    <Data Name="AppPath">C:\Users\mujingfantasy\Desktop\智绘教\new2\智绘教 (1).exe</Data>
    <Data Name="ModulePath">C:\WINDOWS\System32\ucrtbase.dll</Data>
    <Data Name="IntegratorReportId">9faf5ffd-9498-4920-9295-8dceddd13021</Data>
    <Data Name="PackageFullName">
    </Data>
    <Data Name="PackageRelativeAppId">
    </Data>
  </EventData>
</Event>

Please help me out, thanks~

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,653 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,760 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RL Chen 230 Reputation points
    2024-07-08T03:15:39.3333333+00:00

    We have already solved this problem. In the end, we found that if the name of the exe contains Chinese, it will appear (even if the path only contains English), and the official example is the same. But it can only be replicated on that computer, so this issue is difficult to track. Thank you all for your enthusiastic help. In short, the problem has been resolved.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.