Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Some std C++ and Windows API level and CMake code to discuss (just presents a Windows window)

23 views
Skip to first unread message

Alf P. Steinbach

unread,
Jun 30, 2023, 5:55:41 PM6/30/23
to
Hi.

I was inspired by Paul N's question about restructuring some Windows
code "to make it look neater", and started coding up some basics.

https://github.com/alf-p-steinbach/winapi-gui-wait/tree/master/source

Reusable stuff is kept to the minimum /required/ to do this properly,
and collected in a little header only library "microlib" (so that's what
it is, the reusable stuff of this app). Much of the standard C++ stuff
is just hoisted from my private code base. But some is new for me and
will make it back into that code base.

The app (just a window with a button that presents a message box) has
modern look and feel, is UTF-8 based, and I work around a Windows bug
where the area outside a modern rounded button presents the parent
window's defined background color (instead of the actual background),
and ditto work-around for a message box being placed in the middle of a
developer's wide screen regardless of window placement far away.

Re C++ aspects I would like some help with the first mentioned
work-around. It's some background erasure functions near the top of the
`main.cpp` file. This works for a solid color as background, but the
design probably sucks for a repeated image as background, because it has
to be offset for painting the button's background. I can't quite see it.

Re CMake, I've never made a CMakeLists.txt file before. So it may be
weird, it may be wrong, it may perhaps only work on /my/ system. Helpful
comments would be great.

I didn't so far get to Paul N's question about a wait action. Because I
got bogged down in Windows API intricacies and now I feel tired of
coding and will read a book and just sit in the sun. Plus I'll read
answers and comments here, if any, before picking this up again. :)

Anyway, enjoy.


- Alf

Richard

unread,
Jul 4, 2023, 7:49:44 PM7/4/23
to
[Please do not mail me a copy of your followup]

"Alf P. Steinbach" <alf.p.s...@gmail.com> spake the secret code
<u7nj0c$2lbvj$1...@dont-email.me> thusly:

>I was inspired by Paul N's question about restructuring some Windows
>code "to make it look neater", and started coding up some basics.

Meh. Just use WinLamb.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Terminals Wiki <http://terminals-wiki.org>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
0 new messages