Windows 98 API Programming for Dummies

Overview

Put the programming power of Microsoft's Windows 98 to use with Windows 98 API Programming For Dummies Quick Reference, the quick and easy way to mastering the core API functions for Windows 98. From the basics of the Windows interface to advanced API functions for graphics, character and string sets, memory management, Registry and system info, and creating multithreaded programs, Windows 98 API Programming For Dummies Quick Reference delivers what you need, when you need it.

...

See more details below
Available through our Marketplace sellers.
Other sellers (Other Format)
  • All (3) from $1.99   
  • Used (3) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$1.99
Seller since 2006

Feedback rating:

(60404)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

Good
Shows some signs of wear, and may have some markings on the inside. 100% Money Back Guarantee. Shipped to over one million happy customers. Your purchase benefits world literacy!

Ships from: Mishawaka, IN

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2006

Feedback rating:

(60404)

Condition: Very Good
Great condition for a used book! Minimal wear. 100% Money Back Guarantee. Shipped to over one million happy customers. Your purchase benefits world literacy!

Ships from: Mishawaka, IN

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$19.05
Seller since 2010

Feedback rating:

(21)

Condition: Good
06/02/1998 Paperback Good **SHIPPED FROM UK** We believe you will be completely satisfied with our quick and reliable service. All orders are dispatched as swiftly as possible! ... Buy with confidence! *****PLEASE NOTE: This item is shipping from an authorized seller in Europe. In the event that a return is necessary, you will be able to return your item within the US. To learn more about our European sellers and policies see the BookQuest FAQ section***** Read more Show Less

Ships from: London, United Kingdom

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

Put the programming power of Microsoft's Windows 98 to use with Windows 98 API Programming For Dummies Quick Reference, the quick and easy way to mastering the core API functions for Windows 98. From the basics of the Windows interface to advanced API functions for graphics, character and string sets, memory management, Registry and system info, and creating multithreaded programs, Windows 98 API Programming For Dummies Quick Reference delivers what you need, when you need it.

Practical, timesaving tips, organized in easy-to-find alphabetical listings, mean that you don't have to waste hours thumbing through thick users' manuals to get clear-cut answers to all your API questions. Instead, keep a copy of this slim reference book close at hand for quick look-ups on the entire array of API functions, with syntax examples and comments on each function parameter. And when it's time to write your next Windows 98 application, you'll find this little guide simply indispensable.

Read More Show Less

Product Details

  • ISBN-13: 9780764503030
  • Publisher: Wiley, John & Sons, Incorporated
  • Publication date: 6/1/1998
  • Series: For Dummies Series
  • Format: Spiral Bound
  • Edition number: 1
  • Pages: 194
  • Product dimensions: 5.75 (w) x 8.42 (h) x 0.61 (d)

Table of Contents

Introduction

How This Book Is Organized
Conventions Used in This Book
The Cast of Icons
Part I: Getting to Know Windows 98 APIs
Basics of Windows 98 APIs
A Simple Program Using Windows APIs
Part II: The Windows Interface
Dialog Boxes
CheckDlgButton
CheckRadioButton
CreateDialog
CreateDialogIndirect
CreateDialogIndirectParam
CreateDialogParam
DefDlgProc
DialogBox
DlgDirList
DlgDirSelectEx
EndDialog
GetDialogBaseUnits
GetDlgCtrlID
GetDlgItem
GetDlgItemInt
GetDlgItemText
GetNextDlgGroupItem
GetNextDlgTabItem
IsDialogMessage
IsDlgButtonChecked
MessageBeep
MessageBox
SendDlgItemMessage
SetDlgItemInt
SetDlgItemText
Menus
CheckMenuItem
CheckMenuRadioItem
CopyAcceleratorTable
CreateAcceleratorTable
CreateMenu
CreatePopupMenu
DeleteMenu
DestroyMenu
DrawMenuBar
EnableMenuItem
GetMenu
GetMenuItemCount
GetMenuItemID
GetMenuState
GetMenuString
GetSubMenu
GetSystemMenu
InsertMenuItem
LoadAccelerators
LoadMenu
RemoveMenu
SetMenu
Message Processing
CallWindowProc
DefWindowProc
DispatchMessage
GetMessage
InSendMessageEx
PostMessage
PostQuitMessage
TranslateMessage
WinMain
Multiple Document Interface (MDI)
ArrangeIconicWindows
CascadeWindows
CreateMDIWindow
DefMDIChildProc
TileWindows
Windows
CloseWindow
CreateWindow
DestroyWindow
Windows-Support Functions
AnyPopup
BringWindowToTop
EnableWindow
FindWindow
GetActiveWindow
GetDesktopWindow
GetFocus
GetParent
GetTopWindow
GetWindow
IsChild
IsWindowEnabled
IsWindowVisible
IsZoomed
SetActiveWindow
SetFocus
SetForegroundWindow
SetParent
SetWindowText
ShowWindow
Part III: Strings and Character Sets
CharLower
CharLowerBuff
CharNext
CharPrev
CharUpper
CharUpperBuff
CompareString
GetACP
GetDateFormat
GetLocaleInfo
GetTimeFormat
IsCharAlpha
IsCharAlphaNumeric
IsCharLower
IsCharUpper
lstrcat
lstrcmp
lstrcmpi
lstrcpy
lstrlen
Part IV: Graphics
Bitmaps
CreateBitmap
GetStretchBltMode
LoadBitmap
SetStretchBltMode
StretchBlt
Graphics Device Interface
AddFontResource
BitBlt
CreateDC
CreateIC
DeleteDC
GetDC
GetDeviceCaps
GetFontData
GetSystemMetrics
GetWindowDC
ReleaseDC
RemoveFontResource
RestoreDC
SaveDC
WindowFromDC
Icons
CopyIcon
CreateIcon
CreateIconFromResource
DestroyIcon
DrawIcon
GetIconInfo
LoadIcon
LoadImage
Metafiles
CopyEnhMetaFile
CreateEnhMetaFile
DeleteEnhMetaFile
EnumEnhMetaFile
GetEnhMetaFile
GetEnhMetaFileDescription
GetEnhMetaFileHeader
PlayEnhMetaFile
PlayEnhMetaFileRecord
Painting, Drawing, and Still Image
AbortPath
Arc
BeginPaint
BeginPath
Chord
CombineRgn
CopyRect
CreateBrushIndirect
CreateEllipticRgn
CreateEllipticRgnIndirect
CreateHatchBrush
CreatePatternBrush
CreatePen
CreatePenIndirect
CreateRectRgn
CreateRectRgnIndirect
CreateRoundRectRgn
CreateSolidBrush
DeleteObject
DrawCaption
DrawEdge
DrawText
Ellipse
EndPaint
EnumObjects
EqualRect
EqualRgn
FillRect
FillRgn
FloodFill
FrameRect
FrameRgn
GetArcDirection
GetBkColor
GetBkMode
GetClipRgn
GetObject
GetPolyFillMode
GetRegionData
GetStockObject
GetSystemPaletteEntries
InflateRect
InvalidateRect
InvalidateRgn
IsRectEmpty
LineTo
MoveToEx
PaintRgn
PathToRegion
Pie
Polygon
Polyline
PtInRect
PtInRegion
Rectangle
RectInRegion
RedrawWindow
SetArcDirection
SetBkColor
SetBkMode
SetPolyFillMode
SetRect
SetRectEmpty
SetRectRgn
StiCreateInstance
SubtractRect
UnionRect
UpdateWindow
ValidateRect
ValidateRgn
Part V: Memory Management and Resource Allocation
Memory Management
GlobalAlloc
GlobalDiscard
GlobalFlags
GlobalFree
GlobalLock
GlobalMemoryStatus
GlobalUnlock
HeapAlloc
HeapCreate
HeapDestroy
HeapFree
HeapSize
LocalAlloc
LocalDiscard
LocalFlags
LocalFree
LocalLock
LocalSize
LocalUnlock
VirtualAlloc
VirtualFree
VirtualLock
VirtualProtect
VirtualUnlock
Resources
FindResource
LoadResource
LoadString
LockResource
SizeofResource
Part VI: Input and Output
File Input and Output
CloseHandle
CopyFile
CreateDirectory
CreateFile
DeleteFile
FindClose
FindFirstFile
FindNextFile
FlushFileBuffers
GetFileAttributes
GetFileInformationByHandle
GetFileSize
GetFileTime
GetFileType
GetFullPathName
GetStdHandle
LockFile
MoveFile
ReadFile
RemoveDirectory
SearchPath
SetEndOfFile
SetFileAttributes
SetFileTime
UnlockFile
WriteFile
Printing
AbortDoc
EndDoc
EndDocPrinter
EndPage
GetTextAlign
GetTextColor
GetTextFace
GetTextMetrics
ResetDC
SetTextAlign
SetTextColor
StartDocPrinter
User Input
ClientToScreen
ClipCursor
CreateCursor
DestroyCursor
GetCapture
GetCaretPos
GetCursor
GetCursorPos
GetDoubleClickTime
GetInputState
GetKeyboardLayout
GetKeyState
MapVirtualKey
ReleaseCapture
ScreenToClient
SetCapture
SetCursor
SetCursorPos
SetDoubleClickTime
ShowCursor
SwapMouseButton
UnloadKeyboardLayout
Part VII: System Information and the Windows Registry
System Information
EnumDisplayMonitors
GetCommandLine
GetComputerName
GetCurrentDirectory
GetDiskFreeSpaceEx
GetEnvironmentVariable
GetLogicalDrives
GetMonitorInfo
GetSystemDirectory
GetSystemInfo
GetSystemTime
GetTimeZoneInformation
GetWindowsDirectory
MonitorFromPoint
MonitorFromRect
MonitorFromWindow
SetComputerName
SetCurrentDirectory
SetEnvironmentVariable
SetLocalTime
SetSystemTime
SetTimeZoneInformation
Windows Registry
RegCloseKey
RegCreateKey
RegDeleteKey
RegDeleteValue
RegEnumKeyEx
RegEnumValue
RegFlushKey
RegLoadKey
RegReplaceKey
RegRestoreKey
RegSaveKey
RegUnLoadKey
Part VIII: Timers, Processes, and Threads
Processes and Threads
CreateEvent
CreateMutex
CreateProcess
CreateSemaphore
CreateThread
DeleteCriticalSection
EnterCriticalSection
ExitProcess
ExitThread
GetCurrentProcess
GetCurrentProcessId
GetCurrentThread
GetCurrentThreadId
GetExitCodeProcess
GetExitCodeThread
GetPriorityClass
GetProcessHeap
GetThreadContext
GetThreadPriority
InitializeCriticalSection
LeaveCriticalSection
OpenEvent
OpenMutex
OpenProcess
OpenSemaphore
ReleaseMutex
ReleaseSemaphore
ResetEvent
ResumeThread
SetEvent
SetPriorityClass
SetThreadPriority
Sleep
SuspendThread
WriteProcessMemory
Timers
GetTickCount
KillTimer
SetTimer

Glossary

Index

Book Registration Information

Read More Show Less

First Chapter

Part I
Getting to Know Windows 98 APIs

This part gives you a brief reminder of the basics of using the API functions and offers you a simple demonstration to show the main parts of a Windows application created using the API functions and a C compiler.

In this part...

  • Basics of Windows 98 API
  • A simple program using the Windows APIs

Basics of Windows 98 APIs

The Windows APIs are primarily oriented toward C compilers (and C++ compilers that can compile C source code). A Windows program uses C source code that contains the API function calls and the data structures (which are not included in this book due to limited space) used to define various objects.

C++ programmers encapsulate the API functions in classes to allow better organization of the source code. The Microsoft Foundation Classes (MFC) are an example of classes that encapsulate the API functions and any supporting variables.

A typical project has the following files:

  • The .H header files that contain the definitions of constants, function prototypes, and classes
  • The .RC resource files that contain the definitions of various resources, such as strings, menus, dialog boxes, and accelerator keys
  • The .C or .CPP files that contain the functions that drive the Windows application
  • Other resource files that store bitmaps, icons, and other graphics objects

A Simple Program Using Windows APIs

Take a look at a very simple Windows program that displays controls and a dialog box. The figure shows a sample session with the APIDemo program. This program has the following menus:

  • The File menu has the Exit command that helps you exit the application.
  • The Special! menu creates and displays a static text, edit box, and button controls.
  • The Help menu has the About API Demo command. This command invokes a modal dialog box that has a smiley face icon, the text Have a nice day!, and the OK button.

Here is the source code for the APIDEMO.H header file:

#define ID_EXIT    100 
#define ID_SPECIAL 101
#define ID_ABOUT 102

#define IDC_TEXT_HI 1001
#define IDC_EDIT_BOX 1002
#define IDC_BTN_CLICKME 1003

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);

The header file declares the constants for the menu Special! and the menu commands Exit and About API Demo. Windows declares the IDs for the command menus, such as File and Help, in the header file WINDOWS.H. The header file also declares the ID for the static text, edit box, and button controls. The last two source code lines declare the prototypes for the WndProc() and About() functions. These functions are discussed later in this part.

Here is the source code for the APIDEMO.RC resource file:

#include "Windows.h" 
#include "APIDemo.h"

APIDEMO ICON DISCARDABLE "SMILE.ICO"

APIDEMO MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", ID_EXIT
END
MENUITEM "Special!", ID_SPECIAL
POPUP "&Help"
BEGIN
MENUITEM "&About API Demo...",ID_ABOUT
END
END

ABOUTDLG DIALOG 30, 20, 180, 50
STYLE DS_MODALFRAME | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
CAPTION "About API Demo"
FONT 12, "MS Sans Serif"
{
CONTROL "APIDemo", -1, "STATIC", SS_ICON |
WS_CHILD | WS_VISIBLE, 4, 3, 15, 15
CONTROL "Have a nice day!", -1, "STATIC",
SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP,
40, 5, 100, 10
CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON |
WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 65, 30, 50, 15
}

This resource file declares the following resources:

  • The smiley face icon stored in the file SMILE.ICO.
  • The APIDEMO menu resource. This resource declares the menus and their commands. Notice that the menu Special! and the menu commands use the IDs declared in the header file.
  • The ABOUTDLG dialog box resource. This resource declares the icon, static text, and OK button.

Here is the source code for the APIDEMO.C file:

#include <windows.h>   
#include "APIDemo.h"

HINSTANCE hInst;
LPCTSTR lpszAppName = "APIDemo";
LPCTSTR lpszTitle = "API Demo";

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
MSG message;
HWND hWnd;
WNDCLASSEX winClassEx;

// Register the window class for the main
// application
winClassEx.style = CS_HREDRAW |
CS_VREDRAW;
winClassEx.lpfnWndProc = (WNDPROC)WndProc;
winClassEx.cbClsExtra = 0;
winClassEx.cbWndExtra = 0;
winClassEx.hInstance = hInstance;
winClassEx.hIcon = LoadIcon(hInstance,
lpszAppName);
winClassEx.hCursor = LoadCursor(NULL,
IDC_ARROW);
winClassEx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
winClassEx.lpszMenuName = lpszAppName;
winClassEx.lpszClassName = lpszAppName;

winClassEx.cbSize = sizeof(WNDCLASSEX);
winClassEx.hIconSm = LoadImage(winClassEx.hInstance,
winClassEx.lpszClassName,
IMAGE_ICON, 16, 16,
LR_DEFAULTCOLOR );

if (!RegisterClassEx(&winClassEx))
return(FALSE);

hInst = hInstance;

// Create the main application's window
hWnd = CreateWindow(lpszAppName, lpszTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0,
CW_USEDEFAULT, 0,
NULL, NULL, hInstance,
NULL);

if (!hWnd)
return(FALSE);

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

// Handle message queue
while(GetMessage(&message, NULL, 0, 0))
{
TranslateMessage(&message);
DispatchMessage(&message);
}

return(message.wParam);
}


LRESULT CALLBACK WndProc(HWND hWnd, UINT umessage,
WPARAM wParam, LPARAM lParam)
{
static HWND hTextHi = NULL;
static HWND hEditBox = NULL;
static HWND hBtnClickMe = NULL;

switch (umessage) {
case WM_COMMAND :
switch(LOWORD(wParam)) {
case ID_SPECIAL:
hTextHi = CreateWindow("STATIC", "Name:",
WS_CHILD | WS_VISIBLE |
SS_LEFT, 10, 10, 50, 15,
hWnd, (HMENU)IDC_TEXT_HI,
hInst, NULL );

hEditBox = CreateWindow("EDIT", "John",
WS_CHILD | WS_VISIBLE |
ES_LEFT | WS_BORDER,
65, 10, 100, 20,
hWnd, (HMENU)IDC_EDIT_BOX,
hInst, NULL );

hBtnClickMe = CreateWindow("BUTTON",
"Click Me",
WS_CHILD | WS_VISIBLE |
BS_PUSHBUTTON,
65, 50, 100, 35,
hWnd, (HMENU)IDC_BTN_CLICKME,
hInst, NULL );
break;

case ID_ABOUT :
DialogBox(hInst, "AboutDlg", hWnd,
(DLGPROC)About);
break;

case ID_EXIT:
DestroyWindow(hWnd);
break;
}
break;

case WM_DESTROY:
PostQuitMessage(0);
break;

default:
return(DefWindowProc(hWnd, umessage,
wParam, lParam));
}

return(0L);
}


LRESULT CALLBACK About(HWND hDlg,UINT message,
WPARAM wParam,LPARAM lParam)
{
switch (message) {
case WM_INITDIALOG:
return (TRUE);

case WM_COMMAND:
if (LOWORD(wParam) == IDOK ||
LOWORD(wParam) == IDCANCEL) {
EndDialog(hDlg, TRUE);
return (TRUE);
}
break;
}

return (FALSE);
}

The .C source code file includes the files WINDOWS.H and APIDEMO.H and declares the following global variables:

  • The variable hInst is the handle for the application instance.
  • The variable lpszAppName stores the name of the application.
  • The variable lpszAppTitle stores the title of the application. This title appears in the title bar of the application's window.

The function WinMain() is the starting point for executing the Windows application. This application declares the following local variables:

  • The MSG-type variable message stores Windows messages.
  • The HWND-type variable hWnd stores a window handle.
  • The WNDCLASSEX-type variable winClassEx stores the window class information.

The function WinMain() performs the following tasks:

  • Registers the window class by assigning values to various members of the structured variable winClassEx. Registering a window class lets your application know that the window class exists so that it can be used.
  • Causes the application to exit if the call to the function RegisterClassEx() returns FALSE.
  • Copies the value of the parameter hInstance to the local variable hInst.
  • Creates the main window of the application. This task invokes the API function CreateWindow(). This task stores the handle of the created window in the variable hWnd.
  • Exits, returning FALSE if the variable hWnd is NULL.
  • Displays the window by invoking the API functions ShowWindow() and UpdateWindow().
  • Generates messages from input by the user through the keyboard, mouse, and a whole host of other input devices. These messages are handled using a while loop and the variable message. The while condition uses the API function GetMessage() to get the next message. The loop statements invoke the API functions TranslateMessage() and DispatchMessage(). The latter function sends the message to the function WndProc.
  • Returns the value of member wParam in the variable message.

The function WndProc() handles the messages sent by WinMain(). Messages are generated by the use of input devices, such as a keyboard, mouse, pen device and so on. WndProc() performs the following tasks:

  • Declares the variables hTextHi, hEditBox, and hBtnClickMe to handle the static text, edit box, and button controls, respectively.
  • Uses nested switch statements to process the commands. These statements handle the ID_SPECIAL menu command and cause the program to create and display the static text, edit box, and button controls. The source code uses the API function CreateWindow() to create each control and assigns the result of the function call to the corresponding variable. The switch statements also handle the About API Demo command by creating a dialog box using the API function DialogBox(). In addition, the switch statements handle the Exit command and WM_MDESTROY message by calling the API functions DestroyWindow() and PostQuitMessage(). The default clause contains a call to function DefWindowProc (the default message handler).

The function About() manages the dialog box by performing the following tasks using a switch statement:

  • Yields TRUE for the dialog box initializing message WM_INITDIALOG.
  • Invokes the API function EndDialog() for the WM_COMMAND with the parameters IDOK and IDCANCEL and then returns TRUE.
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)