|
Hi,
Currently you're using only client area of the window (that's why you removed caption/borders), did you try to use WM_NCPAINT instead of WM_PAINT?
In WM_NCPAINT you can erase/paint entire window area, discarding its default painting proc for caption and borders. This way you could probably save your sizing borders.
Best regards
|
|
|
|
|
I hava a programme that coulde transparence the window/dialog in 2000/XP, it use the SetLayeredWindowAttributes function to transparence window/dialog.But, the function coudle only transparence window. And i want transparence the client area in SDI/MDI. Who can tell i how to do it?
|
|
|
|
|
|
You can do it in a handler for WM_ERASEBKGND.
By just returning TRUE this will prevent any background from being drawn.
BOOL CMyMDIWnd::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
|
|
|
|
|
Hi,
I have created a sdi in which the view is divided into three panes.Now i want to color the splitter bar,splitter box,borderetc.For that i have written a function like following in a class derived from CSplitterWnd.
void CMCSplitterWmd::OnDrawSplitter(CDC* pDC,ESplitType nType,const CRect& rect)
{
CBrush brush;
CBrush *ptrBrushOld;
if(pDC == NULL)
{
CSplitterWnd::OnDrawSplitter(pDC, nType, rect);
return;
}
switch(nType)
{
case splitBox:
{
VERIFY(brush.CreateSolidBrush(RGB(128, 255, 0)));
break;
}
case splitBar:
{
VERIFY(brush.CreateSolidBrush(RGB(128, 255, 0)));
break;
}
case splitIntersection:
case splitBorder:
{
CSplitterWnd::OnDrawSplitter(pDC, nType, rect);
return;
}
}
ptrBrushOld=pDC->SelectObject(&brush);
pDC->Rectangle(rect);
pDC->SelectObject(ptrBrushOld);
}
Now my doubt is ,where to call this function in mainframe class.Is this necessary to call this function in mainframe class.
Thanks
|
|
|
|
|
Hi,
I have an application that uses multiple threads in order to perform a calculation. When run on a multicore processor there does not seem to be any increase in speed. Is it a misconception to expect the operating system will split a multi threaded applications to different core's automatically?
Regards,
Ingo
|
|
|
|
|
Hi,
AFAIK, windows system doesn't split cores between different threads, but instead it split cores between processes. In order to assign specific core to a specific thread, you should use SetThreadAffinityMask . Before you set new affinity mask for thread, you should obtain current affinity mask for entire process (GetProcessAffinityMask ), and of course, affinity mask of your thread can only be a subset of mask of your process.
In order to specify new affinity mask for your process, use SetProcessAffinityMask .
Before you change anything, try to read multiple MSDN documents about: Multiple Processors, Processes and Threads, etc...
Regards
|
|
|
|
|
Thanks for the reply. This seems to confirm my observations. I'll probably try OpenMP hoping they will do the windows specific stuff right.
|
|
|
|
|
I create a simple DialogBox with the "Designer"
Then i create the variables to the components and call the DialogBox like this:
MyDialog* dialog = new MyDialog(NULL);
dialog->DoModal();
delete dialog;
The window opens, but nothing is accessible, even i can't slide the window.
If i switch to another window for example IE, the DialogBox is still there in Top-Position
The Dialog is like frozen
Anyone an idea?
Thanks
|
|
|
|
|
I don't see anything wrong with your code. Can you just tell or post some code about how are you going with the creation of the dialog and why do you pass NULL in the constructor?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
normally i pass "this" in the constructor
I think i'll post my question to the forum of the Toolkit that i use.
It's propably a side effect
Thanks nevertheless
|
|
|
|
|
i don't see anything wrong either.
but why are you allocating the dialog on the heap ?
why no just doing this :
MyDialog dialog = MyDialog(NULL);
dialog.DoModal();
BTW, isn't your window "frozen-like" due to a huge process called by OnInitDialog() ?
if you have such treatments to do, you should consider delegate these by worker threads...
|
|
|
|
|
Hi,
I don't know if this or a similar question is already asked, the search function only gave a .jar-article, so I try to ask on my own.
In a project I have to compress and copy files to a remote computer which should work without any user interaction, and so I'm now asking for a way to do that.
The whole program should run under Windows XP, which can read ZIPs, but are there system libraries to generate ZIPs, or do I need special programs / libraries to zip them? Can I zip files under C++ or do I have to call standard programs nevertheless?
And regarding the transfer, is there an easy way to initiate a non-interactive ftp-transfer of the zip-file after zipping has finished? Can I use the ftp-Program included in windows giving special command line options or do I need a special ftp-library to transfer that file to the remote server?
I'm using MS Visual C++ 6.0 under Windows XP (SP2 installed), if this info is important...
Thanks in advance for your help
Martin Dietz
|
|
|
|
|
Hi,
I recommend you to look at this: 7-zip
It is 7-zip's LZMA SDK, and I think it should fit your needs.
Best regards
|
|
|
|
|
Hello Galatei,
The problem with 7-zipped files will be that the partners in Jena need a special program to uncompress the files we are sending to them. This was the main reason why I asked about the ZIP-format as this can be uncompressed by windows alone. I can test if I can make use of the 7-zip libraries and ask Jena if they are willing to install an extra decompression program, but in the meantime I hope someone can help me with the ZIP compression...
Thanks anyway
Martin Dietz
|
|
|
|
|
Have a look at InfoZip. AFAIK, both Winzip and java.util.zip is based on InfoZip
http://www.info-zip.org/[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
m.dietz wrote: In a project I have to compress and copy files to a remote computer which should work without any user interaction, and so I'm now asking for a way to do that.
I recomend to use zLib.
It is open source, thoroghly tested and known to work very well with almost every Zip-Tool
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
|
I use the following code to draw an icon on the Window.
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP), IMAGE_ICON, m_nButtonWidth, m_nButtonHeight , LR_DEFAULTCOLOR);
::DrawIconEx(hDC, 2, 2, hIcon, m_nButtonWidth, m_nButtonHeight, 0, NULL, DI_NORMAL);
This draws the icon on the Window. But my problem is that my window has a gradient background and my icon has a white background so when I draw the icon, the square shape of the icon with the white background is visible. I want to make the white portion of the icon transparent so that my Window background is visible. How do I do it?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
if you run this code what happens?
<br />
HICON hIcon = LoadIcon(AfxGetApp()->m_hInstance,(LPCTSTR)IDR_MAINFRAME);<br />
::DrawIconEx(GetDC()->m_hDC, 2, 2, hIcon, 32, 32, 0, NULL, DI_NORMAL);<br />
<br />
|
|
|
|
|
No changes. The problem still exists.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
oh yes ,I think you cant show icon on windows yes I see your problem but change background of icon to default color
|
|
|
|
|
Hi,
To simply draw icon with transparent background, you should apply AND mask to icon, where 1's specify transparency. For example: in VisualStudio editor, there's a color in color table, which looks like monitor with greeny background. By using this color, you specify which pixel are supposed to be transparent.
Finally, in DrawIconEx function you should specify DI_NORMAL effect mask to draw icon image as well as its mask.
Hope that helps,
Regards
|
|
|
|
|
the problem is that i have a thread function
<br />
UINT threadfun(LPVOID param)<br />
{<br />
CList list = (CList)param;<br />
}<br />
and i want to pass param to this function using AfxBeginThread
<br />
AfxBeginThread(threadfun,(WPARAM)m_List); <br />
where "m_List" is from a type defined variable
<br />
typedef CTypedPtrList<CPtrList , tagPLAYLISTENTRY*> CList;<br />
the compiler generate this error:
1- 'CList' : undeclared identifier
2- syntax error : missing ';' before identifier 'list'
3- 'list' : undeclared identifier
i know he can not see this type "CList" inside the function
but what is the solution of this , and how can i make it work
thnx alot 4 ur time and concern.
|
|
|
|
|
Is this file included...
#include <afxtempl.h>
|
|
|
|
|