- First compile the resource file.
set root=%CD%
cd resources
rc.exe /V resource.rc
cd %root%
- Now compile the program with resource file.
cl.exe /EHsc /DUNICODE /Zi colorWindow.cpp /link resources\resource.res user32.lib kernel32.lib gdi32.lib
- Press
Esc
key to quit. - Press
r
key for red color background. - Press
g
key for green color background. - Press
b
key for blue color background. - Press
c
key for cyan color background. - Press
m
key for magenta color background. - Press
y
key for yellow color background. - Press
k
key for black color background. - Press
w
key for white color background. - Any other key will give error "No Color Assigned"