MFC: How to resize a control with only SendDlgItemMessage (ie. without MoveWindow)

T

Theo Appelboer

Is it possible to change the size of a Windows object (in this case a
PictureBox) without calling MoveWindow?

I'm writing a plugin for Winamp, in which I want to display a smooth
bar that displays a continuously changing output value.

In this Winamp plugin I cannot use the SendMessage command because it
causes lockups with Winamp. I _can_ use SendDlgItemMessage.

The following code does the job:
MoveWindow(GetDlgItem(pitch_control_hwnd, IDC_BMP), 500, 400, out_val, 10, FALSE);

Unfortunately, MoveWindow uses SendMessage commands internally, so I
get lockups.

How can I change the size without getting any SendMessage calls?



Notes: I know I can use a ProgressBar for this, but in WinXP, they are
not smooth anymore, but drawn with blocks that are too big.

Any other ideas to display a (smooth) bar on the screen with a
changing size are also welcome...

Regards,

Theo
----
 
P

Phlip

Theo said:
Is it possible to change the size of a Windows object (in this case a
PictureBox) without calling MoveWindow?

I'm writing a plugin for Winamp, in which I want to display a smooth
bar that displays a continuously changing output value.

Try a Progress Bar control. If that doesn't work, then override WM_PAINT.
Don't use MoveWindow for a lowly animation effect. Paint the animation into
the window.

But you will get much better help on a newsgroup that covers the Windows
SDK. This group discusses the raw C++ language itself.
 
A

Alf P. Steinbach

* Phlip:
Try a Progress Bar control. If that doesn't work, then override WM_PAINT.
Don't use MoveWindow for a lowly animation effect. Paint the animation into
the window.

Please don't help change this into a Windows programming group.

But you will get much better help on a newsgroup that covers the Windows
SDK. This group discusses the raw C++ language itself.

That's an extreme position, an exaggeration, useful only to get the
point across. But now you demonstrate that the point has eluded you
completely. Even the exaggeration doesn't help: you reflect it back to
someone else, here Theo, without having understood anything.

Perhaps instead of an exaggeration, a limited but clear rule: in this
group do /not/ discuss how to use the Windows API, MFC, or the like.

No, purely Linux-related questions /or answers/ aren't OK, either.
 
P

Phlip

Kai-Uwe Bux said:
I don't know; but more important, he is right.

You all read and reviewed my post "how to bounce a post". I have posted it
here many times, and nobody has complained about the line item "if you
can't help, don't bounce".

If you don't want to reply to that post, then don't do the "passive
aggressive" thing by whining about this post.

A bounce post should not just say, "your post is off topic go away". Tell
newbies that posting to the best newsgroup will help them get the best
answer.

The person who started this thread will not post off-topic here again, and
will very soon learn how to do their progress bar correctly.
 
G

Gavin Deane

Phlip said:
A bounce post should not just say, "your post is off topic go away". Tell
newbies that posting to the best newsgroup will help them get the best
answer.

Why will posting in the best newsgroup get them the best answer? Two
reasons: firstly, it's the most likely place to find someone who knows
the answer; secondly, the most topical group will provide the highest
quality peer-review.

I don't think anyone objects to you telling the OP that going to a
different group will be better for them, but you also posted an
off-topic answer to the question and that's completely different.
Unlike answers in a topical group, your off-topic answer won't be
peer-reviewed. If you get it wrong, the OP will never know. At best
you've given the OP nothing more than a topical group will. At worst,
you've given them misinformation that nobody will correct.

So the OP is better off if you don't give off-topic answers. What about
the rest of the forum? People read your message only to discover it's
off-topic and wasting bandwidth. There's a long term risk of potential
posters getting the impression that off-topic questions will get
answered here. The more you encourage off-topic questions, the more you
help to lower the signal to noise ratio. To try and protect against
that long term risk, an otherwise unnecessary thread springs up solely
made up of people telling you to stop it.

So: no benefit, potential harm - don't do it.

Gavin Deane
 
V

Victor Bazarov

Gavin said:
[..]
So the OP is better off if you don't give off-topic answers. What
about the rest of the forum? People read your message only to
discover it's off-topic and wasting bandwidth. [..]

I don't any more. I killfiled him. Enough's enough.

V
 
D

Default User

Phlip said:
You all read and reviewed my post "how to bounce a post". I have
posted it here many times, and nobody has complained about the line
item "if you can't help, don't bounce".

You know, just because you post something doesn't mean we have to
follow it. I happen to think your ideas are pretty bad for the most
part, I just don't feel like arguing them out. I just ignore them.




Brian
 
J

JustBoo

Are you in a bad mood?

After the "Pete Becker Incident" he's waited to spring it on someone
else. Just human nature, we know which way it all rolls... right. Btw,
did anyone else notice just after the tiff, suddenly Pete's .sig
changed. Now he's consultant.

I now wait for the "Indignation Phase." Hold on, I have to get me
popcorn. Spare me the "it's none of your business" crap. If you post
your life on usenet, it's public and common knowledge. (The reader can
interpret what common means.)

The Bible tells us to love our neighbors, and also to love
our enemies; probably because they are generally the same
people.
 
P

Phlip

Default said:
You know, just because you post something doesn't mean we have to
follow it. I happen to think your ideas are pretty bad for the most
part, I just don't feel like arguing them out. I just ignore them.

Feel free to ask about any of them. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top