GetWindow still exists and not marked as obsoleted by MS.
xrg_soft 163 com
Posts
-
about GetWindow function -
about GetWindow functionThanks! I think I got it: If calling GetWindow in a loop, there might be some problem. Especially when they might be some window-hierarchy change during the loop. But still confused why there might be run-into a endless loop?
-
about GetWindow functionHello, In the MSDN, GetWindow function page(http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515(v=vs.85).aspx[^]), Remark section, it's said: "The EnumChildWindows function is more reliable than calling GetWindow in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed." Does anybody know in which case will the risks(caught in an infinite loop or referencing a handle to a window that has been destroyed) happen? Thanks & BR
-
Text drawing is not getting properlyAfter you create the dialog bar, try to passing its window handle to other window. and when update needed, in the other window, call InvalidateRect(hWndDialogBar
-
IAccessible, IAccessible2 Interface for Microsoft Active AccessibilityNot every program supports IAccessible . According to what you said, Mozilla Firefox browser Controls Not Implemented it.
-
Text drawing is not getting properlyIf I understood you correctly, the m_stClipMind is a place holder CStatic? If so, the problem is after your paint on the rect, when m_stClipMind refresh itself, your text will get erased. two way to fix: 1) remove the WS_VISIBLE style for the m_stClipMind 2) using m_stClipMind.SetWindowText
-
Disappearing MFC controls [modified]According to your description, seem the controls are overlapped. please use Spy++ to check the control rect to verify that these controls are overlapped. If this is the case, you just need to re-pos the overlapped controls.
-
CFormView control sizingI guess you do not catch all my meaning. If you just set the grid position in OnInitialUpdate, then even it works. There still some problem after you resize your application. To make sure it works in all case, you must do it inside OnSize
CMembersView::OnSize:
CWnd *pGridCtrl = this->GetDlgItem(IDC_MEMBERSGRID);
ASSERT(pGridCtrl); // Must exist
if ( ::IsWindow(pGridCtrl->GetSafeHwnd()) )
{
// assume you need to move the grid to the left half of CMembersView
CRect rctClient;
this->GetClientRect(&rctClient);
pGridCtrl->MoveWindow(0, 0, rctClient.Width()/2, rctClient.Height());
}modified on Thursday, August 25, 2011 10:19 AM
-
How to increate network transfer speed?Assume your program can,Then, why others program can not? If all the programs can, what will be the result?
-
CFormView control sizingThe window size is never specified when you first call pGridCtrl->GetWindowRect(grid_rect); in the OnInitialUpdate. Please write some codelike below in your CMembersView::OnSize
CWnd *pGridCtrl = this->GetDlgItem(IDC_MEMBERSGRID);
ASSERT(pGridCtrl); // Must exist
if ( ::IsWindow(pGridCtrl->GetSafeHwnd()) )
{
pGridCtrl->MoveWindow(..modified on Thursday, August 25, 2011 4:08 AM
-
Ambiguity of 'this' and 'member function' [modified]In your case(no virtual inheritance used), the The inside of the KDrived object, there is a KMiddle object followed by a KMiddle2 object. d.KBase::BaseFun(); d.KMiddle::BaseFun(); actually calls to the function of the KMiddle object. and d.KMiddle2::BaseFun(); calls to the function of the KMiddle2 object. As your Kxxx object contains nothing, so sizeof(Kxxx) == 1 That's why the result printed. And if you adding somemember variable into the class, then the result should be: KBase::BaseFun() this= KBase::BaseFun() this= KBase::BaseFun() this=<base> + sizeof(KMiddle)
-
Ambiguity of 'this' and 'member function' [modified]Which complier do you use? in some complier that follow the standard c++ strictly, like g++, your code will not compiled and got Error Message: `D' is an ambiguous base of `B' To make the multiple inheritance follows the standard c++ well, you should using virtual inheritance in this case.
class KMiddle : virtual public KBase
class KMiddle2 : virtual public KBaseclass KDerived : public KMiddle, public KMiddle2
-
CHtmlView Windows 7 issueIt's really very strange... Because CHtmlView::Navigate2 just a wrapper of IWebBrowser2::Navigate2 Maybe you need to step into the Navigate2 call. or just call IWebBrowser2::Navigate2 directly and see what will happened. Unfortunately I does not have Win7 on hand. So, can not help you more.
-
CHtmlView Windows 7 issueThe behavior sounds like that the Win7 default shell operation not correctly set. Can you check the registry for the default value of HKEY_CLASSES_ROOT\htmlfile\shell [HKEY_CLASSES_ROOT\htmlfile\shell] @="opennew" or you can try on another Win7 machine?
-
VC6 C++ can I prevent an "Internet Explorer Script Error" debug dialog popup [modified]If your code (for display or simply do nothing) get called, then you are detected for it.
-
VC6 C++ can I prevent an "Internet Explorer Script Error" debug dialog popup [modified]implement IDocHostShowUI::ShowMessage see http://msdn.microsoft.com/en-us/library/aa753271(v=VS.85).aspx
-
CHtmlView Windows 7 issue- how about Navigate2("http://www.xxx.com"...)? 2) try OnNewWindow3 please.
-
When extending IE,How to get the binary data of a downloaded file?A easy method is using UrlDownloadToFile()
-
Mailing a File to an Email-IdHere it is. [^] A Very well encapsulated and easy to use class by Jakub Piwowarczyk. You can directly use it in your MFC project.
-
about "windows belonging to different processes are mixed in a single window hierarchy"Thanks! I think I got the basic idea. Just like embeded MS Word into your_app, the embeded MSWord view window is a chid window of your_app.exe but it's essentially relaies on a external process WinWord.exe