[英]How do I implement this code into a dialog type resource file?
// Epvolume.rc -- Resource script
#include "resource.h"
#include "windows.h"
#include "commctrl.h"
//
// Dialog box
//
VOLUMECONTROL DIALOGEX 0, 0, 160, 60
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU | DS_SETFONT
CAPTION "Audio Endpoint Volume"
FONT 8, "Arial Rounded MT Bold", 400, 0, 0x0
BEGIN
LTEXT "Min",IDC_STATIC_MINVOL,10,10,20,12
RTEXT "Max",IDC_STATIC_MAXVOL,130,10,20,12
CONTROL "",IDC_SLIDER_VOLUME,"msctls_trackbar32",
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,20,140,12
CONTROL "Mute",IDC_CHECK_MUTE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,20,40,70,12
END
I don't know a thing about resource files, I tried to make it a dialog resource type but I don't quite know how to enter this code into that dialog file because I don't really know how to work it.我对资源文件一无所知,我试图将其设为对话框资源类型,但我不太清楚如何将此代码输入到该对话框文件中,因为我真的不知道如何使用它。 Just to clear things up, when I make a new dialog file it gives me a blank dialog, which I don't know how to edit, maybe I'm doing something wrong?
只是为了澄清一下,当我创建一个新的对话框文件时,它会给我一个空白对话框,我不知道如何编辑,也许我做错了什么? I don't know where to put the code
我不知道把代码放在哪里
You need to open the resource file as text rather than with the designer.您需要以文本形式而不是使用设计器打开资源文件。 In solution explorer select the resource script file and hit ctrl+alt+0.
在解决方案资源管理器 select 中,资源脚本文件并按 ctrl+alt+0。 You can then cut-and-paste text as usual.
然后,您可以照常剪切和粘贴文本。
Most of the time when simply laying out a new dialog it is easier to use the designer but editting it as text is much easier when you have existing resources you want to bring into a project.大多数情况下,简单地布置一个新对话框更容易使用设计器,但当您拥有想要引入项目的现有资源时,将其编辑为文本会容易得多。
Note that you will also need to edit resources.h to add the various control symbol names (for example IDC_SLIDER_VOLUME) as well as modifying _APS_NEXT_CONTROL_VALUE to be the next unused value.请注意,您还需要编辑 resources.h 以添加各种控制符号名称(例如 IDC_SLIDER_VOLUME),并将 _APS_NEXT_CONTROL_VALUE 修改为下一个未使用的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.