Thanks for the positive encouragement
I'll attach to this post the code to my example and the supporting resources. The compressed rar file should contain:
(The C++ code
)
Xponce.cpp
(The resource script
)
Resource.rc
(SH-3 build of the example executable
)
Xponce.exe
(10 bitmaps and the program icon
)
________________________________________________________________
For anyone wanting to use the code, I've spent some time making it nicer to alter... I'll explain:
[This is copied from the top part of the code]
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
/*-------------------------------------------------------------------------
Constants for application strings, the caption text, the
classname and the message which is displayed on the window.
-------------------------------------------------------------------------*/
#define APPLICATION_CAPTION "XP -> CE Example"
#define APPLICATION_CLASSNAME "CEWindowClass"
#define APPLICATION_MESSAGE "Hello HPC:Factor :-
)"
/*-------------------------------------------------------------------------
Constants to specify the application width and height in pixels.
-------------------------------------------------------------------------*/
#define APPLICATION_WIDTH 302
#define APPLICATION_HEIGHT 150
/*-----------------------------------------------
Flag to specify if maximizing is allowed.
-----------------------------------------------*/
BOOL MAXIMIZE_ALLOWED = TRUE;
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
For people wanting to use this code, I built the framework to work directly from these constants. Changing the APPLICATION_WIDTH and/or APPLICATION_HEIGHT values to suit your application is literally all that's needed for the window size to change.
Likewise, setting MAXIMIZE_ALLOWED to FALSE will cause the maximize button to be faded out, and maximize functionality to be removed.
Last note, if you're wanting to use this code
(feel free
), presumably you're not going to want the little message in the middle of the window ... all you have to do is remove the drawing of this message from the WM_PAINT case in the window's winproc
(specifically the DrawText
(
) function invocation
).
I hope this helps
/\/\art
(P.S. If you were wondering why the width has been set to 302, it's in account for the small window border which is 1 pixel on each side.
)
Attachments
----------------
Xponce.rar (23KB - 33 downloads)