Click here to Skip to main content
15,923,376 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Deranged CHtmlCtrl Pin
monrobot1329-Oct-02 6:11
monrobot1329-Oct-02 6:11 
GeneralRe: Deranged CHtmlCtrl Pin
Chris Losinger29-Oct-02 6:15
professionalChris Losinger29-Oct-02 6:15 
GeneralRe: Deranged CHtmlCtrl Pin
monrobot1329-Oct-02 7:10
monrobot1329-Oct-02 7:10 
GeneralCFileDialog?? HELP! Pin
Pett28-Oct-02 13:06
Pett28-Oct-02 13:06 
GeneralEvent Handling Problem in WIN32/MFC App. Pin
loopguru28-Oct-02 12:58
loopguru28-Oct-02 12:58 
QuestionHow to get icons of all opened windows? Pin
Artem Moroz28-Oct-02 12:16
Artem Moroz28-Oct-02 12:16 
AnswerRe: How to get icons of all opened windows? Pin
dabs31-Oct-02 4:46
dabs31-Oct-02 4:46 
GeneralRe: How to get icons of all opened windows? Pin
Artem Moroz31-Oct-02 10:32
Artem Moroz31-Oct-02 10:32 
This is my code
HICON NewGetIcon(HWND p_hWnd) <br />
{<br />
	<br />
	HICON hIcon = NULL;<br />
	HMODULE hInst = (HMODULE)GetClassLong(p_hWnd,GWL_HINSTANCE);<br />
	hIcon = (HICON)::SendMessage(p_hWnd,WM_GETICON,ICON_SMALL,0);<br />
<br />
/*	if (hIcon == NULL)<br />
	{<br />
		CString strFile;<br />
		int RtnLength = GetModuleFileName(hInst, strFile.GetBuffer(256), 255); <br />
		WORD wIcon = 0;<br />
		hIcon = ExtractAssociatedIcon(AfxGetApp()->m_hInstance,strFile.GetBuffer(0),&wIcon);<br />
	}*/<br />
	<br />
<br />
//	if (hIcon == NULL)<br />
//		hIcon = (HICON)::SendMessage(p_hWnd,WM_GETICON,ICON_BIG,0);<br />
<br />
	if (hIcon == NULL)<br />
			hIcon = (HICON)GetClassLong(p_hWnd,GCL_HICONSM);<br />
<br />
	if (hIcon == NULL)<br />
		hIcon = (HICON)GetClassLong(p_hWnd,GCL_HICON);<br />
<br />
<br />
//	if(hIcon != NULL)<br />
//		DuplicateIcon(hInst,hIcon);<br />
	<br />
	return (hIcon); <br />
} <br />


The problem is that it returns either not correct icon or empty icon (not NULL!)

Of course, I've different combiantions of commenting, uncommneting...
GeneralRe: How to get icons of all opened windows? Pin
dabs31-Oct-02 13:03
dabs31-Oct-02 13:03 
GeneralSaving with MFC Pin
dinner@628-Oct-02 11:30
dinner@628-Oct-02 11:30 
GeneralRe: Saving with MFC Pin
Christian Graus28-Oct-02 11:34
protectorChristian Graus28-Oct-02 11:34 
GeneralRe: Saving with MFC Pin
valikac28-Oct-02 11:37
valikac28-Oct-02 11:37 
GeneralRe: Saving with MFC Pin
dinner@628-Oct-02 11:59
dinner@628-Oct-02 11:59 
GeneralRe: Saving with MFC Pin
valikac28-Oct-02 12:12
valikac28-Oct-02 12:12 
GeneralRe: Saving with MFC Pin
Christian Graus28-Oct-02 13:25
protectorChristian Graus28-Oct-02 13:25 
GeneralRe: Saving with MFC Pin
ian mariano28-Oct-02 17:38
ian mariano28-Oct-02 17:38 
GeneralCImage -- Can't get it working Pin
nde_plume28-Oct-02 11:26
nde_plume28-Oct-02 11:26 
GeneralRe: CImage -- Can't get it working Pin
Christian Graus28-Oct-02 11:31
protectorChristian Graus28-Oct-02 11:31 
GeneralStrange Problem. Pin
Anonymous28-Oct-02 10:25
Anonymous28-Oct-02 10:25 
GeneralRe: Strange Problem. Pin
Maximilien28-Oct-02 10:35
Maximilien28-Oct-02 10:35 
GeneralRe: Strange Problem. Pin
Anonymous28-Oct-02 11:08
Anonymous28-Oct-02 11:08 
GeneralQuestion concerning bitmaps Pin
Steven M Hunt28-Oct-02 10:22
Steven M Hunt28-Oct-02 10:22 
GeneralRe: Question concerning bitmaps Pin
Christian Graus28-Oct-02 10:29
protectorChristian Graus28-Oct-02 10:29 
GeneralMFC/Win32 MicroPhone Mute Pin
Moshe Bergman28-Oct-02 10:01
sussMoshe Bergman28-Oct-02 10:01 
GeneralRe: MFC/Win32 MicroPhone Mute Pin
ian mariano28-Oct-02 17:43
ian mariano28-Oct-02 17: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.