|
DavidCrow is right. At the heart of it all, it is one window. To achieve this effect it'll have to be owner drawn, and you control all of the painting yourself.
Jeremy Falcon
|
|
|
|
|
This is probubly a bad idea but it does work.
void CTestStatusBar::OnPaint()
{
CStatusBar::OnPaint();
CRect rc;
GetItemRect(2,&rc);
rc.DeflateRect(2,2);
CClientDC CliDC(this);
CBrush brush(RGB(255,0,0));
CBrush* pOldBrush = CliDC.SelectObject(&brush);
COLORREF clr = CliDC.GetPixel(rc.left,rc.top);
CliDC.ExtFloodFill(rc.left,rc.top,clr,FLOODFILLSURFACE);
CliDC.SelectObject(pOldBrush);
}
Trust in the code Luke. Yea right!
|
|
|
|
|
Dear John,
Thanks for your suggestion. My VC dll has no MFC and wonder if there is alternative for WIN32API coding.
|
|
|
|
|
(You did not mension a DLL before.)
A lot of MFC is just wrappers for Win32 API functionality. The example I gave you was just an experiment to see how it could be done. If you wish to do it using a normal WinProc() then you will need to process the WM_PAINT message. My implimentation simply called the the default processor to allow it do its normal painting then requested (sent request messages) some information from the window, so I would be able to fill in (part of) the background [ExtFloodFill() may be to simple a solution].
Note: A Status bar is just a window containing some static controls (rectangles).
I do not know if this helped at all.
Trust in the code Luke. Yea right!
|
|
|
|
|
I have an array of pixels, and each pixel is represented by a 16-bits value. The order is from left to right and top to bottom. How can i draw them out?
Thanks
|
|
|
|
|
Hello every body
i try to put mor than 256 char in the CString viriable but i cannot, any help.
Best Regards
|
|
|
|
|
Can you provide a code snippet of how you are doing this?
|
|
|
|
|
CString query;
query=_T("select distinct globalt.Mkname,globalt.Route,globalt.Time,globalt.SI,globalt.NDV,globalt.ANBLO,Avg(globalt.Traff) AS AvgTraffic,Avg( globalt.CCONG) AS AvgCCONG \n"
"from globalt \n"
"where ((([globalt].[Route]) Like '*SS*' Or ([globalt].[Route]) Like '*I')=False");
Best Regards
|
|
|
|
|
There's only 254 characters there. What's the problem?
|
|
|
|
|
Thank u for ur reply
I know every thing appeares normal in my code, but after this step if watch this variable 'query' it equals:
"select distinct globalt.Mkname,globalt.Route,globalt.Time,globalt.SI,globalt.NDV,globalt.ANBLO,Avg(globalt.Traff) AS AvgTraffic,Avg( globalt.CCONG) AS AvgCCONG
from globalt
where ((([globalt].[Route]) Like '*SS*' Or ([globalt].[Route]) Like '*I')=Fal"
as u see some char doesnot included "se", even if i add more strings to this variable like query+="any thing" then it doesnt appeare.
so this is my problem!!!!
Best Regards
|
|
|
|
|
hi again
yes that is right there is no problem with CString. the problem was in the Watch window which could not show all char in CString.
Best Regards
|
|
|
|
|
The MFC CString will accommodate strings far longer than 256 characters. It is more likely that there is something wrong with the code that is populating the CString. Post the code if you still have problems!
|
|
|
|
|
Use the Format method:
CString s;
s.Format ("A very long string");
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
the code u posted works just fine...
|
|
|
|
|
Hi, i have a form in a VC# dll. I'm calling it inside a VC++ 6.0 MDI app. when i create an instance of the VC# dll i set the parent window (the form container) it opens... ok... nothing's wrong.. but the form can overlap the toolbar and the status bar... how can i avoid this?
NHM
|
|
|
|
|
Ok i got a problem with my object loading, i have it in text files and it loads em 1 by one ... so they get a number 0 1 2 etc. But i want to be able to do GetObj("name"); insted so i just can add a name for the objects in a file and get em that way ... So i wounder, is there any way to get this lookup about as fast as the one with numbers?... i need speed and there might be ALOT of object switching It also has to have the ability to remove and add into the object list under runtime, thats why a name lookup insted of number would be alot better
Load("Objectlist.txt");
GetObject(1); // This is the problem, if i load more/change the file it will not be in its right place when used in the program.
Load("Objectlist.txt");
GetObject("Wall"); // But as far as i know this is alot slower then using numbers in an vector or something like that
Ohh well, hope you understand what i mean and if anyone knows about the speed please tell me how much difrence it would be
|
|
|
|
|
In theory, yes, given that object names are sorted in the text file.
Kuphryn
|
|
|
|
|
Yes,but then its about the speeds, how much slower would it be to use names to look up the objects then numbers?
|
|
|
|
|
How long is the filename? Count bytes.
Kuphryn
|
|
|
|
|
The name in the string should be about 10 - 20 bytes...
|
|
|
|
|
Adding 160 elements
Add: 0 Millisecs
Starting iteration: 2000000 times.
GetByName: 58895 Millisecs
GetByPos: 4457 Millisecs
This is timings with about 25 char std::strings ... i havent optimized it much.
And using a std::vector ... damn thats alot of time! .. its timed using GetTickCount() just for the record
And btw, the time did not change if i changed the string to 1 char from 25.
The string comparation is only if(*it != Name) so far...
|
|
|
|
|
How about writing an index file?
|
|
|
|
|
Dear ALL,
I am working a program to block a physical disk (removable disk, eg c: )so that it should be inaccessible from user mode.
For hiding the disk I modified Registry settings:
1)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NODRIVES which is a 32-bit word (DWORD).
========
if i hide c: by changing above settings , the drive is hidden but i can still access it from address bar or command prompt. Is there any way to block the drive completely ??
Waiting for a positive response.
Rohit
--------Complete solution for hiding drive------
change the registry value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies
\Explorer\NODRIVES which is a 32-bit word (DWORD). The lower 26 bits of the 32-bit word correspond to drive letters A through Z. Drives are visible when set to 0 and hidden when set to 1.
Drive A is represented by the rightmost position of the bitmask when viewed in binary mode.
e.g. A bitmask of 00000000000000000000010101(0x7h)
The bitmask above hides local drives A, C, and E
---------------------------------------
|
|
|
|
|
hai rohit even i am facing the same problem ,we can still acess the drives from the command prompt.
try seeing "Browser Helper Objects: The Browser the Way You Want It" in MSDN this may help u
can u share the solution with me once u grt it thx.
qrious
|
|
|
|
|
Hi I want to send data using POST method. I use CAmHttpSocket, everything works fine, but generally how to set a timeout in case the server doesn't respond.
Please help
|
|
|
|