Click here to Skip to main content
16,016,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: printing a vector Pin
Andy Brummer11-Aug-05 5:21
sitebuilderAndy Brummer11-Aug-05 5:21 
GeneralRe: printing a vector Pin
S. Senthil Kumar11-Aug-05 8:07
S. Senthil Kumar11-Aug-05 8:07 
GeneralRe: printing a vector Pin
Kevin McFarlane12-Aug-05 2:42
Kevin McFarlane12-Aug-05 2:42 
GeneralRe: printing a vector Pin
Eytukan11-Aug-05 23:20
Eytukan11-Aug-05 23:20 
GeneralRe: printing a vector Pin
Eytukan11-Aug-05 23:34
Eytukan11-Aug-05 23:34 
GeneralRe: printing a vector Pin
gecool11-Aug-05 20:10
gecool11-Aug-05 20:10 
QuestionHow can I get the CWnd pointer from HANDLE hProcess Pin
caykahve11-Aug-05 3:35
caykahve11-Aug-05 3:35 
AnswerRe: How can I get the CWnd pointer from HANDLE hProcess Pin
Jose Lamas Rios11-Aug-05 3:51
Jose Lamas Rios11-Aug-05 3:51 
You don't actually need a CWnd*. CWnd will just wrap the handle and convert the calls you make to CWnd methods in calls to the corresponding API function using the handle stored in its m_hWnd member. For example, here is the implementation for CWnd::MoveWindow()

void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
{
   ASSERT(::IsWindow(m_hWnd));
   ::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint);
}


So, you can always make the call to the API function yourself.

That being said, you can obtain a CWnd* for a given handle, using CWnd::FromHandle() but take note that in your case it will be a pointer to a temporary object, so you can't store it for later use.

Again, if all you want to do is to use some CWnd methods, you can use the corresponding API function directly on the window handle. For CWnd::SetWindowPos, the corresponding API is just ::SetWindowPos. Look in the documentation to see what parameters it expects.

--
jlr
http://jlamas.blogspot.com/[^]
GeneralRe: How can I get the CWnd pointer from HANDLE hProcess Pin
Jose Lamas Rios11-Aug-05 5:39
Jose Lamas Rios11-Aug-05 5:39 
GeneralRe: How can I get the CWnd pointer from HANDLE hProcess Pin
ThatsAlok11-Aug-05 17:54
ThatsAlok11-Aug-05 17:54 
AnswerRe: How can I get the CWnd pointer from HANDLE hProcess Pin
ThatsAlok11-Aug-05 4:42
ThatsAlok11-Aug-05 4:42 
GeneralRe: How can I get the CWnd pointer from HANDLE hProcess Pin
Eytukan11-Aug-05 4:59
Eytukan11-Aug-05 4:59 
GeneralCustom control in docable window Pin
Lalitesh11-Aug-05 3:07
Lalitesh11-Aug-05 3:07 
GeneralTAPI problem Pin
ahme_ramadan11-Aug-05 2:55
ahme_ramadan11-Aug-05 2:55 
Generaldouble rant/question ( and a smallish dll q. ) Pin
Maximilien11-Aug-05 2:52
Maximilien11-Aug-05 2:52 
GeneralRe: double rant/question ( and a smallish dll q. ) Pin
SunKnight011-Aug-05 3:08
SunKnight011-Aug-05 3:08 
GeneralRe: double rant/question ( and a smallish dll q. ) Pin
Achim Klein11-Aug-05 3:10
Achim Klein11-Aug-05 3:10 
GeneralRe: double rant/question ( and a smallish dll q. ) Pin
peterchen11-Aug-05 5:37
peterchen11-Aug-05 5:37 
GeneralFind the exe name when loading dll Pin
lynchspawn11-Aug-05 2:39
lynchspawn11-Aug-05 2:39 
GeneralRe: Find the exe name when loading dll Pin
SunKnight011-Aug-05 3:11
SunKnight011-Aug-05 3:11 
GeneralRe: Find the exe name when loading dll Pin
Don Miguel11-Aug-05 3:30
Don Miguel11-Aug-05 3:30 
GeneralRe: Find the exe name when loading dll Pin
lynchspawn11-Aug-05 3:37
lynchspawn11-Aug-05 3:37 
GeneralRe: Find the exe name when loading dll Pin
ThatsAlok11-Aug-05 4:34
ThatsAlok11-Aug-05 4:34 
GeneralRe: Find the exe name when loading dll Pin
cmk11-Aug-05 4:03
cmk11-Aug-05 4:03 
GeneralRe: Find the exe name when loading dll Pin
David Crow11-Aug-05 5:35
David Crow11-Aug-05 5:35 

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.