Click here to Skip to main content
16,009,255 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to change the background of a label? Pin
mosali satish17-Jun-06 2:55
mosali satish17-Jun-06 2:55 
AnswerRe: How to change the background of a label? Pin
Laxman Auti17-Jun-06 3:17
Laxman Auti17-Jun-06 3:17 
AnswerRe: How to change the background of a label? Pin
_AnsHUMAN_ 17-Jun-06 3:33
_AnsHUMAN_ 17-Jun-06 3:33 
Questionhow we can add new items in list control Pin
vasusree17-Jun-06 2:41
vasusree17-Jun-06 2:41 
AnswerRe: how we can add new items in list control [modified] Pin
_AnsHUMAN_ 17-Jun-06 2:51
_AnsHUMAN_ 17-Jun-06 2:51 
AnswerRe: how we can add new items in list control Pin
Laxman Auti17-Jun-06 3:45
Laxman Auti17-Jun-06 3:45 
AnswerRe: how we can add new items in list control Pin
Hamid_RT17-Jun-06 7:12
Hamid_RT17-Jun-06 7:12 
QuestionSetWindowsHookEx gives desired result only once? Pin
ROWALI17-Jun-06 1:54
ROWALI17-Jun-06 1:54 
In my dialog based MFC application, I initiate windows hook as follows

HHOOK TheHook; <br />
LRESULT CALLBACK ShellProc(          int nCode,<br />
    WPARAM wParam,<br />
    LPARAM lParam<br />
);<br />
<br />
BOOL CTmphookDlg::OnInitDialog()<br />
{<br />
..<br />
..<br />
HINSTANCE ppI = AfxGetInstanceHandle();<br />
TheHook=SetWindowsHookEx(WH_SHELL, ShellProc, ppI,0);<br />
..<br />
..<br />
}<br />
<br />
LRESULT CALLBACK ShellProc(          int nCode,<br />
    WPARAM wParam,<br />
    LPARAM lParam<br />
)<br />
{<br />
<br />
	if(nCode==HSHELL_WINDOWCREATED)<br />
	{<br />
		HWND hWnd = (HWND)(wParam);<br />
		char szClassName[256];<br />
		GetClassName(hWnd, szClassName, sizeof(szClassName));<br />
		AfxMessageBox(szClassName);<br />
	}<br />
<br />
	return CallNextHookEx(TheHook, nCode, wParam, lParam);<br />
} 


What I want is when any window (other applications) is created on the operating system.. it should flash a message telling its class name.

But this code only shows its class name initially when the dialog is being created. I tried to open notepad or other windows of other applications, it didnt flash any message.

Why is that so.? What to do to get this?



Row
AnswerRe: SetWindowsHookEx gives desired result only once? [modified] Pin
Stephen Hewitt17-Jun-06 2:38
Stephen Hewitt17-Jun-06 2:38 
GeneralRe: SetWindowsHookEx gives desired result only once? Pin
FarPointer17-Jun-06 21:32
FarPointer17-Jun-06 21:32 
GeneralRe: SetWindowsHookEx gives desired result only once? Pin
peterchen18-Jun-06 9:34
peterchen18-Jun-06 9:34 
GeneralRe: SetWindowsHookEx gives desired result only once? [modified] Pin
Stephen Hewitt18-Jun-06 14:34
Stephen Hewitt18-Jun-06 14:34 
GeneralRe: SetWindowsHookEx gives desired result only once? Pin
FarPointer18-Jun-06 17:58
FarPointer18-Jun-06 17:58 
QuestionAbout ADO Conection Pin
onlysaint17-Jun-06 1:48
onlysaint17-Jun-06 1:48 
Questioncalling api function in __asm block Pin
zon_cpp17-Jun-06 1:34
zon_cpp17-Jun-06 1:34 
AnswerRe: calling api function in __asm block Pin
Laxman Auti17-Jun-06 3:40
Laxman Auti17-Jun-06 3:40 
Questionregarding ADO.net Pin
GoodBoy17-Jun-06 0:46
GoodBoy17-Jun-06 0:46 
AnswerRe: regarding ADO.net Pin
Hamid_RT17-Jun-06 1:04
Hamid_RT17-Jun-06 1:04 
AnswerRe: regarding ADO.net Pin
Christian Graus17-Jun-06 1:30
protectorChristian Graus17-Jun-06 1:30 
Questionsimple smallest windows program not running. [modified] Pin
sunnyboy_anshu17-Jun-06 0:38
sunnyboy_anshu17-Jun-06 0:38 
AnswerRe: simple smallest windows program not running. [modified] Pin
_AnsHUMAN_ 17-Jun-06 0:45
_AnsHUMAN_ 17-Jun-06 0:45 
GeneralRe: simple smallest windows program not running. Pin
sunnyboy_anshu17-Jun-06 0:57
sunnyboy_anshu17-Jun-06 0:57 
AnswerRe: simple smallest windows program not running. Pin
Hamid_RT17-Jun-06 0:57
Hamid_RT17-Jun-06 0:57 
Questionhow to read the file Pin
happy_ram17-Jun-06 0:32
happy_ram17-Jun-06 0:32 
AnswerRe: how to read the file Pin
_AnsHUMAN_ 17-Jun-06 0:43
_AnsHUMAN_ 17-Jun-06 0:43 

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.