... haven’t discussed many of the buttons on the left side of the Windows Media Player yet. You’ll find that
several of them enable you to find media on the Internet. The main Internet button is Media ... problems—you obtain information on every aspect of the Win32 API call.
Tip Many other developers are struggling with the same problems that you face in working with...
... Imports
statement to the beginning of the file.
5.
Working with the Win32 API
Working directly with the Win32 API means locating the various functions you need—they’re not all in the
same DLL. In many cases, ... main DLLs,
you’ll find that you can patch quite a few of the obvious support holes in the .NET Framework.
Types of Win32 Access
There are two...
... on the GetWindowText() function to display the name of the
window in a textbox on the dialog. The use of an IntPtr as one of the inputs is hardly surprising, because it
contains the handle to the ... while reducing
the performance overhead of interacting with the DLL.
Chapter 6 begins a new phase of this book. Rather than look at the technologies involved...
... possible.
Understanding the Effects of Pointers
One of the first issues that you’ll face when working with the Win32 API is the use of pointers the Win32
API uses them by the gross. You’ll find pointers as ... 421
List of Listings 422
Chapter 1: Overcoming Holes in the .NET Framework 422
Chapter 2: Working with Win32 API Data 422
Chapter 3: Accessing the...
... might find other types of printers lacking in some areas.
Creating the Wrapper DLL
The wrapper DLL does most of the work of retrieving the printer information from the Win32 API in this
case. There ... POINTL dmPosition;
// };
Int 16 dmOrientation;
Int 16 dmPaperSize;
Int 16 dmPaperLength;
Int 16 dmPaperWidth;
Int 16 dmScale;
Int 16 dmCopies;
Int 16 dmDe...
... checking using the methods in this namespace, but it appears that the
OperatingSystem class relies on the GetVersion() Win32 API call instead of the GetVersionEx() Win32
API call to obtain the ... code includes an encapsulated version of the code used to gain access to the security
descriptor in the form of the GetFileSD() function.
Listing 8.3: Gaining Acc...
... the wave device.
Stopping the playback means not only stopping the sound, but also moving the pointer back to the beginning
of the data. When you play the sound again, Windows will begin at the ... Generally, it’s a good idea to clean
up the remaining unmanaged variables in the frmMain_Closing() method as shown in Listing 11 .6.
Listing 11 .6: Cleaning Up the Rema...
... from the user. Listing 14.1 shows the class definition.
Listing 14.1: Defining an IID Constant Value
class CreateIID
{
public static GUID DEFINE_GUID(UInt32 Data 1In,
UInt 16 Data 2In,
UInt 16 Data 3In,
... SizeConst=Functions.DD_ROP_SPACE)]
public UInt32 []dwRops;
The magic of this solution is all in the [MarshalAs] attribute. However, it begins with a correct definiti...
... determines which axes of the input device are affected by the ramp. The
Timing tab tells how long the effect lasts and determines if there’s a delay in starting it. Finally, the General
tab contains ... for all three.
The example changes the x− and y−coordinates to 0.300000 as shown in the following listing (you’ll find the
complete listing in the Box4.X file on t...
... Devices
Listing 15.3: Displaying the Mouse Status
Chapter 16: Extended DirectX Programming Examples
Listing 16. 1: Mesh Example Initialization
Listing 16. 2: Loading the X File
Listing 16. 3: Rendering the ... confusion on the part of
other developers and increases the work required to use the Win32 API, without much benefit to the
originator.
1.
Verify the type of var...