The UAC programming standards require an application to use the fewest privileges that are necessary to get the job done. An application should run with normal user privileges if possible.
If the application must perform some task that requires greater privileges, it can execute a separate application that has elevated privileges.
This chapter shows three methods for running a program with elevated privileges. First, you can ask the user to right-click the executable program and select Run as administrator. This is not the most convenient strategy, but should be acceptable for programs that the user only needs to run rarely, or that only rarely need administrator privileges.
Second, you can provide an application manifest that goes along with the file. Third, you can use the mt.exe tool to embed the manifest within the executable itself. This requires a little more work on your part, but ensures that UAC elevates the program whenever it is run.
The chapters in the book so far have focused on specific Visual Basic programming details that you need to understand to write Visual Basic applications. They explained the Visual Basic development environment, language syntax, standard controls and forms, custom controls, drag and drop, and the clipboard. This chapter described some UAC security issues that you need to be aware of if you want to perform tasks that require elevated user privileges.
The chapters in the next part of the book deal with higher-level object-oriented programming (OOP) issues. They explain fundamental concepts in object-oriented development and how they apply to Visual Basic. They tell how to build and use classes and objects, and they describe some of the standard classes that Visual Basic and the .NET Framework provide to perform common programming tasks.
Chapter 15 starts by explaining fundamental ideas behind object-oriented programming, such as the three main features of OOP: encapsulation, polymorphism, and inheritance. It explains the benefits of these features and tells how you can take advantage of them in Visual Basic.