- Appendix B: Constants -


Blt Flags

Const SRCAND = &H8800C6
Const SRCCOPY = &HCC0020
Const SRCERASE = &H440328
Const SRCINVERT = &H660046
Const SRCPAINT = &HEE0086
The Blt flags tell what method to use when transfering the graphic chunk from the souce object to the target object. Unlike the flags in other function, you must use one and only one constant for dwRop. The ANDs, ORs, etc. are binary operations done on a pixel-by-pixel level with the colors in the chunk and target.
SRCANDdestination = chunk AND destination
SRCCOPYdestination = chunk
SRCERASEdestination = chunk AND (NOT destination)
SRCINVERTdestination = chunk XOR destination
SRCPAINTdestination = chunk OR destination
Used by: BitBlt, StretchBlt
Back to the index.


Color Dialog Flags

Const CC_RGBINIT = &H1
Const CC_FULLOPEN = &H2
Const CC_PREVENTFULLOPEN = &H4
Const CC_SHOWHELP = &H8
Const CC_SOLIDCOLOR = &H80
Const CC_ANYCOLOR = &H100
The color dialog constants tell Windows how to render the choose color dialog box. You can use more than one of the flags by adding them together, but you cannot use contradicting flags (such as CC_FULLOPEN and CC_PREVENTFULLOPEN).
CC_RGBINITMake the color specified by the rgbResult property already selected in the box.
CC_FULLOPENAutomatically display the Define Custom Colors half of the dialog box.
CC_PREVENTFULLOPENDisable the button that opens the Define Custom Colors half of the dialog box.
CC_SHOWHELPDisplays the Help button. Unfortunately, I do not yet know how to make the button do anything when clicked.
CC_SOLIDCOLORReturn the solid-color equivalent of the selected color (applies to color depths 256 and below).
CC_ANYCOLORReturn the textured-color equivalent of the selected color if it is not solid (applies to color depths 256 and below).
Used by: ChooseColor (used through CHOOSECOLORS)
Back to the index.


Drive Type Constants

Const DRIVE_REMOVABLE = 2
Const DRIVE_FIXED = 3
Const DRIVE_REMOTE = 4
Const DRIVE_CDROM = 5
Const DRIVE_RAMDISK = 6
The drive type constants identify the type of a drive on the computer. This could be a floppy drive, a hard drive, a CD-ROM drive, etc. A value containing the type of drive can hold only one value, since a drive can't be two things at once.
DRIVE_REMOVABLEA floppy drive or some other form of removable readable/writable disk drive.
DRIVE_FIXEDA hard drive.
DRIVE_REMOTEA network drive; i.e., a drive somewhere on the network server.
DRIVE_CDROMA CD-ROM drive.
DRIVE_RAMDISKA RAM drive.
Used by: GetDriveType
Back to the index.


Exit Windows Flags

Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
The Exit Windows flags tell how to shut down or reboot Windows 95. You must use exactly one of them.
EWX_LOGOFFLog off on a networked computer, or else does the same as EWX_REBOOT.
EWX_SHUTDOWNShuts down the computer and, if the computer supports it, powers down.
EWX_REBOOTDoes a full reboot of Windows 95.
EWX_FORCEAppears to empty the tray (the little icons next to the clock on the toolbar). (?)
Used by: ExitWindowsEx
Back to the index.


File Attribute Flags

Const FILE_ATTRIBUTE_ARCHIVE = &H20
Const FILE_ATTRIBUTE_COMPRESSED = &H800
Const FILE_ATTRIBUTE_DIRECTORY = &H10
Const FILE_ATTRIBUTE_HIDDEN = &H2
Const FILE_ATTRIBUTE_NORMAL = &H80
Const FILE_ATTRIBUTE_READONLY = &H1
Const FILE_ATTRIBUTE_SYSTEM = &H4
The file attribute flags determine the attributes of a file or directory. Any combination of them may be used except one: FILE_ATTRIBUTE_NORMAL, which identifies files with no attributes, can only be used alone.
FILE_ATTRIBUTE_ARCHIVEAn archive file, which almost all files are.
FILE_ATTRIBUTE_COMPRESSEDA compressed file residing in a compressed drive or directory.
FILE_ATTRIBUTE_DIRECTORYA directory instead of a file.
FILE_ATTRIBUTE_HIDDENA hidden file, which is not normally visible to the user.
FILE_ATTRIBUTE_NORMALAn attribute-less file.
FILE_ATTRIBUTE_READONLYA read-only file, which cannot normally be written to or deleted, only read from.
FILE_ATTRIBUTE_SYSTEMA system file, one used exclusively by the operating system.
Used by: GetFileAttributes, SetFileAttributes
Back to the index.


File Dialog Flags

Const OFN_READONLY = &H1
Const OFN_OVERWRITEPROMPT = &H2
Const OFN_HIDEREADONLY = &H4
Const OFN_NOCHANGEDIR = &H8
Const OFN_SHOWHELP = &H10
Const OFN_NOVALIDATE = &H100
Const OFN_ALLOWMULTISELECT = &H200
Const OFN_PATHMUSTEXIST = &H800
Const OFN_FILEMUSTEXIST = &H1000
Const OFN_CREATEPROMPT = &H2000
Const OFN_SHAREAWARE = &H4000
Const OFN_NODEREFERENCELINKS = &H100000
The file dialog constants tell Windows 95 how to render the file dialog box. You can use more than one flag by adding the values, but you cannot use contradictory values (such as both OFN_FILEMUSTEXIST and OFN_CREATEPROMPT) that have opposite functions.
OFN_READONLYIf this is part of .flags after the function call, the user clicked the Open As Read Only box in the Open dialog box (do a .flags AND OFN_READONLY).
OFN_OVERWRITEPROMPTPrompt if a file that already exists is chosen in the Save dialog box.
OFN_HIDEREADONLYHide the read-only check box in the Open dialog box.
OFN_NOCHANGEDIRDon't change the current directory to match the one chosen in the dialog box.
OFN_SHOWHELPShow the Help button in the dialog box (but I don't know how to make it work yet).
OFN_NOVALIDATEDon't check to see if the filename contains invalid characters.
OFN_ALLOWMULTISELECTAllow the user to check multiple files in the Open dialog box.
OFN_PATHMUSTEXISTOnly allow the selection of existing paths.
OFN_FILEMUSTEXISTOnly allow the selection of existing files.
OFN_CREATEPROMPTPrompt if a non-existing file is chosen.
OFN_SHAREAWAREIgnore any sharing violations.
OFN_NODEREFERENCELINKSNormally, if the user chooses a shortcut in the dialog box, the box returns the file it points to. This option has the dialog box return the .lnk or .pif (shortcut file) itself, not what it points to.
Used by: GetOpenFileName, GetSaveFileName (both used through OPENFILENAME)
Back to the index.


Insert After Flags

Const HWND_BOTTOM = 1
Const HWND_NOTOPMOST = -2
Const HWND_TOP = 0
Const HWND_TOPMOST = -1
The Insert After Flags are used by SetWindowPos to determine the window's position in the Z-order. The Z-order basically says which windows are above or below other windows. These constants set the Z-order of the window to a certain value.
HWND_BOTTOMPut the window at the bottom of the Z-order.
HWND_NOTOPMOSTPut the window below all topmost windows and above all nontopmost windows.
HWND_TOPPut the window at the top of the Z-order.
HWND_TOPMOSTMake the window topmost (above all other windows), where it stays even while inactive.
Used by: SetWindowPos
Back to the index.


Platform ID Constants

Const VER_PLATFORM_WIN32s = 0
Const VER_PLATFORM_WIN32_WINDOWS = 1
Const VER_PLATFORM_WIN32_NT = 2
The platform ID constants identify which version of Windows is running. One of these three values is returned in the dwPlatformID member of the OSVERSIONINFO variable using the GetVersionEx function. Obviously, exactly one of these values will be returned, and there's nothing I've found yet to set with one of these values.
VER_PLATFORM_WIN32sWindows 3.x is running, using the Win32s pseudo-32-bit enhancements.
VER_PLATFORM_WIN32_WINDOWSWindows 95 is running.
VER_PLATFORM_WIN32_NTWindows NT is running.
Used by: GetVersionEx (used through OSVERSIONINFO)
Back to the index.


SetWindowPos Flags

Const SWP_FRAMECHANGED = &H20
Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Const SWP_HIDEWINDOW = &H80
Const SWP_NOACTIVATE = &H10
Const SWP_NOCOPYBITS = &H100
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOREDRAW = &H8
Const SWP_NOZORDER = &H4
Const SWP_SHOWWINDOW = &H40
The SetWindowPos Flags give additional information to the SetWindowPos function telling it how to move the window. Most of them either tell the function not to move the window in some way or affect the redrawing of the window. You can use as many of these as you want by Or-ing them together, as long as you do not try to use two opposite flags (like SWP_HIDEWINDOW and SWP_SHOWWINDOW).
SWP_FRAMECHANGED
SWP_DRAWFRAME
Redraw the window fully in its new position, including anything drawn on it.
SWP_HIDEWINDWHide the window. Although it still exists, it does not appear neither on the screen nor on the taskbar.
SWP_NOACTIVATEDo not make the window active after moving it, unless of course it is already the active window.
SWP_NOCOPYBITSDo not redraw anything drawn on the window when it is moved.
SWP_NOMOVEDo not move the window; i.e., ignore the x and y parameters.
SWP_NOSIZEDo not resize the window; i.e., ignore the cx and cy parameters.
SWP_NOREDRAWDo not remove the image of the window in its former position from the screen. In other words, leave behind a ghost image of the window in its old position.
SWP_NOZORDERDo not change the window's position in the Z-order; i.e., ignore the hWndInsertAfter parameter.
SWP_SHOWWINDOWShow the window (must have previously been hidden using SWP_HIDEWINDOW).
Used by: SetWindowPos
Back to the index.


Sound Flags

Const SND_ALIAS = &H10000
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
Const SND_LOOP = &H8
Const SND_NODEFAULT = &H2
Const SND_NOSTOP = &H10
Const SND_NOWAIT = &H2000
Const SND_SYNC = &H0
These constants tell the sndPlaySound function how to play the .wav file. You can use more than one of them by simply adding together the ones you want to use. To use none of them, use 0 as the value.
SND_ALIASPlay the name of a Windows sound (such as SystemStart, Asterisk, etc.)
SND_ASYNCContinue program execution immediately after starting to play the sound.
SND_FILENAMEPlay the specified filename.
SND_NODEFAULTReturn 0 and remain silent if the .wav file is not found.
SND_NOSTOPDon't stop any currently playing sounds.
SND_NOWAITDon't wait if the sound driver is busy.
SND_SYNCWait until the sound is finished playing before continuing execution.
Used by: sndPlaySound
Back to the index.


Home
Paul Kuliniewicz
E-mail: Borg953@aol.com
All material presented on these pages is Copyright © Paul Kuliniewicz, except for other copyrighted material.
http://members.aol.com/Borg953/api/appb.html