HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: superfun_awesome on 2011-04-17 02:49:47

Title: Legality
Post by: superfun_awesome on 2011-04-17 02:49:47
Hi

Just starting out as a component developer.  I was perusing the SDK for some function which I need to use, and I came across this little tidbit here:

Code: [Select]
//! Retrieves main app window. WARNING: this is provided for parent of dialog windows and such only; 
using it for anything else (such as hooking windowproc to alter app behaviors) is absolutely illegal.
HWND get_main_window();


(core_api.h, line 12)

absolutely illegal eh?

Just wondering what the reason for that was, and what it violates in the terms of use.

Thank you.
Title: Legality
Post by: Zao on 2011-04-17 02:59:02
There is no legit reason to subclass the application window, and if you do, you violate a whole lot of invariants of the core and the UI component you're using (as you not necessarily are using Default UI).
If you have needs that require you to subclass the main window, and they cannot be satisfied through the public API, chances are that you should be writing an UI component in the first place, or stop doing ill things.
In the past, there has been components that have tried to augment the main window in improper ways, like hooking to have child windows that track the dimensions of the player window, intercepting messages they shouldn't, and generally causing great instability. The Win32 world is a very fragile place to live, and such components make the job of keeping foobar2000 stable impossible.

As for what it violates in the terms of use, it's about "don't use anything not in the public API".
Title: Legality
Post by: mudlord on 2011-04-17 11:54:45
Oh yeh, if you ever dare to release a component which violates the SDK's license, expect to be banned for eternity from this forum until the issue is fixed.