Click here to Skip to main content
15,915,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Class x needs defining before class y, circular dependecy Pin
led mike2-Nov-06 4:58
led mike2-Nov-06 4:58 
QuestionWindow messages [modified] Pin
Waldermort1-Nov-06 9:58
Waldermort1-Nov-06 9:58 
AnswerRe: Window messages Pin
PJ Arends1-Nov-06 19:22
professionalPJ Arends1-Nov-06 19:22 
AnswerRe: Window messages Pin
Michael Dunn1-Nov-06 20:09
sitebuilderMichael Dunn1-Nov-06 20:09 
Questionall Slider objects are sending OnHScroll() msg Pin
aquawicket1-Nov-06 9:46
aquawicket1-Nov-06 9:46 
AnswerRe: all Slider objects are sending OnHScroll() msg Pin
Mark Salsbery1-Nov-06 10:03
Mark Salsbery1-Nov-06 10:03 
GeneralRe: all Slider objects are sending OnHScroll() msg Pin
aquawicket1-Nov-06 14:49
aquawicket1-Nov-06 14:49 
QuestionMFC - creating invisible window Pin
edvintas1-Nov-06 6:58
edvintas1-Nov-06 6:58 
Hello,
i need your help again Poke tongue | ;-P
so, i am trying to create invisible window with MFC i will post my source code then you should understand more easily what a f**k i am trying to do Blush | :O i know, i am doing something wrong D'Oh! | :doh: hmm.. so the main question is how to create invisible window? Blush | :O
***HookApp.cpp***<br />
<pre>#include "stdafx.h"
#include "HookApp.h"

HookApp theApp;

void HookApp::FileWrite(char *data)
{
	FILE *f;
	errno_t err;
	err = fopen_s(&f, "C:\\debug.txt", "a");
	fprintf(f, data);
	fflush(f);
	fclose(f);
}
HookApp::HookApp()
{
	FileWrite("Constructed\n");
}
HookApp::~HookApp()
{
	FileWrite("Destructed\n");
}
BOOL HookApp::InitInstance()
{
	FileWrite("Initialized\n");
	MyWnd* pWnd;
     pWnd = new MyWnd();
	WaitForSingleObject(HookApp::m_hThread, 10000);
	return false;
}</pre><br />
<code>***HookApp.h***<pre>class HookApp : public CWinApp
{
	public:
		HookApp();
		virtual ~HookApp();
		virtual BOOL InitInstance();
		static void FileWrite(char *data);
};

class MyWnd : public CWnd
{
	DECLARE_DYNAMIC(MyWnd)
	public:
		MyWnd();
		virtual ~MyWnd();
		afx_msg LRESULT OnMsg(WPARAM wParam, LPARAM lParam);
		DECLARE_MESSAGE_MAP()
};</pre><br />
<code>***MyWnd.cpp***<pre>#include "stdafx.h"
#include "HookApp.h"
#include "pKhook.h"

IMPLEMENT_DYNAMIC(MyWnd, CWnd)

LRESULT MyWnd::OnMsg(WPARAM wParam, LPARAM lParam)
{   
	HookApp::FileWrite("message\n");
	return 0;
}
MyWnd::MyWnd()
{
	HookApp::FileWrite("Invisible Window Constructed\n");
	InstallKeyHook();
	KEYENTRY m_entry;
	m_entry.nMessage = WM_MY_EVENT; // Our message ID
	m_entry.hCallWnd = m_hWnd;// Send message to this window
	m_entry.hHookWnd = 0; // Capture key-strokes occurred in any windows
	m_entry.iCombKeys = 0; // combination keys don't matter
	m_entry.iIndicators = 0; // Caps-lock, Num-lock, Scroll-lock on/off states do not matter
	m_entry.iKeyEvent = 0; // Capture all key events
	m_entry.iMinVKCode = 0x00; // Capture all keys
	m_entry.iMaxVKCode = 0xff;
	if(KH_OK == AddKeyEntry(&m_entry)) HookApp::FileWrite("KeyHook Init Done\n");
}

MyWnd::~MyWnd()
{	
	HookApp::FileWrite("Invisible Window Destructed\n");
}

BEGIN_MESSAGE_MAP(MyWnd, CWnd)
	ON_MESSAGE(WM_MY_EVENT, OnMsg)
END_MESSAGE_MAP()</pre><br />
thanks for all of you in advance :)

AnswerRe: MFC - creating invisible window Pin
led mike1-Nov-06 6:59
led mike1-Nov-06 6:59 
GeneralRe: MFC - creating invisible window Pin
edvintas1-Nov-06 7:53
edvintas1-Nov-06 7:53 
AnswerRe: MFC - creating invisible window Pin
Mark Salsbery1-Nov-06 7:15
Mark Salsbery1-Nov-06 7:15 
AnswerRe: MFC - creating invisible window Pin
David Crow1-Nov-06 7:21
David Crow1-Nov-06 7:21 
QuestionRe: MFC - creating invisible window Pin
Chris Meech1-Nov-06 7:26
Chris Meech1-Nov-06 7:26 
AnswerRe: MFC - creating invisible window Pin
edvintas1-Nov-06 7:48
edvintas1-Nov-06 7:48 
GeneralRe: MFC - creating invisible window Pin
led mike1-Nov-06 8:06
led mike1-Nov-06 8:06 
QuestionRe: MFC - creating invisible window Pin
Chris Meech1-Nov-06 8:28
Chris Meech1-Nov-06 8:28 
AnswerRe: MFC - creating invisible window Pin
edvintas1-Nov-06 8:47
edvintas1-Nov-06 8:47 
GeneralRe: MFC - creating invisible window Pin
Mark Salsbery1-Nov-06 9:47
Mark Salsbery1-Nov-06 9:47 
QuestionRelease, Debug, Doc/view and message Pin
how jack1-Nov-06 6:43
how jack1-Nov-06 6:43 
AnswerRe: Release, Debug, Doc/view and message Pin
David Crow1-Nov-06 7:17
David Crow1-Nov-06 7:17 
GeneralRe: Release, Debug, Doc/view and message Pin
Reagan Conservative1-Nov-06 8:23
Reagan Conservative1-Nov-06 8:23 
QuestionRe: Release, Debug, Doc/view and message Pin
David Crow1-Nov-06 8:32
David Crow1-Nov-06 8:32 
GeneralRe: Release, Debug, Doc/view and message Pin
led mike1-Nov-06 8:37
led mike1-Nov-06 8:37 
GeneralRe: Release, Debug, Doc/view and message Pin
Reagan Conservative1-Nov-06 8:42
Reagan Conservative1-Nov-06 8:42 
GeneralRe: Release, Debug, Doc/view and message Pin
how jack1-Nov-06 12:27
how jack1-Nov-06 12:27 

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.