|
IIRC, according to the documentation you must also request a SYSMENU is you want any of the minimize, maximize or close styles.
Actually, just reading the documentation (in this case an age-old VC6 MSDN for CreateWindowsEx) it clearly states
WS_MINIMIZEBOX - Creates a window that has a Minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
Perhaps reading a little documentation would benefit us all?
|
|
|
|
|
how can i Set a CWnd object attributes to be Locked that other objects can't affect it.
for example if i have 2 CWnd object in the main window and i move one of them across another it will clean another CWnd object.
or if i draw a line in main window it will affect the CWnd object and it's contents.
how can i Lock a CWnd object againt to be affected ?
|
|
|
|
|
Think of it this way:
that CWnd is merely the class wrapping an interface to
an object owned by another application. Windows don't belong
to you, they belong to the operating system. They aren't yours
to "lock."
What that window is there to represent is something of yours
and you simply repaint the window as necessary from it.
Pedantic diatribe aside. Sounds like you are trying to prevent
the window from being invalidated (scheduled to receive WM_ERASEBKGND,
WM_NCPAINT, WM_PAINT and ilk). If it is a window that incurs a
performance hit to render, you might consider rendering to an
offscreen image that is used for paint handling and use an internal
refresh method to update the image. That's one strategy. There are
lots but it depends on what sort of problem you're trying to solve
here.
|
|
|
|
|
first thanks for your great answer and second Forgive me for my bad English
let me explain my problem:
i have Some CWnd objects. each of them contains a Bitmap and a figure that will shown on the bitmap .
plz See this AVL Tree Applet : http://www.seanet.com/users/arsen/avltree.html[^]
i can Drag and Drop this CWnd objects. Even i Drag a CWnd object and move it around if it move across another one it will Clean that CWnd object.
this objects must be transparent. it seems that the only way is to even i move the mouse i have to ReDraw all the CWnd objects.
my another problem is even i draw a bitmap in CWnd and then i do Invalidate(); it cleans that CWnd how is that possible ??
and another thing is i have no code in OnDraw function :
void CMy15View::OnDraw(CDC* pDC)
{
CMy15Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
here is the code :
<br />
<br />
CW[1]->Create(NULL, "",SS_BITMAP|WS_VISIBLE|WS_CHILD |WS_CLIPCHILDREN|WS_EX_TRANSPARENT ,CRect(100, 100, 126,126), this, 0xffff); <br />
<br />
<br />
CFont cf;<br />
cf.CreateFont (16,0,0,0,FW_BOLD|FW_EXTRALIGHT,0,0,0,DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_DONTCARE,"Arial");<br />
<br />
<br />
CBitmap b;<br />
b.LoadBitmap(IDB_BITMAP1);<br />
<br />
BITMAP bm;<br />
b.GetObject(sizeof(BITMAP),&bm);<br />
<br />
CClientDC h2(CW[1]);<br />
h2.SetBkMode(TRANSPARENT);<br />
CDC *dc=new CDC;<br />
dc->CreateCompatibleDC(&h2);<br />
dc->SelectObject(&b);<br />
<br />
<br />
h2.SetTextColor(RGB(10,50,220));<br />
h2.SelectObject(cf);<br />
<br />
h2.DrawText("13",CRect(2,5,25,25),DT_CENTER);<br />
<br />
h2.BitBlt(0,0,bm.bmWidth,bm.bmHeight,dc,0,0,SRCAND);
<br />
<br />
|
|
|
|
|
Do your painting of the window in OnDraw.
You must repaint a window whenever required.
Handle the WM_ERASEBKGND message; do nothing
and return TRUE so that your window is not
erased using its background brush.
You should probably register a new window
class for these (AfxRegisterWndClass) using
the CS_SAVEBITS style and having a null
background brush.
|
|
|
|
|
Hi!!
Can anyone tell me what are *.MAK files?? I downloaded many VC++ shareware programs from MSDN and many other sites. Many of such, contains *.MAK files somtimes with *.dsw and sometime without *.dsw.
Please tell me about the philosophy of *.MAK file i.e what it is ?? How can we generate it?? Why is it so useful OR any any other information you like to give ??
|
|
|
|
|
*.MAK are plain text files that represents MakeFiles
It contains a list of compiler settings/Instruction
It used to be helpfull, but under windows u can get away without them
U can generate one by using the option Project->Export Makefile
We used to write these stuff, but the VC++ generate it easily
For more info text edit one
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Microsoft supplies a tool called NMAKE[^]. NMAKE is an example of a 'make' tool.
Make tools use a text file that defines a set of rules and a set of dependencies. The rules define the actions required to build a program. For example, a make file may have a rule that defines how to convert a ".cpp" file to a ".obj" file (in other words, how to compile it). Similarly, it may have another rule for how to convert an ".obj" file to an ".exe" file (how to link it).
Dependencies are a list of files that depend on other files. As an example, a dependency may specify that main.obj depends on main.cpp . If main.obj doesn't exist, or is out of date with respect to main.cpp , will cause the tool to try and make it. The make tool will look for a rule on how to 'make' main.obj from main.cpp .
As others have noted, in today's world of IDE's, make files aren't used as often, since the IDE manages the build. Also, different compiler manufacturers will implement different syntax in their make files. Make files are useful though in handling build activities that the IDE doesn't handle. For example, building help files or distribution media can often be handled with a make tool.
Software Zen: delete this;
|
|
|
|
|
Hi all,
I wrote a hook application to catch Alt-Tab keyboard pressing and starting task bar also. But I can not prevent these events from performing their tasks. I want to have my application interupt showing the task bar and switching to other windows.
Can you help me for this issue?
Merry X-mas and Happy New Year!
|
|
|
|
|
http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hi everyone,
i want to learn to create gui like the one in norton antivirus(with fancy buttons and animated menu..etc) or any gui that's similar to that.. can someone suggest me a good place to start? thx in advance..
merry xmas!
|
|
|
|
|
www.codeproject.com
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Cheers
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yeah!
I don't see why people don't search CodeProject before asking?
I mean, CP is full of MFC stuff and much is GUI stuff!
Cheers and mary christmas to you and everyone else!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
As has been said, this site is full of examples of all that stuff. Plus one of our regulars worked on it, so maybe if you get stuck you should ask specific questions here.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hello!
I'm taking a couple of functions from a windows program and putting them in to my console application (with mfc) but to call one function I need a pointer to the output device. In windows this pointer pointed to a list box, but since consoles don't have those I want to write to the basic output device (like cout does). I've got
ostream* Console = NULL;
Console = ???
I can't find out how to tell the pointer that it points to the console window. Is this possible?
The functions simply get the atached printers and display the text strings.
Obseve everything, remember more...
|
|
|
|
|
Check this,
BOOL bFlag = AllocConsole();
HANDLE hnd =GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dw = GetLastError();
unsigned long i;
WriteConsole(hnd,"test", 4,&i , NULL);
|
|
|
|
|
|
I believe the top/left lines are a dark grey and the bottom/right ones are a light grey.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
No, it really alternates every pixel (diagonally) from white to light gray.
comrade
http://comrade.ownz.com/
Souz nerushimiy respublik svobodnih
Splotila naveki velikaya Rus
Dazdrastvuet sozdanniy volei narodov
Ediniy, moguchiy Sovietskiy Souz!
|
|
|
|
|
Use a pattern brush. see CBrush::CreatePatternBrush() or CBrush::CBrush(CBitmap* pBitmap) in MSDN[^] for more information.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
I want wait for 20 microseconds, How can I get this??
|
|
|
|
|
Count to 20 really fast ?
::SetTimer allows you to set a timer in 1,000ths of a second.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
You can't wait 20 microseconds using standard Windows timer. Standard Windows API has resolution of 1 ms, and AFAIK in reality it is even less precise. Mutlimedia applications use so called multimedia timer, so if you have a look at DirectX SDK (sorry, I'm not an expert in it), you will find more.
Вагиф Абилов
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
You can measure short intervals using QueryPerformanceCounter and QueryPerformanceFrequency .
I doubt that there is anything you can do in application code to delay an exact 20 microsecond interval. What do you need this for?
Software Zen: delete this;
|
|
|
|