|
I think it's like this: An HWND is a number (handle) to a window (dialog, edit box, etc) that is used by the Windows operating system to refer to the window specifically. CWnd is just an MFC class that encapsulates a registered window class and its handle. You could just as easily make up a class called CMyWindow and in the constructor have it call the Windows API to create a window of the type you want (button, for instance) in your class's constructor, then have the HWND be a property of your class. CWnd is just an encapsulating class, as is CListBox, CComboBox, etc.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Thanks for reply,
So is a HWND smth like : "CWnd object - template resource" .
Does it mean that if i have a handle to a window ,
i can use all methods declared in a CWnd for this window???
sorry i don't get it
|
|
|
|
|
Well, CWnd is an MFC class. You can get an HWND to a window just using the Windows API to create a window, then registering it. If you're using a CWnd class, you can just use the methods of the class; it takes care of all the HWND stuff for you (usually). So if you're using a CWnd-derived object, you probably don't need to use an HWND
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
A handle is nothing more than a token that an application can use to identify and access an object such as a device, a file, a window, or a dialog box.
See here for what CWnd is and is not.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
You can get the CWnd (or the corresponding class) pointer from the handle by using FromHandle(HWND hWnd) so you'll be able to use the advantages from the 2 ways.
Marc.
|
|
|
|
|
CWnd is wraps the Window handle and window handle related API's into a single Class.
suhredayan There is no spoon.
|
|
|
|
|
I have got the project which on executing opens the window without title bar
it is MFC project window stays there where it gets opened
how can i drag window from one place to another on my computer screen
initially position is set like this
this->m_MainDialog.SetWindowPos(&CWnd::wndTop,100,100,0,0,SWP_NOSIZE);
this->m_MainDialog.ShowWindow(SW_SHOW);
please help
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Override the WM_LBUTTONDOWN message handler , like this :
void CYourClass::OnLButtonDown(UINT nFlags , CPoint point)
{
SendMessage(WM_NCLBUTTONDOWN,HTCAPTION);
}
"Success is the ability of going from one failure to another with no loss of enthusiasm" - W.Churchill
|
|
|
|
|
when i right click on my dialog box window and right click on my class wizard it gives error
classWizard database E:\oda\source\ODA.dw does not exist
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
thanks
solved as u say
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Does someone know hot to add tooltips to the CStatusBar... the bar at the bottom of CMainFrame that indicates NUM etc...
Thanks in advance...
|
|
|
|
|
|
In CListCtrl the GetItemText property is not working ....
what may be the alternative ?
ditty grail
|
|
|
|
|
ditty grail wrote:
In CListCtrl the GetItemText property is not working
Why not? What is it (not) doing?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
It should work. Otherwise use GetItemData() which returns LVITEM structure, it has a member variable which displays the item text.
Work hard and bit of luck is KEY to SUCCESS
|
|
|
|
|
Hi
I want to develope an application which can give me weather forecast.
I want to know is there any such application or any material through which i can get the data of weather directly in my C++ application.
I want just minimum and maximum temperature of perticular city by entering either name of city or zip code of city.
Any site which can give me some weather data or something like that....
If any body can help me it will be gr8..
Thankx in advance
Regards,
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
contact NASA people
regards,
Rookie
|
|
|
|
|
Rookieee wrote:
contact NASA people
What kind of reply is that? Still as useless, but NOAA would have been better.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Some years ago I developed a web application that displayed weather forecasts from different countries/cities. We got the information from XML files served periodically by Reuters. You can do it as well from VC++ using MSXML.
I don't know if Reuters still serve these files but there are other that does.
I hope it helps,
Marc Soleda
|
|
|
|
|
Write "weather xml service" at google to found similar services
|
|
|
|
|
See here for an example.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks David
Though that application given at this space doesn't work it seems good
Regards,
Mahesh
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Hai..
I Have hooked the MS Word applciation from my VC++ Application. Now I want to find the Current Position of the MS Word , either the automation or another way.
Thanks,
E.Veera Raghavendra.
|
|
|
|
|
Veera Raghavendra wrote:
Now I want to find the Current Position of the MS Word...
You want the current window position?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
If you have the CWnd object you can use the method:
void GetWindowRect( LPRECT lpRect ) const;
Marc.
|
|
|
|