Click here to Skip to main content
16,005,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: An memory management problem ? Pin
Tim Smith26-Apr-02 14:27
Tim Smith26-Apr-02 14:27 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 19:11
yarp26-Apr-02 19:11 
GeneralDisplaying a bitmap without a windows frame. Pin
Del26-Apr-02 6:27
Del26-Apr-02 6:27 
GeneralRe: Displaying a bitmap without a windows frame. Pin
Carlos Antollini26-Apr-02 6:55
Carlos Antollini26-Apr-02 6:55 
GeneralSDI- Exit button on caption Pin
Stan the man26-Apr-02 6:19
Stan the man26-Apr-02 6:19 
GeneralRe: SDI- Exit button on caption Pin
lucy26-Apr-02 6:39
lucy26-Apr-02 6:39 
GeneralRe: SDI- Exit button on caption Pin
Paul M Watt26-Apr-02 7:11
mentorPaul M Watt26-Apr-02 7:11 
GeneralBrush origin differences between Windows 2000 and XP Pin
Gary Wheeler26-Apr-02 5:22
Gary Wheeler26-Apr-02 5:22 
I've got an MFC app that uses pattern brushes to display a background within dialogs. There seems to be different behavior between Windows 2000 and XP regarding the brush origin Confused | :confused: . The brush is set in the WM_CTLCOLOR handler OnCtlColor as follows:
<nobr><br />
CPoint	origin(0,0);<br />
pDC->SetBkMode(TRANSPARENT);<br />
UnrealizeObject((HBRUSH)_BackgroundBrush);<br />
CRect rect;<br />
if (GetStyle() & WS_CHILD) {<br />
    GetParent()->GetWindowRect(&rect);<br />
}<br />
else {<br />
    GetWindowRect(&rect);<br />
}<br />
origin = rect.TopLeft();<br />
pWnd->ScreenToClient(&origin);<br />
pDC->SetBrushOrg(origin.x,origin.y);<br />
hbr = (HBRUSH)_BackgroundBrush;<br />
</nobr>


_BackgroundBrush is initialized elsewhere. This code is used in two dialogs; a main dialog, and then a second dialog that is 'embedded' within the main (it has the WS_CHILD style).

The problem I'm having is this. On Windows XP, the brushes all line up, and the bitmap pattern looks seemless across both the main dialog and the embedded one. On 2000, button controls (including group boxes) and statics do not align correctly Poke tongue | ;-P . Supposedly Windows NT and its successors align brushes automatically, but I've found that they don't always do it correctly.

Any help would be much appreciated.

Gary Wheeler
GeneralWTL Support Pin
Tom Archer26-Apr-02 5:14
Tom Archer26-Apr-02 5:14 
GeneralRe: WTL Support Pin
Tim Smith26-Apr-02 5:48
Tim Smith26-Apr-02 5:48 
GeneralRe: WTL Support Pin
Tom Archer26-Apr-02 5:57
Tom Archer26-Apr-02 5:57 
GeneralRe: WTL Support Pin
Tim Smith26-Apr-02 6:52
Tim Smith26-Apr-02 6:52 
GeneralRe: WTL Support Pin
Tom Archer26-Apr-02 7:39
Tom Archer26-Apr-02 7:39 
GeneralIcons ! Pin
HenrikO26-Apr-02 5:05
HenrikO26-Apr-02 5:05 
GeneralRe: Icons ! Pin
Michael P Butler26-Apr-02 5:10
Michael P Butler26-Apr-02 5:10 
GeneralRe: Icons ! Pin
Roger Allen26-Apr-02 5:55
Roger Allen26-Apr-02 5:55 
GeneralRe: Icons ! Pin
Mark A26-Apr-02 6:22
Mark A26-Apr-02 6:22 
GeneralRe: Icons ! Pin
lszyn10-May-02 16:08
lszyn10-May-02 16:08 
QuestionHow to setup additional rights on directory at runtime ? Pin
Sasa Kajic26-Apr-02 4:59
Sasa Kajic26-Apr-02 4:59 
GeneralWindow Class Encapsulation and WNDPROC Pin
qmuffs26-Apr-02 4:56
qmuffs26-Apr-02 4:56 
GeneralRe: Window Class Encapsulation and WNDPROC Pin
Joaquín M López Muñoz26-Apr-02 5:00
Joaquín M López Muñoz26-Apr-02 5:00 
GeneralRe: Window Class Encapsulation and WNDPROC Pin
qmuffs26-Apr-02 6:31
qmuffs26-Apr-02 6:31 
GeneralRe: Window Class Encapsulation and WNDPROC Pin
alex.barylski26-Apr-02 8:14
alex.barylski26-Apr-02 8:14 
GeneralRe: Window Class Encapsulation and WNDPROC Pin
qmuffs26-Apr-02 8:40
qmuffs26-Apr-02 8:40 
GeneralRe: Window Class Encapsulation and WNDPROC Pin
qmuffs26-Apr-02 9:21
qmuffs26-Apr-02 9:21 

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.