|
|
#1 |
|
Junior Member
Join Date: Apr 2001
Posts: 7
|
How to make a window in a plugin??
I'm trying to make a general plugin based on a standalone exe I have already made. The program has one window with 2 buttons on it. Maybe I'm missing something, but when I try to run it, nothing happens. I have all the CreateWindow() code in the init() function. I'm not that familiar with Windows programming (this is actually my first program written in C for Windows. I'm surprised the standalone version actually worked
). So my questions: How do you make a window in a DLL? Do you have to use a window class? Am I totally off and you can only use dialog boxes? Any help would be greatly appreciated.
|
|
|
|
|
|
#2 |
|
Junior Member
|
something like this might work ... havent tested it
code: |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2003
Posts: 12
|
I did try this code and it didn't create a window in Winamp 2.91. There wehe no errors during DLL compiling.
|
|
|
|
|
|
#4 |
|
Junior Member
|
I think i forgot some things,
code: "this_mod" is your winamp vizualisation/plugin module |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Apr 2003
Posts: 12
|
Thanks, now it started to work. Now I only need to learn how to put some GUI-elements in that window. Could you show some URLs? Of course it would be best if I could design window with Visual Studio 6.0 resource editor and use .rc file.
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2003
Posts: 12
|
I'm still having problems with my new window. I'm creating it in plugin's init() and all I get is a window that doesn't paint itself. It just has a copy of screen from place where it was created.
|
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2003
Posts: 12
|
code: I found this piece of code from DSP_example and it works in that dsp-plugin OK. But when I create own dialog in own plugin this piece of code creates dialog inside the Winamp's main window. |
|
|
|
|
|
#8 |
|
Junior Member
|
Have a look at the winamp visualization config procedure, here it creates a dialog outside winamp window.
code: where "IDD_DIALOG1" is the name of your dialog in the resources and "DialogProc" is you callback function for the dialog e.g. code: hMainWnd is also the 'HWND' of the main window of your application. (i.e. the variable you assigned CreateWindowEx(..) to earlier) see if that helps... |
|
|
|
|
|
#9 |
|
Junior Member
|
oh by the way you can probably stop the dialog from apperaing inside the winamp window using your code you submitted earlier, and change it a bit.
it should work if you use 'hMainWnd' instead of 'plugin.hwndParent' then it should create the dialog inside your window instead of the winamp one if thats what you want... |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Apr 2003
Posts: 12
|
Now I have completely working dialog. I did it a littlebit different than your example, but thanks anyway.
Now I have a different problem. Normaly I have build all my Windows applicaiton using Borland's C++ builder. Borland differens much from MFC and now I would like to know is there any better way to add text in Editbox. code: This is how I can write text to Editbox, but it will replace all text that is already in Editbox. (of cource I could use one variable to store text in Editbox using SetDlgItemText but it isn't a really good way to do it.) In Borland's C++ builder I simply can use following method. code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|