Access Cookbook - Ken Getz [247]
SM_DBCSENABLED
42
Nonzero if current version of Windows uses double-byte characters; zero otherwise.
SM_CMOUSEBUTTONS
43
Number of buttons on the mouse, or zero if no mouse is present.
SM_SECURE
44
Nonzero if security is present; zero otherwise.
SM_CXMINSPACING
47
With SM_CYMINSPACING, dimensions of a grid cell for minimized windows, in pixels. Each minimized window fits into a rectangle this size when arranged. These values are always greater than or equal to SM_CXMINIMIZED and SM_CYMINIMIZED.
SM_CYMINSPACING
48
See SM_CXMINSPACING.
SM_CXSMICON
49
With SM_CYSMICON, recommended dimensions of a small icon, in pixels. Small icons typically appear in window captions and in small icon view.
SM_CYSMICON
50
See SM_CXSMICON.
SM_CXSMSIZE
52
With SM_CYSMSIZE, dimensions of small caption buttons, in pixels.
SM_CYSMSIZE
53
See SM_CXSMSIZE.
SM_CXMENUSIZE
54
Width of menu bar buttons (such as multiple document (MDI) child Close), in pixels.
SM_CYMENUSIZE
55
Height of menu bar buttons (such as multiple document (MDI) child Close), in pixels.
SM_ARRANGE
56
Flags specifying how the system arranges minimized windows.
SM_CXMINIMIZED
57
Width of a normal minimized window, in pixels.
SM_CYMINIMIZED
58
Height of a normal minimized window, in pixels.
SM_CXMAXTRACK
59
Default maximum width of a window that has a caption and sizing borders. The user cannot drag the window frame to a size larger than these dimensions.
SM_CYMAXTRACK
60
See SM_CXMAXTRACK (height, instead).
SM_CXMAXIMIZED
61
Default width of a maximized top-level window, in pixels.
SM_CYMAXIMIZED
62
Default height of a maximized top-level window, in pixels.
SM_NETWORK
63
The least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use.
SM_CLEANBOOT
67
Value that specifies how the system was started: 0 (Normal boot), 1 (Fail-safe boot), 2 (Fail-safe with network boot). Fail-safe boot (also called SafeBoot) bypasses the user's startup files.
SM_SHOWSOUNDS
70
Nonzero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; zero otherwise.
SM_CXMENUCHECK
71
Width of the default menu checkmark bitmap, in pixels.
SM_CYMENUCHECK
72
Height of the default menu checkmark bitmap, in pixels.
SM_SLOWMACHINE
73
Nonzero if the computer has a low-end (slow) processor, zero otherwise.
SM_CMETRICS
75
Number of system metrics and flags.
Some of the flags supported by GetSystemMetrics behave differently under different operating systems. Make sure you check the documentation (online at http://msdn.microsoft.com) for operating-system dependencies. You'll also find other options that you can add to this form; we didn't include every available option here.
In addition to the functions listed here, you may find the SystemParametersInfo API function useful. It allows you to set and retrieve many system parameters, but calling it is a bit more difficult than calling GetSystemMetrics. If you have access to a Windows API reference, you may want to dig into this useful function.
11.14. Create and Cancel Network Connections Programmatically
Problem
You'd like to be able to connect to remote network devices from within your own Access applications. You know that you could do this manually, using Explorer or File Manager, but there must be some internal API for controlling these connections. Is there some way you can manage connections from within Access?
Solution
Windows provides a rich interface to its networking subsystem through its API. Many of the function calls are difficult, if not impossible, to call from VBA because of the language's lack of pointer variable types. Some important calls, however, are quite simple to use, as you'll see in this solution. The example form will demonstrate connecting to and disconnecting from remote devices (printers and drives) using common dialogs or using code with no user interface.