本帖最后由 DEATHTOUCH 于 2020-12-22 11:49 编辑
如下图所示,这是我用C语言调用API写的
后面这张是用其他语言封装的
怎么让C语言写的可以这样呢?
同样的还有用WinAPI写的窗口控件
比如button也是,和MessageBox的按钮一样
这按钮难看的
求大佬帮忙
C语言编译器:
gcc version 8.1.0 (x86_64-win32-sjlj-rev0, Built by MinGW-W64 project)
编辑器:VSCode
这里说一下:本人现在在学习Win32API编程,就是觉得这外观别扭想改改
最后我发现创建一个和exe同名的manifest文件(比如example.exe.manifest)就行了,里面添加这些内容
https://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/
这篇文章挺详细的
[XML] 纯文本查看 复制代码 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Supports Windows Vista / Server 2008 -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Supports Windows 7 / Server 2008 R2 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Supports Windows 8 / Server 2012 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Supports Windows 8.1 / Server 2012 R2 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Supports Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
</assembly>
|