Login / Register 0 items | $0.00 New @ KVR
User avatar
syntonica
KVRist
 
389 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Thu Apr 05, 2018 9:35 pm Win32 WndProc Messages: Why am I not getting some?

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!
stratum
KVRAF
 
1848 posts since 29 May, 2012

Postby stratum; Thu Apr 05, 2018 10:29 pm Re: Win32 WndProc Messages: Why am I not getting some?

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/library/windows/desktop/ms632645(v=vs.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~
User avatar
syntonica
KVRist
 
389 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Thu Apr 05, 2018 11:15 pm Re: Win32 WndProc Messages: Why am I not getting some?

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.
stratum
KVRAF
 
1848 posts since 29 May, 2012

Postby stratum; Fri Apr 06, 2018 12:39 am Re: Win32 WndProc Messages: Why am I not getting some?

All windows APIs ask for a codepage or locale while creating a font. Some open source rendering libraries may not.
~stratum~
User avatar
syntonica
KVRist
 
389 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Fri Apr 06, 2018 7:24 pm Re: Win32 WndProc Messages: Why am I not getting some?

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....
stratum
KVRAF
 
1848 posts since 29 May, 2012

Postby stratum; Fri Apr 06, 2018 10:10 pm Re: Win32 WndProc Messages: Why am I not getting some?

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/library/windows/desktop/dd535473(v=vs.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~
User avatar
syntonica
KVRist
 
389 posts since 24 Sep, 2014, from Specific Northwest

Postby syntonica; Sat Apr 07, 2018 12:56 am Re: Win32 WndProc Messages: Why am I not getting some?

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!
mystran
KVRAF
 
4927 posts since 11 Feb, 2006, from Helsinki, Finland

Postby mystran; Sat Apr 07, 2018 4:07 am Re: Win32 WndProc Messages: Why am I not getting some?

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?
Image <- plugins | forum

Moderator: Moderators (Main)

Return to DSP and Plug-in Development