|
You might try this..
BOOL CTimerDlg::OnInitDialog()
{
CTimerDlg::OnInitDialog();
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, TRUE) <-- change the FALSE to TRUE
Hope it helps
Rob
|
|
|
|
|
|
I've implemented double-buffering in a custom CWnd-derived control with horizontal and vertical scrollbars to eliminate flickering.
The final touch to this, to keep the parent dialog from causing flicker on my control, is to set the dialog's WS_CLIPCHILDREN flag to TRUE (using the resource editor, select "Clip Children").
In doing this, though, I've found that no matter what I do, when I resize, the area usually occupied by the scrollbar buttons is a "smear" of the last contents of the new area that the buttons should occupy.
Refreshing by dragging a window over the button and away causes them to redraw again, so I get the feeling that some vital message is not being passed from the dialog to my control on resizing... but I can't figure out what that message would be!
I've been tearing my hear out on this for three days now, so it's time for me to hear from someone who has gone through this before. Any help is extremely welcome, even if it comes in the form of thought-provoking questions.
Thanks.
Tom Guyette
|
|
|
|
|
Make sure you set repaint to TRUE when you resize your child window (assuming you are using MoveWindow() here).
Chris
|
|
|
|
|
Holy shinola!
I can't believe that in a single sentence you solved five days worth of tearing my hair out. Chris, you're my hero. If there's ever anything I can do to repay the favor, please let me know.
-- Tom Guyette
guyette@alum.wpi.edu
|
|
|
|
|
How do you change the backgournd color of a console application from the default black to a different color. I looked at the few SetConsol... functions in the help but none of them seemed to deal with the background color.
<marquee>Raffi
|
|
|
|
|
Start with SetConsoleTextAttribute...
Best Regards....
and for ever
Carlos Antollini.
|
|
|
|
|
My Help Says:
The SetConsoleTextAttribute function sets the foreground (text) and background color attributes of characters written to the screen buffer.
I could be wrong but doesnt SetConsoleTextAttribut change the foreground and background of the text characters? I want to change the entire screen to a color. Can SetConsoleTextAttribute do that and I am reading it wrong?
<marquee>Raffi
|
|
|
|
|
use SetConsoleTextAttribute to change the background color
Now simulate a "CLS"
once you clear the screen, your screen will entirely be of the bg color you set
as to simulating the "CLS" the easy way is to out put 25*80 spaces; then use SetConsoleCursorPosition to position the cursor on top
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Try using FillConsoleOutputAttribute to fill the console with the preferred colorattributes
/moliate
printf("Hello World ");
HANDLE hStdout = GetStdHandle( STD_OUTPUT_HANDLE);
WORD wColor = BACKGROUND_BLUE |
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_INTENSITY;
COORD coord;
coord.X = 0;
coord.Y = 0;
FillConsoleOutputAttribute(
hStdout,
wColor,
80*50,
coord,
NULL);
|
|
|
|
|
that worked. ty very much!
<marquee>Raffi
|
|
|
|
|
i subclassed the CListBox and override this two functions
BOOL CListBoxTrans::OnEraseBkgnd(CDC* pDC)
{
// TODO: Code für die Behandlungsroutine für Nachrichten hier einfügen und/oder Standard aufrufen
return true;
//return CListBox::OnEraseBkgnd(pDC);
}
HBRUSH CListBoxTrans::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Attribute des Gerätekontexts hier ändern
// TODO: Pinsel ungleich NULL zurückgeben, falls die Behandlungsroutine des übergeordneten nicht aufgerufen werden soll
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)::GetStockObject(NULL_BRUSH);
//return NULL;
}
So now my ListBox is transparent , but if i have to scroll the box or i select an item in the box
the transparent effect is damaged . There is a really missmatch on the listbox .
What do i have to do , that selecting items and scrolling will work in my transparent ListBox ?
|
|
|
|
|
If your listbox is transparent then you should be telling the parent to repaint in the way that you require. Invalidate the rectangle in the parent where the transparent control is.
Though there is another way, rather than have your listbox transparent, which can cause you extra typing because of z order painting problems, pass the background rectangle (on move or resize of the parent) to the child (your control) and stick the background in. Then of cause you are back in a world where the listbox can take care of itself.
We do it for the joy of seeing the users struggle.
|
|
|
|
|
Hi all,
What is best way to enable or disable button in toolbar ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
CToolBarCtrl::EnableButton
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hi Nish,
But i used CToolBar class ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
use CToolBar::GetToolBarCtrl to get the underlying CToolBarCtrl object
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
So GetToolBarCtrl() is function for using CToolBarCtrl class ...
Thanks alooooooooot for your helps
I have other theory question, which is better to use ?
CToolBarCtrl or CToolBar
Thanks again for your helps !
Best Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi_Rezaie wrote:
I have other theory question, which is better to use ?
CToolBarCtrl or CToolBar
See this URL
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_methods_of_creating_a_toolbar.asp
It explains the differences and suggests when you should use what.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
I want to knnow how you can use CDC::LineTo in conjunction with Alpha Blending.
My first approach was to do the LineTo into a temporary CDC and then use alpha blending
to copy it to the intended CDC, but when I do so I also copy the black background of my CDC.
I'm stuck!
|
|
|
|
|
Look at the WDJ site, I have an article with code for download there regarding alpha blending. Your other option is GDI+, again my articles here cover that side of things. To alpha blend your line, you'd be better off doing your own code to calculate the line and doing the blend directly. Otherwise you're bound to blend on bits you didn't draw to, and you know the value to blend already ( the colour of the line ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
hi all,
how can i get the ip of my internet/network adapter using the mfc libs ?
is there perhaps a regestry value which is set if i connect to the internet ?
please send me an email if u have a clue : weazel22@gmx.de
thanx and greetinx,
weazel
|
|
|
|
|
|
How do i set the ip address to local network adapter
|
|
|
|
|
How do i set the ip address to local network adapter using SNMP
|
|
|
|