Announcement

Collapse
No announcement yet.

about function "WADlg_init(hwndWinamp)" in "wa_dlg.h"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • about function "WADlg_init(hwndWinamp)" in "wa_dlg.h"

    i want to create a windows in General Purpose Plugin,
    but i can't use winamp skin at my windows through function "WADlg_init(hwndWinamp)"
    who can help me?
    thanks!!!!!!!!

    LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
    WADlg_handleDialogMsgs( hwnd, message, wParam, lParam);
    switch (message)
    {
    case WM_DISPLAYCHANGE:
    WADlg_init(plugin.hwndParent);
    return 0;
    case WM_CLOSE:
    ShowWindow(hWnd,SW_HIDE);
    return 0;
    return 0;
    }
    return DefWindowProc(hwnd,message,wParam,lParam);
    }
    int init() {
    WNDCLASS wc;
    memset(&wc,0,sizeof(wc));
    wc.lpfnWndProc = WndProc;
    wc.hInstance = plugin.hDllInstance;
    wc.lpszClassName= PlugInName;

    RegisterClass(&wc);
    hWnd = CreateWindowEx(
    0,
    PlugInName,PlugInName,
    WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX,
    0,0,
    320,240,
    plugin.hwndParent,
    NULL,
    plugin.hDllInstance,
    NULL);
    ShowWindow(hWnd,SW_SHOWNORMAL);
    return 0;
    }

  • #2
    you seem to be having problems with this window thing - i'll try and get an example up for you for tomorrow (hopefully you can wait till then )

    -daz
    WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

    Comment


    • #3
      just a quick reply on this, for the code to compile correctly the source file you are using needs to end in *.cpp (is due to the way the header has been written)

      as for an example i've got something that will have a winamp skin style in a window but it's not using a full winamp window frame at the moment will post once i've done it all (along with all my other bits to do )

      -daz
      WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

      Comment


      • #4
        Daz

        did you ever get the winamp window frame working.. I think its been mentioned elsewhere, but I would really love a General plugin using the new api, with a simple "hello world" in a skinned window.

        kind regards

        G

        Comment


        • #5
          not forgotten i just haven't had as much time as i wanted.
          i got the internal parts of a winamp style window working, it's just the outer frame to do (and i found the correct part in the headers last night).

          i'll try to get it done for tomorrow (may use it myself for some bit's i'm doing...)

          -daz
          WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

          Comment


          • #6
            any chance of it being MFC?

            Comment


            • #7
              it's all pure 'c' at the moment. it's basically a few sendmessage calls at the end of the day. the only mfc bits would be the on_message handlers and things like that for the dialog proceedure which is fairly easy for someone else to convert over to

              -daz
              WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

              Comment


              • #8
                never ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever ever use MFC, always use win32 api... mfc = slow and pooeh compaired to directly using the api
                Wap Server For Winamp 5 ::
                Kill All The Humans :: Blackpool Hotels

                Comment


                • #9
                  Originally posted by DrO
                  you seem to be having problems with this window thing - i'll try and get an example up for you for tomorrow (hopefully you can wait till then )

                  -daz

                  i am back, and very grateful after i see you article.
                  thanks!

                  Comment


                  • #10
                    here it is.

                    it's a 'c' example but read the notes in the source (should be clear) to get an idea of a few things that are needed to be done.

                    any problems then don't hesitate to ask, enjoy

                    -daz
                    Attached Files
                    WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

                    Comment


                    • #11
                      thanks! it run best on winamp 5
                      but i have another question,

                      My Code:
                      if(wa2){
                      // here we attach a dialog into the window
                      // if need by this could been done with CreateWindow(), etc depending
                      // on what you want to do
                      RegisterClass(&wc);
                      HWND hWnd = CreateWindow(
                      PlugInName,
                      PlugInName,
                      WS_POPUP,
                      0, 0, 100, 100,
                      (HWND) NULL,
                      (HMENU) NULL,
                      plugin.hDllInstance,
                      (LPVOID) NULL);

                      ShowWindow(hWnd,SW_SHOWNORMAL);
                      proc = (PROC)SetWindowLong(wa2,GWL_WNDPROC,(LONG)WinampProc);
                      }
                      I create a window , and at Wndproc, i deal with WM_CREATE message
                      switch(msg){
                      case WM_CREATE:
                      WADlg_init(plugin.hwndParent);
                      SetWindowText(GetParent(hwnd),"Project");
                      SetDlgItemText(hwnd,IDC_EDIT, "Lemonsoft");
                      // shows the owner window and this dialog
                      //ShowWindow(hwnd,SW_SHOWNORMAL);
                      ShowWindow(GetParent(hwnd),SW_SHOWNORMAL);
                      .......
                      Background Color changed,
                      but winamp base skin don't display, why?
                      Last edited by Lemonsoft; 5 November 2003, 02:55.

                      Comment


                      • #12
                        it run best on winamp 5
                        i agree on that, using the modern skins does look better for a winamp styled window. glad it's what you were looking for.

                        with your problem, you need to alter the window styles used for the window you are creating. i think you need WS_CHILD and WS_VISIBLE and to change to CreateWindowEx using WS_EX_CONTROLPARENT as the extended window style.

                        i'll check it tonight and post you a new version unless you beat me to it (the part above should be part on the way to things).

                        also as a point of interest for you, it may be an idea to allow the ability to create a normal owner window as i think you had incase winamp is not able to return a valid window to use (such as on versions below 2.9x).

                        -daz
                        WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

                        Comment


                        • #13
                          Bizzy D.

                          I'm not just usign MFC for the sheer fun of it, (in fact I'm preety sure no fun is to be gained at all) but because I need the message pump for my plugin which involves lots of two way serial communication for a remote control.

                          Is there an easier way of doing this that I skipped over? I'm using the CSerial on codeporject at the mo.

                          Dr. O cheers for that, I look forward to butchering your code beyong recognition.

                          Comment


                          • #14
                            Dr. O cheers for that, I look forward to butchering your code beyong recognition.
                            that's what it's there for, if it helps at least one person then that's the main thing i think at the end of the day. also i needed the code myself

                            as for the MFC thing i agree with Bizzy D. about it but i'm sure you can do waht you need without using MFC since at the end of the day it is just a big wrapper for the basic win32 functions (codeproject and codeguru should be able to help)

                            -daz
                            WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog

                            Comment


                            • #15
                              Dr.O sorry this is goign to be a total n00b question.

                              when I add another dialog box (for say a configuration screen) when I actually creat the class and .cpp file in MS visual studio. it will no longer link.

                              I get lots of errors like
                              "gen_test4 error LNK2005: "int __cdecl WADlg_getColor(int)" ([email protected]@[email protected]) already defined in gen_test4.obj"

                              can you help me?

                              Comment

                              Working...
                              X