|

50精币
我的本意是想写一个 Dll 用于外部调用,该 Dll 负责用户界面部分。然后我写了这些代码,运行时窗口弹出了一下立马就关闭了。请教一下大佬。谢谢!
代码:
变量名 | 类 型 | 静态 | 数组 | 备 注 | mainw | 窗口类 | | | size | 黑月坐标 | | | pos | 黑月坐标 | | | verMajor | 整数型 | | | style | 整数型 | | | wstrTitle | 字节集 | | | wstrWndClass | 字节集 | | |
mainw. 事件_创建完毕 (&mainw_eventOnCreate )mainw. 事件_可否被关闭 (&mainw_eventOnClose )GetSystemVersion (verMajor, , , , , , ) 如果真 (verMajor > 5 ) SetProcessDPIAware ()pos = NewWndPos (0, 0) 如果 (是否为调试版 ())  如果 (verMajor > 5 )  size = NewWndSize (GetSystemMetrics (33 ) × 2 + 1024, GetSystemMetrics (32 ) × 2 + GetSystemMetrics (4 ) + 768 )  size = NewWndSize (GetSystemMetrics (33 ) × 2 + 1024, GetSystemMetrics (32 ) × 2 + GetSystemMetrics (4 ) + 768 ) style = 位或 ( #窗口风格_组样式, 位或 ( #窗口风格_标题栏, #窗口风格_系统菜单, #窗口风格_对话框边框, #窗口风格_最大化按钮, #窗口风格_单边框, #窗口风格_可视, #窗口风格_可调边框 )) 如果 (verMajor > 5 )  size = NewWndSize (取屏幕宽度 () × DPI, 取屏幕高度 () × DPI )  size = NewWndSize (取屏幕宽度 (), 取屏幕高度 ()) style = 位或 ( #窗口风格_组样式, #窗口风格_无边框 )wstrTitle = RCGetStringW (189, )wstrWndClass = L (“WindowsSetup_GUI”)mainw. 创建W (, wstrTitle, pos, size, style, , 假, wstrWndClass )mainw. 位置 ( #窗口位置_居中 )mainw. 背景图显示方式 ( #图片显示方式_缩放 )mainw. Esc关闭 (真)返回 (mainw. 取窗口句柄 ()) |
mainw_eventOnCreate | | | |
hWnd | 整数型 | | | |
mainw. 置窗口句柄 (hWnd )mainw. 背景图 (RCGetImgObj (W32UiRCGetFitBackImgResID (3, mainw. 取用户区宽度 (), mainw. 取用户区高度 ()) )) mainw. 置图标 (RCGetIconObj (129 ), )返回 (0 )DPI = 系统_取系统DPI () ÷ 100 判断 (是否为调试版 () = 真) 返回 (NewDllMain (&DllMain )) 判断 (是否为调试版 () = 真)winmain. 初始化 (, , ) winmain. 初始化 (hInstance, , )Api静态加速优化 ()_临时子程序 () 返回 (0 ) |
DllMain | 逻辑型 | | |
hModule | 整数型 | | | | ul_reason_for_call | 整数型 | | | | lpReserved | 整数型 | | | |
判断 (ul_reason_for_call = 0 )  如果真 (是否为调试版 ())  信息框 (“释放模块”, 0, , )  判断 (ul_reason_for_call = 1 )  如果真 (是否为调试版 ())  信息框 (“模块句柄:” + 到文本 (hModule ), 0, , ) hInstance = hModule 判断 (ul_reason_for_call = 2 )  如果真 (是否为调试版 ())  信息框 (“创建线程”, 0, , )  判断 (ul_reason_for_call = 3 )  如果真 (是否为调试版 ())  信息框 (“线程销毁”, 0, , )   返回 (真) mainw. 置窗口句柄 (CreateMainWindow ()) winmain. 运行 (mainw, 真)
用的是黑月界面类 3.9.0 目前最新版本。
谢谢!
补充内容 (2025-1-4 19:27):
一些代码没有用,主要是窗口出了什么问题,而不是图标、背景图的设置问题 |
|