Click here to Skip to main content
15,914,111 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: how to add code for user can adjust controls postion? Pin
Michael Dunn23-Apr-06 7:30
sitebuilderMichael Dunn23-Apr-06 7:30 
GeneralRe: how to add code for user can adjust controls postion? Pin
CooperWu23-Apr-06 18:29
CooperWu23-Apr-06 18:29 
GeneralRe: how to add code for user can adjust controls postion? Pin
CooperWu26-Apr-06 19:52
CooperWu26-Apr-06 19:52 
GeneralRe: how to add code for user can adjust controls postion? Pin
Steve Echols26-Apr-06 20:21
Steve Echols26-Apr-06 20:21 
GeneralRe: how to add code for user can adjust controls postion? Pin
CooperWu26-Apr-06 20:30
CooperWu26-Apr-06 20:30 
GeneralRe: how to add code for user can adjust controls postion? Pin
Michael Dunn27-Apr-06 19:42
sitebuilderMichael Dunn27-Apr-06 19:42 
GeneralRe: how to add code for user can adjust controls postion? Pin
CooperWu27-Apr-06 19:58
CooperWu27-Apr-06 19:58 
Questionabout safe unsubclass window Pin
FlyWithYou21-Apr-06 20:02
FlyWithYou21-Apr-06 20:02 
Hi.
----------------------------------------

AtlWin.h some code about unsubclass window:

				// unsubclass, if needed<br />
				LONG_PTR pfnWndProc = ::GetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC);<br />
				lRes = pThis->DefWindowProc(uMsg, wParam, lParam);<br />
				if(pThis->m_pfnSuperWindowProc != ::DefWindowProc && ::GetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC) == pfnWndProc)<br />
					::SetWindowLongPtr(pThis->m_hWnd, GWLP_WNDPROC, (LONG_PTR)pThis->m_pfnSuperWindowProc);<br />
#if (_ATL_VER >= 0x0700)<br />
				// mark window as destryed<br />
				pThis->m_dwState |= WINSTATE_DESTROYED;<br />
#else // !(_ATL_VER >= 0x0700)<br />
				// clear out window handle<br />
				HWND hWnd = pThis->m_hWnd;<br />
				pThis->m_hWnd = NULL;<br />
				// clean up after window is destroyed<br />
				pThis->OnFinalMessage(hWnd);<br />
#endif // !(_ATL_VER >= 0x0700)


---------------------------------------

WINCORE.CPP some code about unsubclasswindow

// call default, unsubclass, and detach from the map<br />
WNDPROC pfnWndProc = WNDPROC(GetWindowLongPtr(m_hWnd, GWLP_WNDPROC));<br />
Default();<br />
if (WNDPROC(GetWindowLongPtr(m_hWnd, GWLP_WNDPROC)) == pfnWndProc)<br />
{<br />
    WNDPROC pfnSuper = *GetSuperWndProcAddr();<br />
    if (pfnSuper != NULL)<br />
        SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, INT_PTR(pfnSuper));<br />
}<br />
Detach();


----------------------------------------------------
1.Why in ATL when "pThis->m_pfnSuperWindowProc == ::DefWindowProc " not need restore old wndproc, but in MFC without this compare?

2.Now i write subclass window(mulriple, like DefWindowProc -> My subclass -> CWnd subclass(CWindow subclass) or DefWindowProc -> CWnd subclass(CWindow subclass) -> my subclass), and can safe unsubclass window. which above code i can modification and use in my code?

Thanks.
Questionbooks/references on win32 common controls Pin
jason s {3E44F2FF-8ED8-4ff9-8669-6672A203F776}21-Apr-06 9:36
jason s {3E44F2FF-8ED8-4ff9-8669-6672A203F776}21-Apr-06 9:36 
AnswerRe: books/references on win32 common controls Pin
John R. Shaw22-Apr-06 19:37
John R. Shaw22-Apr-06 19:37 
QuestionCaseless STL string comparison Pin
Rob Caldecott21-Apr-06 5:15
Rob Caldecott21-Apr-06 5:15 
AnswerRe: Caseless STL string comparison Pin
valikac21-Apr-06 7:16
valikac21-Apr-06 7:16 
AnswerRe: Caseless STL string comparison Pin
Nemanja Trifunovic21-Apr-06 8:58
Nemanja Trifunovic21-Apr-06 8:58 
AnswerRe: Caseless STL string comparison Pin
Stuart Dootson22-Apr-06 0:33
professionalStuart Dootson22-Apr-06 0:33 
QuestionConnection Points... Pin
HakunaMatada20-Apr-06 19:00
HakunaMatada20-Apr-06 19:00 
AnswerRe: Connection Points... Pin
Lim Bio Liong23-Apr-06 0:05
Lim Bio Liong23-Apr-06 0:05 
QuestionSTL: Set within Map upsets iterator Pin
sstan_tap19-Apr-06 18:35
sstan_tap19-Apr-06 18:35 
AnswerRe: STL: Set within Map upsets iterator Pin
Stephen Hewitt19-Apr-06 18:54
Stephen Hewitt19-Apr-06 18:54 
Questionusing ATL 7 define struct in IDL met a problem,help plz Pin
LiangChen19-Apr-06 16:11
LiangChen19-Apr-06 16:11 
AnswerRe: using ATL 7 define struct in IDL met a problem,help plz Pin
Milton Karimbekallil21-Apr-06 4:56
Milton Karimbekallil21-Apr-06 4:56 
Questionwofstream does not work well. Pin
hdtrung18-Apr-06 23:33
hdtrung18-Apr-06 23:33 
AnswerRe: wofstream does not work well. Pin
Michael Dunn19-Apr-06 1:21
sitebuilderMichael Dunn19-Apr-06 1:21 
GeneralRe: wofstream does not work well. Pin
hdtrung19-Apr-06 16:26
hdtrung19-Apr-06 16:26 
QuestionHow can i add an icon to IE status bar? Pin
RedFraggle18-Apr-06 7:30
RedFraggle18-Apr-06 7:30 
QuestionHow can I hide the export information of my DLL Pin
Simon.W18-Apr-06 5:19
Simon.W18-Apr-06 5:19 

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.