home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 4
/
BUGCD1997_05.BIN
/
aplic
/
clip4win
/
clip4win.exe
/
C4W30E.HUF
/
SOURCE
/
COLOUR.PRG
< prev
next >
Wrap
Text File
|
1992-10-15
|
1KB
|
49 lines
////////////////////////////
//
// Clip-4-Win colour demo
//
// Copyright (C) 1992 Skelton Software, Kendal Cottage, Hillam, Leeds, UK.
// All Rights Reserved.
//
//
// Compile: colour /n /w
// Link: /se:600 colour winsetup,,,,clip4win.def
//
////////////////////////////
#include "windows.ch"
static hWnd, hInst, hPrevInst, nCmdShow
static cAppName := "Clip-4-Win"
function main()
local ev, nColour, hDC, hBrush
hWnd = WinSetup(cAppName, "Clip-4-Win colour demo")
hInst = _GetInstance()
do while .t.
do while (ev := ChkEvent()) == EVENT_NONE
enddo
do case
case ev == EVENT_REDRAW
SetPos(0, 0)
? ; ? " Press a key to choose a colour (or 'color')..."
case ev == EVENT_KEY
nColour = ChooseColor()
if nColour >= 0 // else user chose cancel/close or hit Esc
hDC = GetDC(hWnd)
hBrush = CreateHatchBrush(HS_DIAGCROSS, nColour)
FillRect(hDC, 100, 100, 500, 300, hBrush)
DeleteObject(hBrush)
ReleaseDC(hWnd, hDC)
endif
endcase
enddo
return 0