Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / C++

WinAmp DDE

Rate me:
Please Sign up or sign in to vote.
3.15/5 (9 votes)
28 May 200510 min read 56.8K   1.4K   14  
Learn how to setup a DDE server, export function names through pragmas, create and use dialogs without MFC, override language operators, bypass a window's WndProc function, and last but not the least, create a general WinAmp plugin.
#ifndef __WINAMP_DDE_H__
#	define __WINAMP_DDE_H__

//
//  The next define is a little bit tricky and potentially
//  dangerous: it redefines a language operator, a thing
//  I do not suggest to do, if you don't know what you're
//  doing.
//
//  This allows us to jump between the code with no checks
//  and stupid warnings and errors that won't let us compile
//  the stuff. Now: although that is needed to avoid strange
//  errors, it's also true that if you know what you are
//  doing, this can save you some time. Just watch out your
//  ass, and if you're not a guru, I suggest you to comment
//  the line out and do some modifies to the sources, because
//  in case of errors, a define like this can REALLY make you
//  lose a LOT of time while debugging...
//
#	define goto __asm jmp

#	include <ddeml.h>

	LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
	BOOL CALLBACK ConfigProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
	HDDEDATA CALLBACK DdeCallback(UINT uType, UINT uFmt, HCONV hconv, HSZ hszTopic, HSZ hszItem, HDDEDATA hdata, DWORD dwData1, DWORD dwData2);
	void config();
	void quit();
	int init();
	void config_write();
	void config_read();

	HWND hwnd_winamp	 = NULL;
	char *ini_file		 = NULL;
	WNDPROC lpWndProcOld = NULL;
	DWORD idInst = 0;
	HSZ DDEServerName;
	HSZ DDETopicEvaluate;

#	define ServerName		"WinAmp"
#	define EvaluateName		"EVALUATE"

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Italy Italy

When he was 2 years old some friends of his mother made him play with arcade machines, and was almost clear what his path would have been. When he was 10 years old he's been given a 80286 as birthday present, and from that day on it's been a crescendo of programming techniques. Started with batch ms-dos file, that in a short while got interfaced with .com files created with debug.exe embedded ms-dos file... and then gw-basic, turbo pascal, quick basic, assembly, vb, vc++, delphi, java, plus a bunch of scripting languages, php included.
His other main passion is music and art in general, and has been awarded several times for his graphics and songs. He founded and still leads a demogroup named 3D, which stands for DBC Demo Division, and from time to time he takes the chance to attend demoparties, and eventually, submit artworks to some of the competitions offered by the different parties.
He's currently workin as a sales agent. Nothing to do with computers, but still he has to gain some money to buy some food...


Comments and Discussions