看了一些代码和文档说明还是没有搞清楚这个参数如何用,才能加载模板希望大家能帮忙提供下用法,谢谢!如: 
 OPENFILENAME OFN;
 OFN.lpTemplateName = TEXT("TempalteName1");
 然后如何定义后面要加载的模板呢?
  

解决方案 »

  1.   

    要学会看MSDN:
    lpTemplateName
    Pointer to a null-terminated string that names a dialog template resource in the module identified by the hInstance member. For numbered dialog box resources, this can be a value returned by the MAKEINTRESOURCE macro. This member is ignored unless the OFN_ENABLETEMPLATE flag is set in the Flags member. If the OFN_EXPLORER flag is set, the system uses the specified template to create a dialog box that is a child of the default Explorer-style dialog box. If the OFN_EXPLORER flag is not set, the system uses the template to create an old-style dialog box that replaces the default dialog box.
      

  2.   

    谢谢大家指点!之前也看过MSDN说明,知道才资源文件中定义,但不知道其格式是?不知道能不能给个简单的例子呢?
      

  3.   

    visual studio的资源编辑器就可以用来编辑资源脚本,你也可以用记事本编辑它
      

  4.   

    不知道是不是类似这种呢?IDD_ABOUTBOX DIALOG  22, 17, 230, 75
    STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
    CAPTION "关于"
    FONT 9, "宋体"
    BEGIN
        ICON            IDI_VIEWTXT,IDC_MYICON,14,9,16,16
        LTEXT           "viewtxt 1.0 版",IDC_STATIC,49,10,119,8,SS_NOPREFIX
        LTEXT           "版权所有 (C) 2011",IDC_STATIC,49,20,119,8
        DEFPUSHBUTTON   "确定",IDOK,195,6,30,11,WS_GROUP
    END但是像这种用了自己的,那么用到的filter和filename的buffer如何与其关联上呢?
      

  5.   

    http://msdn.microsoft.com/en-us/library/ms646951(v=VS.85).aspx#_win32_Custom_Templates