Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Want to make buttons that can't get focus Pin
Rob Manderson13-Jan-04 23:00
protectorRob Manderson13-Jan-04 23:00 
GeneralRe: Want to make buttons that can't get focus Pin
ohadp13-Jan-04 23:35
ohadp13-Jan-04 23:35 
GeneralGet time of a file Pin
Cedric Moonen13-Jan-04 20:37
Cedric Moonen13-Jan-04 20:37 
GeneralRe: Get time of a file Pin
algol13-Jan-04 21:17
algol13-Jan-04 21:17 
GeneralRe: Get time of a file Pin
murali_utr13-Jan-04 21:20
murali_utr13-Jan-04 21:20 
GeneralRe: Get time of a file Pin
Cedric Moonen13-Jan-04 21:25
Cedric Moonen13-Jan-04 21:25 
Generalhelp in MDI needed Pin
Ruchit Sharma13-Jan-04 20:32
Ruchit Sharma13-Jan-04 20:32 
GeneralRe: help in MDI needed Pin
Antti Keskinen14-Jan-04 1:08
Antti Keskinen14-Jan-04 1:08 
Humm..

First, in order to show or hide a window, you can use the ShowWindow method of the MFC's CWnd class. All windows (basically) support this method call, so you can show/hide a window by issuing the call with a parameter SW_SHOW/SW_HIDE.

The docking system of a window follows a very simple logic: each time the window is moved (WM_MOVE), it checks whether the window is in range X from the window/control/button/whatever it is supposed to dock with. If it is, the window's moving rectangle is repositioned to the docking position. If it is not, the rectangle follows the mouse as it normally would.

You could try to derive from CControlBar instead of CMDIChildWnd. This approach would require you to write extensive drawing code in order to make it work properly. Alternative approach would be to hack the MFC source code and copy the EnableDocking method and it's implementation away from the CControlBar class, and implement it to your CMDIChildWnd-derived class. This approach would require considerate planning and testing that the feature works correctly.

The bad thing is that in the first method, you will lose the benefits of CMDIChildWnd, and in the second method, you might end up doing lots of extra work.

I understood that your MDI application has three child windows, and each of these child windows displays one view. Is this correct ? If so, just create a CListCtrl to hold the index, color swatch and RGB values. If you implement a custom-derived CListCtrl, you can 'paint' the middle cells with a color instead of text, and let the original implementation handle the other cells. Main idea would be that when you insert data into the middle cell, then instead of writing it as text, your control paints it as a rectangle filled with the specified color.

Perhaps you should look at the DrawItem method of CListCtrl to see if it suits your needs. Also, see this article[^] for some help.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralAnimate button Pin
Member 64882813-Jan-04 19:30
Member 64882813-Jan-04 19:30 
GeneralRe: Animate button Pin
ohadp13-Jan-04 21:41
ohadp13-Jan-04 21:41 
GeneralVirus Scanner Pin
fordge13-Jan-04 19:24
fordge13-Jan-04 19:24 
GeneralRe: Virus Scanner Pin
Alexander M.,14-Jan-04 4:05
Alexander M.,14-Jan-04 4:05 
GeneralRe: Virus Scanner Pin
David Crow14-Jan-04 5:09
David Crow14-Jan-04 5:09 
GeneralRe: Virus Scanner Pin
fordge14-Jan-04 12:46
fordge14-Jan-04 12:46 
GeneralRe: Virus Scanner Pin
David Crow15-Jan-04 3:34
David Crow15-Jan-04 3:34 
GeneralCHTTPFile SendRequest. Pin
murali_utr13-Jan-04 19:02
murali_utr13-Jan-04 19:02 
GeneralI Got it Pin
murali_utr13-Jan-04 21:23
murali_utr13-Jan-04 21:23 
GeneralRe: CHTTPFile SendRequest. Pin
22491713-Jan-04 21:29
22491713-Jan-04 21:29 
GeneralCFileDialog Pin
Member 80845913-Jan-04 17:28
Member 80845913-Jan-04 17:28 
GeneralRe: CFileDialog Pin
22491713-Jan-04 21:41
22491713-Jan-04 21:41 
GeneralRe: CFileDialog Pin
Christian Graus13-Jan-04 17:28
protectorChristian Graus13-Jan-04 17:28 
GeneralRe: CFileDialog Pin
TWS_Dave13-Jan-04 23:26
TWS_Dave13-Jan-04 23:26 
GeneralDisable ASSERTS Pin
misha_grewal13-Jan-04 16:55
misha_grewal13-Jan-04 16:55 
GeneralRe: Disable ASSERTS Pin
Christian Graus13-Jan-04 17:24
protectorChristian Graus13-Jan-04 17:24 
GeneralRe: Disable ASSERTS Pin
Rob Manderson13-Jan-04 23:06
protectorRob Manderson13-Jan-04 23:06 

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.