Help - Search - Members - Calendar
Full Version: main_thread_callback
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
n0obie4life
Hi,

Just wondering if that can be used for window callbacks? Like the following:

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

If it can be used, how do I do it? Or if it can't, do I create a window and wait for the callback?
foosion
The sole purpose of main_thread_callback is to allow you to run some code in the context of the main thread in response to something in a background thread. You only need that if you have no window that would be appropriate to use with PostMessage.

What exactly are you trying to do?
n0obie4life
Skype's Plugin API does a callback to the window handle you specify it to. This is so that you can send stuff to it...like the personal message feature in Skype smile.gif.

Trying to do that..the only way I see so far is to create a window and ask skype to reply to that window handle. Just wondering if I can use main_thread_callback for this purpose instead of creating a window.

Just a quick example from some code from Google: http://www.nah6.com/~itsme/cvs-xdadevtools...skypeapilog.cpp

I'm still learning c++ and playing around with it smile.gif~
Yirkha
QUOTE(n0obie4life @ Dec 11 2007, 13:51) *
Trying to do that..the only way I see so far is to create a window and ask skype to reply to that window handle. Just wondering if I can use main_thread_callback for this purpose instead of creating a window.


No, you can't. I'm afraid that because it needs a window handle, you won't be able to use an internal function of Foobar2000 and you will have to create a Windows window as anyone else :(


Moderation: removed unnecessary fullquote
n0obie4life
Ah thanks smile.gif~

Moderation: removed unnecessary fullquote
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.