Skip to content

Commit 36ad91c

Browse files
authored
Merge pull request #1717 from msebolt/resource-file-consolidation-pr30
resource file consolidation pr30
2 parents 9fd9741 + e21144e commit 36ad91c

File tree

4 files changed

+32
-45
lines changed

4 files changed

+32
-45
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7715,6 +7715,11 @@
77157715
"redirect_url": "/cpp/windows/sizing-individual-controls",
77167716
"redirect_document_id": false
77177717
},
7718+
{
7719+
"source_path": "docs/windows/creating-a-dialog-box-that-users-cannot-exit.md",
7720+
"redirect_url": "/cpp/windows/creating-a-new-dialog-box",
7721+
"redirect_document_id": false
7722+
},
77187723
{
77197724
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
77207725
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

docs/windows/TOC.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@
5858
##### [Accelerator Keys](predefined-accelerator-keys.md)
5959
#### [Binary Editor](binary-editor.md)
6060
#### [Dialog Editor](dialog-editor.md)
61-
##### [Creating a New Dialog Box](creating-a-new-dialog-box.md)
62-
##### [Creating a Dialog Box That Users Cannot Exit](creating-a-dialog-box-that-users-cannot-exit.md)
61+
##### [Creating a Dialog Box](creating-a-new-dialog-box.md)
6362
##### [Showing or Hiding the Dialog Editor Toolbar](showing-or-hiding-the-dialog-editor-toolbar.md)
6463
##### [Switching Between Dialog Box Controls and Code](switching-between-dialog-box-controls-and-code.md)
6564
##### [Controls in Dialog Boxes](controls-in-dialog-boxes.md)

docs/windows/creating-a-dialog-box-that-users-cannot-exit.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

docs/windows/creating-a-new-dialog-box.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
11
---
2-
title: "Creating a New Dialog Box (C++)"
2+
title: "Creating a Dialog Box (C++)"
33
ms.date: "11/04/2016"
44
f1_keywords: ["vc.editors.dialog"]
5-
helpviewer_keywords: ["dialog boxes [C++], creating", "Dialog Editor [C++], creating dialog boxes"]
5+
helpviewer_keywords: ["dialog boxes [C++], creating", "Dialog Editor [C++], creating dialog boxes", "modal dialog boxes [C++], logon screens", "logon screens"]
66
ms.assetid: 303de801-c4f8-42e1-b622-353f6423f688
77
---
8-
# Creating a New Dialog Box (C++)
8+
# Creating a Dialog Box (C++)
99

10-
### To create a new dialog box
10+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
11+
12+
## To create a new dialog box
1113

1214
1. In [Resource View](../windows/resource-view-window.md), right-click your .rc file, then choose **Add Resource** from the shortcut menu.
1315

1416
> [!NOTE]
1517
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
1618
17-
2. In the **Add Resource** dialog box, select **Dialog** in the **Resource Type** list, then click **New**.
19+
1. In the **Add Resource** dialog box, select **Dialog** in the **Resource Type** list, then choose **New**.
1820

19-
If a plus sign (**+**) appears next to the **Dialog** resource type, it means that dialog box templates are available. Click the plus sign to expand the list of templates, select a template, and click **New**.
21+
If a plus sign (**+**) appears next to the **Dialog** resource type, it means that dialog box templates are available. Select the plus sign to expand the list of templates, select a template, and choose **New**.
2022

2123
The new dialog box opens in the **Dialog** editor.
2224

2325
You can also [open existing dialog boxes in the Dialog Box editor for editing](../windows/viewing-and-editing-resources-in-a-resource-editor.md).
2426

25-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
27+
## To create a dialog box that a user can't exit
28+
29+
You can create a runtime dialog box that a user can't exit. This kind of dialog box is useful for logons, and for application or document locks.
30+
31+
1. In the **Properties** pane for the dialog box, set the **System Menu** property to **false**.
32+
33+
This setting disables the dialog box system menu and **Close** button.
34+
35+
1. In the dialog box form, delete the **Cancel** and **OK** buttons.
36+
37+
At run time, a user can't exit a modal dialog box that has these characteristics.
38+
39+
To enable testing of this kind of dialog box, the test dialog box function detects when **Esc** is pressed. (**Esc** is also known as the VK_ESCAPE virtual key.) No matter how the dialog box is designed to behave at run time, you can end test mode by pressing **Esc**.
40+
41+
> [!NOTE]
42+
> For MFC applications, to create a dialog box that users cannot exit, you must override the default behavior of `OnOK` and `OnCancel` because even if you delete the associated buttons, the dialog box can still be dismissed by pressing **Enter** or **Esc**.
43+
44+
For information about how to add resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index).
2645

2746
## Requirements
2847

0 commit comments

Comments
 (0)