November 1998
Intermediate to advanced
1520 pages
37h 53m
English
The final program in this chapter is something I alluded to in Chapter 5. It’s the only good use I’ve found for the GetPixel function.
WHATCLR (shown in Example 8-5) displays the RGB color of the pixel currently under the hot point of the mouse cursor.
Example 8-5. The WHATCLR program.
WHATCLR.C /*------------------------------------------ WHATCLR.C -- Displays Color Under Cursor (c) Charles Petzold, 1998 ------------------------------------------*/ #include <windows.h> #define ID_TIMER 1 void FindWindowSize (int *, int *) ; LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName[] = TEXT ("WhatClr") ...Read now
Unlock full access