WndProc messages in plugin (1 Viewer)

Shukuyen

Community Plugin Dev
  • Premium Supporter
  • May 8, 2008
    557
    300
    Lake of Constance
    Home Country
    Germany Germany
    Hi,

    I am trying to develop a plugin but ran into some problems. I want to listen to events dispatched by windows via the windows message queue. Normally in WindowsForms applications this could be done by overriding the WndProc function. As the plugin is a DLL my class is not derived from System.Windows.Forms.Form therefor I don't have a WndProc function to override.

    I tried to just add a class derived from Form, but the message queue won't be available until I show the form. As you know, that is not possible.

    Does anyone here know another way to get the windows messages in a MediaPortal plugin?
    I stumbled over the class NativeWindow, but it needs a windowId to work - same problem as before :-/

    Thanks,
    Shukuyen.
     

    RealSlimShady

    New Member
    March 15, 2011
    1
    0
    Hi,

    has anyone found solution for this problem yet?

    I am writing a process plugin with this USB HID component and I have stumbled on to the same problem...
    Response is received through WndProc, which is not used by Mediaportal forms.


    Rgds,
    RSS
     

    kro

    Portal Member
    April 28, 2009
    8
    0
    Home Country
    Canada Canada
    Just create a dummy form. and in your initialization do something like this:

    myForm = new Form1();
    Application.Run(myForm); //This will create the message pump.
     

    Users who are viewing this thread

    Top Bottom