Win32 WndProc Messages: Why am I not getting some?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I've been working on the Windows version of my VST and it all looks lovely except:

I have my child window which is attached to parent given by the host.

1. I have to force focus to be able to catch any key strokes. Mousing works fine. Why do I have to fight over the focus?

2. Redrawing and resizing work perfectly, except I seem to get no message when the plugin window is bought up from minimization. How do I regster to be told? And will this help with #1?

Other than that, the rest is cosmetics. I used GDI, so my round knobs are jaggy. I guess I will need to redo as GDI+?

And i seem to be stuck in some random code page for characters tht has no copyright symbol. How do I change that and get some REAL extended ASCII? (I'm being lazy here as I've been Google-fu-ing the last two days and I'm plum tuckered...)

Finally, the Wingdings here appear to have no Zots... Right now, I have International Symbol stickwomen... :P

Considering I still have no clue what I'm doing and I'm pining for my Mac... :cry:

Thanks!
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

1. No idea. Probably because many plugins and even hosts are written without paying attention to how this was supposed to be done properly.
2. The documentation says you should be receiving WM_SHOWWINDOW (https://msdn.microsoft.com/en-us/librar ... s.85).aspx ) I haven't used these daily for about more than 15 years, so, I don't know if it actually works as specified.
3. While you create a font, you should be able to specify a code page.
~stratum~

Post

Thanks for the reply.

1. I've tried a couple of hosts, same issue. On the Mac, the focus starts on the child and is passed up the chain automatically. I thought the same would apply here.

2. I tried WM_SHOWWINDOW. No joy... I'm wondering if I did my CreateWindow properly, but it seems to correspond with the other examples of child windows I've seen. Maybe I'll have to dive into iPlug to see how he did it.

3. I'll look into that. I don't recall a choice for it, but I may have glossed over it in my rampant copying and pasting.
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

All windows APIs ask for a codepage or locale while creating a font. Some open source rendering libraries may not.
~stratum~

Post

You were right about the code pages. I blew right by that without realizing.

In regards to restoring the window, the only message received is WM_NCPAINT (to repaint the frame), so I just piggybacked on that.

Basically, I'm in Beta on Windows now! w00t! The only issue I have is I need anti-aliased circles, so I'm off to study GDI....
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

In the days GDI was designed display resolutions were very low. It can't really make nice antialiased graphics. While you could use Direct2D (https://msdn.microsoft.com/en-us/librar ... s.85).aspx) be sure to check whether it works with all the hosts you would care about. Where is also a library called GDIplus and it's a bit slow. Another alternative is https://cairographics.org/ and it can also work on Apple.
~stratum~

Post

Oops! I meant GDI+. Unfortunately, it does not seem to do a filled arc, so I would have to do them as filled polygons with tons of points. Another choice would be to use GDI and draw to a 4x buffer, antialias, reduce and blit, but that's probably too much work for so little reward, especially at 60fps. I'm avoiding using images, so that's right out.

My executable is ~400-500k, depending upon platform and bittedness. Cairo runtime library is far, far larger than that. It would be overkill.

I still have my OpenGL version to try out on Windows. Maybe it looks better. The GDI version still looks better than the Mac OGL version though!
I started on Logic 5 with a PowerBook G4 550Mhz. I now have a MacBook Air M1 and it's ~165x faster! So, why is my music not proportionally better? :(

Post

syntonica wrote: In regards to restoring the window, the only message received is WM_NCPAINT (to repaint the frame), so I just piggybacked on that.
Sanity check: are you passing all messages that you don't explicitly handle (and you probably shouldn't explicitly handle any WM_NCxxx messages before you get things working) to DefWindowProc?

Post Reply

Return to “DSP and Plugin Development”