Questions tagged [cwnd]

CWnd Class is part of MFC library and provides the base functionality of all window classes.

CWnd Class is part of MFC library and provides the base functionality of all window classes.

A CWnd object is distinct from a Windows window, but the two are tightly linked. A CWnd object is created or destroyed by the CWnd constructor and destructor. The Windows window, on the other hand, is a data structure internal to Windows that is created by a Create member function and destroyed by the CWnd virtual destructor.

73 questions
2
votes
3 answers

CWnd with transparent background

I'd like to create a CWnd based class that will introduce a control with transparent background. There is no big deal for me to create a control and draw its content with transparent background as long as the content is static. The problem is when I…
Michał Walenciak
  • 4,257
  • 4
  • 33
  • 61
1
vote
2 answers

Understanding CStatic and CWnd and message routing

I'm trying to understand how message routing works in MFC, and I have some questions regarding it. Imagine a control that extends CWnd. My first question is: are all messages in that control passed on to the parent control? I know that doesn't…
webdreamer
  • 2,359
  • 3
  • 23
  • 30
1
vote
1 answer

How to activate a button (CButton) located in a disabled window (CWnd)?

I have this code : m_pBtnCom = new CButton(); m_pBtnCom->Create(_T("Push"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_TEXT|BS_VCENTER|BS_CENTER, rc, this, BTN_CMT); Where: this = my derived CWnd class rc = CRect button position BTN_CMT = button…
Landstalker
  • 1,368
  • 8
  • 9
1
vote
2 answers

Unable to change the color of my dialog boxes in my application

I am attempting to create a "dark mode" for my Windows C++ app partially for fun, partially to try and fully comprehend the message passing in MFC, but I'm running into some really odd issues that I can't find explained anywhere. I've spent the…
Skewjo
  • 379
  • 3
  • 12
1
vote
1 answer

C++ Error: identifier "CWnd" is not defined

I'm very much a C++ newbie, so please bear with me. This line of code which resides within a function: CWnd* pWnd = CWnd::FindWindow("Shell_TrayWnd", ""); CWnd is coming up as "undefined". I know I need to define it in the global scope, but how?…
mwieczorek
  • 2,107
  • 6
  • 31
  • 37
1
vote
1 answer

Application hangs when hosting managed control as CWnd

My application has ATL-based GUI (CWnd, CDialog,...) and it consists of multiple pages (CDialog). One of these pages is otherwise empty but it has a placeholder frame (CWnd) that resizes with the dialog. Everything is built as x64. When the page…
Simo Erkinheimo
  • 1,347
  • 9
  • 17
1
vote
0 answers

How does TCP congestion control work

I dont understand how to calculate the CWND-threshold, the source I'm learning from just says: "Initial value of ssthresh may be set to an arbitrarily high value (or size of advertised window)" Also what is the difference between CWND and…
GIjoe
  • 11
  • 1
1
vote
1 answer

MFC: how to keep child CWnd dialog from jumping upon resizing the parent window?

I'm writing an MFC dialog with multiple controls. I have currently have a CWnd that is placed on the right half of the dialog. Upon clicking an edit button, the child CWnd is resized to take up a larger portion of the dialog. However, now when I try…
Busch
  • 857
  • 10
  • 29
1
vote
2 answers

MFC PrintWindow(CPaintDC) works but PrintWindow(CDC) doesnt

I'm implementing a Printing Function in a big Project to print so called gadgets (derived from CWnd). In the Gadget Class I've created a Function to Render it to the Device Context PrintPageContent(CDC * pDC, const CRect & rContent, int page, int…
hypnomaki
  • 593
  • 9
  • 22
1
vote
1 answer

why do cx/cy from GetWindowRect(rcWindow2) differ from cx/cy fed into OnSize?

I want to get the cx and cy during OnInitDialog of a CDialog. I can do this with the following code: myDialog::OnInitDialog() { CRect rcWindow2; this->GetWindowRect(rcWindow2); CSize m_szMinimum = rcWindow2.Size(); int width =…
Fractal
  • 1,748
  • 5
  • 26
  • 46
1
vote
1 answer

Is there a way to get the Handle or CWnd* of a control using the ID of the control

If I have an MFC dialog with a button control on it, is there a way to get construct the HWND or CWND for that control using the button's ID (e.g IDC_BUTTON_YES)?
Amre
  • 1,630
  • 8
  • 29
  • 41
1
vote
0 answers

Mfc application crash in CWnd::DefWindowProc while creating Progress Control from within Worker Thread after 34 repetitive cycles on 64 bit windows

I am trying to figure out the exact reason for the crash happening in my 32 bit MFC application which is running on 64 bit system. Actually this is a multithreaded MFC SDI application and can do cyclic execution which includes Inspection and…
1
vote
1 answer

what will limit the growth of cwnd(congestion window)?

When i use tcp_probe module to collect cwnd for a TCP connection, the cwnd will stop to increase by around 1467(packets). Can anyone explain the reason for this ? or what is limiting the cwnd on earth ? The TCP connection is a download a 2G file…
Perth Charles
  • 141
  • 1
  • 1
  • 6
1
vote
6 answers

MFC: What on earth is a CSplitterWnd Caret?

What on earth is a caret in the context of a CSplitterWnd class? I can't find any documentation relating explicitly to CSplitterWnds... EDIT: Specifically, what do these functions actually do: CWnd * pCurView = m_wndSplitter2.GetPane(2,…
Konrad
  • 39,751
  • 32
  • 78
  • 114
1
vote
1 answer

In what cases can afx_msg void OnDestroy( ) aka CWnd:OnDestroy() be called?

I have a window that is created and OnDestroy() is called at some point without the user ever clicking on the 'Close' or 'X' button which closes the window. What other operations/actions/things could possibly cause this function to be called and…
Brian T Hannan
  • 3,925
  • 18
  • 56
  • 96