... Imports
statement to the beginning of the file.
5.
Working with the Win 32 API
Working directly with the Win 32 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 Win 32 Access
There a...
... 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 in...
... Overcoming Security Issues 421
List of Listings 422
Chapter 1: Overcoming Holes in the .NET Framework 422
Chapter 2: Working with Win 32 API Data 422
Chapter 3: Accessing the Win 32 API 422
Chapter ... Win 32 API, you should
avoid it whenever possible.
Understanding the Effects of Pointers
One of the first issues that you’ll face when working with 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 Win 32 API in this
case. There ... experiment with some of the console functions presented in
this chapter.
Chapter 7 continues the search for ways to plug the holes in the .NET Framew...
... checking using the methods in this namespace, but it appears that the
OperatingSystem class relies on the GetVersion() Win 32 API call instead of the GetVersionEx() Win 32
API call to obtain the ... extern Int 32 DrawThemeIcon(IntPtr hTheme,
IntPtr hDC,
Int 32 iPartId,
Int 32 iStateId,
ref RECT pRect,
int himl,
Int 32 iImageIndex);
// Defines used for the p...
... 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 ... describes them using unsigned values. This seeming dichotomy in the same data
structure is actually quite common for the Win 32 API.
The btnTest_Click() method begins...
... 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 ... appear in the Result pane. The
RESULTDATAITEM data structure contains an item mask that indicates the type of information the result
item will contain, the method o...
... static Int 32 MAKE_HRESULT(Int 32 sev, Int 32 fac, Int 32 code)
{
Int64 Temp; // The temporary value of the error code.
// Define the error code. Bit shift the severity
// by 31 bits and the factor ... hold
the UInt 32 value and then cast that value it an Int 32 as shown. This technique has the advantage of fully
documenting the process and also retaining the or...
... 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 ... structure information 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...
... confusion on the part of
other developers and increases the work required to use the Win 32 API, without much benefit to the
originator.
1.
Verify the type of variable that a handle or other pointer ... using a single bit path. Instead of transmitting
the data in packets, the sender transmits the data continuously. This technique works well in
S
410
List of Si...