|
Dest2KO wrote: Well, I am creating it in unix.
But you asked in a Windows forum.
Doesn't Unix already have such a command?
http://bama.ua.edu/cgi-bin/man-cgi?00+00[^]
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Well sure.
But I am creating my own. It would help if I knew the source code of at(), though.
T.M.
|
|
|
|
|
thanks for one and all..
nice suggestion..
thanks again..
regards
|
|
|
|
|
according to the docs on MSDN, WM_SIZE is sent after a window has been sized, and WM_SIZING is sent while a window is being sized. In reality, this doesn't seem to be the case. While the edge of the window is being dragged, a WM_SIZE message is continuously being sent. Is there a way to overide this feature and have the message sent only after the mouse has been released? My WM_PAINT handler has a lot of work to do, a little too much to do before the next message is sent, causing things not to be painted in their correct positions. My solution to this is to draw a bounding rectangle for the window while the edges are being dragged and only repaint the window once the mouse has been released.
|
|
|
|
|
why dont u maintain a state variable that indicates if the mouse is being dragged and ignore the message in ur OnPaint handler
Engineering is the effort !
|
|
|
|
|
You are dealing with a windows setting. On XP: Control Panel->Diplay->Appearance->Effects->Show window contents while dragging. Clear that checkbox and WM_SIZING and WM_SIZE will work as MSDN says.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I never realised that before. Unfortunatly if I change that setting, it will be changed for all windows, not only mine, therefore I think it best not to use. Thanks anyway.
|
|
|
|
|
The documentation, and what you are observing, are entirely correct.
Use the WM_ENTERSIZEMOVING / WM_EXITSIZEMOVING messages if you want to know when the user has started/stopped sizing your window.
|
|
|
|
|
Thanks for that. Using those messages I have managed to create a smoother resizing effect without having to use a bouding rectangle like I initialy thought.
Now all I need to do is work out why the window region is causing so much flicker.
|
|
|
|
|
>>Now all I need to do is work out why the window region is causing so much flicker.
Take a look at WM_ERASEBKGND.
By default every repaint of the window, the background gets drawn, then the foreground (via your
WM_PAINT handler).
If you handle WM_ERASEBKGND (even by just returning true indicating you have handled drawing the
background) you can handle drawing the background yourself. This makes for much smoother,
flicker-free painting
Mark
|
|
|
|
|
In addition to what Mark said, if you make use of the clip box (CDC::GetClipBox) you can limit your drawing to just the areas of the window that need repainting instead of repainting the entire window every time.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hello,
anybody knows how to activate all views in MDI without going thru
CDocManager dialog?
I have tryed GetFirst... GetNext.. but it only works on views which are already active.
Ideally I like to have all templates views tilled on opening the application.
Thanks for reading.
|
|
|
|
|
POSITION pos = MyApp.GetFirstDocTemplatePosition();
while (NULL != pos)
{
CDocTemplate *pTemplate = MyApp.GetNextDocTemplate(pos);
pTemplate->OpenDocumentFile(NULL);
}
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
|
i have a 1000*1024 8bit UINT8 array
how can i save it as a bmp or tiff file??
the size of the picture is fixed, as simple as possible, just an array with fixed size and bitsize.
and need to be saved as fast as possible
thanks alot!
|
|
|
|
|
For BMP...
Initialize and write
1) a BITMAPFILEHEADER structure
2) a BITMAPINFO or BITMAPCOREINFO structure
3) the image bytes from your array
For TIFF (and BMP and others) you could use GDI+
1) Create a GDI+ Image object from your image data bytes
2) Use Image::Save() to save in a variety of formats
Mark
|
|
|
|
|
Assuming the bytes are in the right order, use CreateFile() to create/open the file, and use WriteFile() to write to the file.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all my friendz,
i'm developing an application to check multiple mail accounts. I use Iwebbrowser2...and so IE to browse mails.
Now I'm considering a problem. Suppose a person who uses my tool has an instance of IE open...and suppose he has just controlled his mail(without logging out)...my tool starts its check but goes directly inside the account(does not find login page)...and so the tool does'nt find the page it expect to find and fails.
Even if i delete the cookie associated to that account before running the check, if another IE browser instance is open the information remains! (i think in index.dat).
So there is some way to go in any case at login page, without considering the informations in index.dat or cookies???...
please help (
|
|
|
|
|
I am opening a file in readwrite and shareexclusive mode, but later want to change this to different access and share modes, but can't figure out how to do it. I tried using SetStatus but it doesn't seem to work (I think I don't know how to set the m_attributes correctly)... I am currently closing the file and reopening it, which feels like a cludge to me! Any suggestions?
First time opening file:
CFile writeFile;
writeFile.Open(curFile, CFile::modeCreate | CFile::modeReadWrite | CFile::shareExclusive, &fileException)
Then I close and reopen:
writeFile.Close();
writeFile.Open(curFile, CFile::modeRead | CFile::shareDenyWrite, &fileException);
The SetStatus code that is NOT working is:
CFileStatus status;
writeFile.GetStatus( status );
status.m_attribute = status.m_attribute | writeFile.readOnly;
writeFile.SetStatus( curFile, status );
Thanks in advance!
|
|
|
|
|
The open flags are not the same as the file status flags.
Try ReOpenFile() on the m_hFile member of the CFile instead of closing and reopening.
Never mind ReOpenFile() is Server 2003 or better
Mark
|
|
|
|
|
Hey thanks! Do I still need to close the file first?
|
|
|
|
|
>>Do I still need to close the file first?
Looks like it, unfortunately. Even ReOpenFile won't let you change the sharing mode without
closing the handle first. At least that's what I gathered from the SDK.
I'd say closing and reopening is the only way to go ... I may be wrong
Mark
|
|
|
|
|
Need to know if I can directly access elements in an STL array based on the Iterator ..
As for eg
List contains { 1,2,3,4,5,6,7,8 }
if List::Iterator iter = List.begin()
Now to access nth element can the routine be like
int GetElementAt( int index)
{
// range check
iter = List.begin();
iter+=index;
return *iter ;
}
Engineering is the effort !
|
|
|
|
|
act_x wrote: Engineering is the effort !
what happened when you tried it?
cje
|
|
|
|
|
A std::list isn't an "array" and list iterators don't support random access. Vector and deque iterators support the += operator.
|
|
|
|