Click here to Skip to main content
15,921,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to add space to a string Pin
Joy Anne13-Jul-06 17:27
Joy Anne13-Jul-06 17:27 
AnswerRe: how to add space to a string Pin
Code_Zombie13-Jul-06 17:36
Code_Zombie13-Jul-06 17:36 
AnswerRe: how to add space to a string Pin
see me13-Jul-06 17:37
see me13-Jul-06 17:37 
AnswerRe: how to add space to a string Pin
KellyR13-Jul-06 18:34
KellyR13-Jul-06 18:34 
Questioncan tab control join project togehter? Pin
mimimimilaw13-Jul-06 17:21
mimimimilaw13-Jul-06 17:21 
AnswerRe: can tab control join project togehter? Pin
see me13-Jul-06 17:44
see me13-Jul-06 17:44 
GeneralRe: can tab control join project togehter? Pin
mimimimilaw13-Jul-06 17:47
mimimimilaw13-Jul-06 17:47 
GeneralRe: can tab control join project togehter? Pin
Abhi Lahare13-Jul-06 18:02
Abhi Lahare13-Jul-06 18:02 
QuestionLimiting # of columns in multi-column listbox Pin
KellyR13-Jul-06 17:15
KellyR13-Jul-06 17:15 
AnswerRe: Limiting # of columns in multi-column listbox [modified] Pin
Abhi Lahare13-Jul-06 17:36
Abhi Lahare13-Jul-06 17:36 
GeneralRe: Limiting # of columns in multi-column listbox Pin
KellyR13-Jul-06 17:44
KellyR13-Jul-06 17:44 
GeneralRe: Limiting # of columns in multi-column listbox Pin
Abhi Lahare13-Jul-06 18:01
Abhi Lahare13-Jul-06 18:01 
GeneralRe: Limiting # of columns in multi-column listbox [modified] Pin
KellyR13-Jul-06 18:10
KellyR13-Jul-06 18:10 
AnswerRe: Limiting # of columns in multi-column listbox Pin
Ryan Binns13-Jul-06 18:34
Ryan Binns13-Jul-06 18:34 
GeneralRe: Limiting # of columns in multi-column listbox Pin
KellyR13-Jul-06 18:36
KellyR13-Jul-06 18:36 
QuestionWM_TIMER Pin
thathvamsi13-Jul-06 16:48
thathvamsi13-Jul-06 16:48 
AnswerRe: WM_TIMER Pin
see me13-Jul-06 17:33
see me13-Jul-06 17:33 
Questionanti-debug product for MFC? Pin
darbien siamak13-Jul-06 16:16
darbien siamak13-Jul-06 16:16 
AnswerRe: anti-debug product for MFC? Pin
Phil.Benson13-Jul-06 21:28
professionalPhil.Benson13-Jul-06 21:28 
QuestionFilling a square? Pin
Lord Kixdemp13-Jul-06 12:49
Lord Kixdemp13-Jul-06 12:49 
AnswerRe: Filling a square? Pin
earl13-Jul-06 13:22
earl13-Jul-06 13:22 
GeneralRe: Filling a square? Pin
Lord Kixdemp13-Jul-06 16:10
Lord Kixdemp13-Jul-06 16:10 
GeneralRe: Filling a square? Pin
Rilhas17-Jul-06 12:47
Rilhas17-Jul-06 12:47 
GeneralRe: Filling a square? Pin
Lord Kixdemp18-Jul-06 12:33
Lord Kixdemp18-Jul-06 12:33 
QuestionSubclass main Winamp window from plugin Pin
u0m313-Jul-06 12:13
u0m313-Jul-06 12:13 
Hy. I'm trying to subclass the main winamp window in order to be able to get winamp internal information without using a timer(ie: current song artist, album, title, lenght, ..., volume, etc). I'm currently having trouble sbuclassing the winamp window (don't actualy know how to do it)

If some one could tell me what I did wrong, or what could be done better, I wold be realy grateful.
Here's the code:
========================================================================================
// gen_mymsc.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "gen_mymsc.h"
#include "gen.h"
#include "confDiag.h"
#include "wa_ipc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

//
//TODO: If this DLL is dynamically linked against the MFC DLLs,
// any functions exported from this DLL which call into
// MFC must have the AFX_MANAGE_STATE macro added at the
// very beginning of the function.
//
// For example:
//
// extern "C" BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function, prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function, even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//


// Cgen_mymscApp

BEGIN_MESSAGE_MAP(Cgen_mymscApp, CWinApp)
END_MESSAGE_MAP()


// Cgen_mymscApp construction

Cgen_mymscApp::Cgen_mymscApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

int Cgen_mymscApp::winampInit()
{
AfxMessageBox(_T("Winamp has initiated the plugin."), MB_ICONASTERISK, 0);
return 0;
}

void Cgen_mymscApp::winampConfig()
{
CconfDiag *confDiag = new CconfDiag();
//INT_PTR
confDiag->DoModal();
}

void Cgen_mymscApp::winampQuit()
{
AfxMessageBox(_T("Winamp has destroyed the plugin!!! Cry | :(( "), MB_ICONASTERISK, 0);
}

int Cgen_mymscApp::winampSongChanged()
{
return 0;
}

// The one and only Cgen_mymscApp object

Cgen_mymscApp theApp;


// Cgen_mymscApp initialization

BOOL Cgen_mymscApp::InitInstance()
{
CWinApp::InitInstance();
hwndWinamp = FindWindowW(_T("Winamp 1.x"), NULL);
return TRUE;
}



/*********************************
* Winamp main functions *
*********************************/
WNDPROC lpWndProcOld = NULL;
LONG winampLong;
bool smth = false;
HWND winampHWND;

int init(){
AFX_MANAGE_STATE(AfxGetStaticModuleState());
winampHWND = FindWindow(L"Winamp v1.x", NULL);
winampLong = GetWindowLong(winampHWND, 0);
lpWndProcOld = (WNDPROC)SetWindowLong(winampHWND, GWL_WNDPROC, winampLong);
return theApp.winampInit();
}

void config(){
AFX_MANAGE_STATE(AfxGetStaticModuleState());
theApp.winampConfig();
}

void quit(){
AFX_MANAGE_STATE(AfxGetStaticModuleState());
theApp.winampQuit();
}

LRESULT CALLBACK MainWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
AfxMessageBox(L"We has entered the the callback procedure");
if(message==WM_WA_IPC && lParam==IPC_ISPLAYING && smth==false)
{
AfxMessageBox(L"Winamp is playing");
smth = true;
return 0;
}
return CallWindowProc(lpWndProcOld,hwnd,message,wParam,lParam);
}

winampGeneralPurposePlugin plugin =
{
GPPHDR_VER,
"Multi - Yahoo! Messenger Status Changer (gen_mymsc.dll)",
init,
config,
quit,
};

extern "C" {
__declspec(dllexport) winampGeneralPurposePlugin *winampGetGeneralPurposePlugin(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
return &plugin;
}
}
===============================================================================================
http://rafb.net/paste/results/6vBdVY85.nln.html <-the same code with sintaxHighlight

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.