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
0
votes
1 answer

MFC: Creating a class (CWnd?) with a CTreeCtrl and a CToolbar

I have a CDialog based application that has two side-by-side CTreeCtrl and both trees have nearly identical CToolbars above them. Currently, when the dialog receives a message from one of the toolbars, it passes the message to the appropriate tree.…
Steve A
  • 1,798
  • 4
  • 16
  • 34
0
votes
1 answer

How to know when a controls is going to be hidden

I have a control derived from a CWnd object that has its custom implemented tooltip system . The tooltip is implemented using a CDialog and works fine but I have a problem to know when I have to hide it. The tooltip shows up when the mouse hover…
Javier De Pedro
  • 2,219
  • 4
  • 32
  • 49
0
votes
1 answer

Getting Type Mismatch Error when calling CWnd::InvokeHelper

So I have tried to debug the program and as soon as I get into the Windows API function calls things get a little crazy, plus there isn't much help with debugging those files because I can't change them anyways. Basically what I am stuck on is the…
RAZ_Muh_Taz
  • 4,059
  • 1
  • 13
  • 26
0
votes
1 answer

paint mfc components inside cwnd

I create a cwnd class that shows a retangle with a button inside, but instead of draw a button by myself I would like to delegate to button component. As is .... class ExampleControl : public CWnd { void ExampleControl::OnPaint() { …
hnqoliveira
  • 113
  • 1
  • 1
  • 7
0
votes
1 answer

Restricting GetFocus to specific dialog and/or application

I have a MS Visual C++ project where I have a CDialog based dialog box with several edit controls. I want to highlight the control with the current focus for the user. I implemented this by getting a pointer to the window that has the current…
Mike
  • 331
  • 2
  • 9
0
votes
1 answer

DLGTEMPLATE to CWnd-derived control

Is it possible to take a DLGTEMPLATE and use it as a CWnd-derived control for placing in any other CWnd? I have a dialog template that I want to use on one of my CDockablePanes
Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
0
votes
1 answer

Creating separate MFC GUI thread, can't move/resize/maximize CWnd

I am creating a CWinThread that will have it's own GUI. When I create a CWnd on that thread, it displays, but I can't move the window. I am sure that the message pump is running, because I can performn MoveWindow from another thread, and the window…
Paul Knopf
  • 9,568
  • 23
  • 77
  • 142
0
votes
1 answer

CWnd::SetRedraw(False) make mouse go throught window

So I have a MFC application which flick when we do some action. So I figured I would set SetRedraw(false) and set it to true at the end of the function. The application doesn't refresh anymore but if I click on it while SetRedraw(false), my cursor…
Ecnerwal
  • 362
  • 1
  • 2
  • 15
0
votes
0 answers

How to create a window like CWnd (MFC) in UWP

I have a drawing application written in MFC before, now i consider to upgrade it to universal world by using UWP. The app structure is like below: structure which include: 1. App level (MFC code): file management. 2. Drawing lib (MFC code): provide…
Neo L
  • 1
  • 1
0
votes
1 answer

How to check if CWnd message map contains message id without handling message?

ParentWnd contains mfc control called modeOfOperation (drop down list). When modeOfOperation is Normal everything is normal. We added new modeOfOperation=Extreme. When modeOfOperation is Extreme I want to disable 90% of existing ParentWnd controls…
pusheax
  • 123
  • 3
  • 10
0
votes
1 answer

MFC - Minimize main MDI window only

I have main MDI window and have custom CWnd derived window which I create dynamically run-time. I want to keep that window on the screen even when main MDI window is minimized but I dont want to have top-most window. I have tried use…
IKM2007
  • 716
  • 1
  • 8
  • 31
0
votes
2 answers

How to make a dialog title right/left aligned

With the help of CWnd::SetWindowText method, I am able to set the desired caption, to my dailog based application. How can I make it left/right aligned?
Programmer
  • 329
  • 2
  • 6
  • 25
0
votes
2 answers

Static control with WS_EX_TRANSPARENT style not repainted

I am trying to create a control that implements the per-pixel alpha blend while painting a 32-bit bitmap. I extended a CWnd and use static control in the resource editor. I managed to paint the alpha channel correctly but still the static control…
Javier De Pedro
  • 2,219
  • 4
  • 32
  • 49
0
votes
2 answers

Convert CWnd* to myControl*

I am trying to convert a CWnd* pointer to a custom control pointer. The custom control just extends CEdit. Below is what I have. pWnd was passed in. it is a CWnd*. calEdit* test = (calEdit*)pWnd->GetDlgItem(pWnd->GetDlgCtrlID()); When I try to…
Jameswr.11
  • 70
  • 6
0
votes
0 answers

Creating CWnd derived control at runtime

I am trying to create CWnd derived class at runtime but CWnd::Create fails. I have no idea why. Here is minimal code that show the problem: MFCTestApplicationDlg.h #pragma once class c_CustomButton : public CButton { protected: …
IKM2007
  • 716
  • 1
  • 8
  • 31