|
MSDN documentation for PostThreadMessage function says that "Messages sent by PostThreadMessage are not associated with a window. As a general rule, messages that are not associated with a window cannot be dispatched by the DispatchMessage function". Maybe you should not call DispatchMessage ?
|
|
|
|
|
Thank you, would you suggest something like this then
<br />
while ( m_keepThreadLoopGoing ) {<br />
if (::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE) != 0 ) {<br />
if ( !OnThreadProcess( msg.message, msg.wParam, msg.lParam ) ) {<br />
::GetMessage( &msg, NULL, 0, 0 );<br />
}<br />
}<br />
}<br />
Thanks alot
Tom
|
|
|
|
|
My appologies, there should not be a "!" infront of OnThreadProcess
|
|
|
|
|
I want to get the font metrics at runtime for the predefined fonts.
Is it possible. If yes please show me the way.
Thank you
KIRAN PINJARLA
|
|
|
|
|
See there are many api available for get the font metrics.
GetOutlineTextMetrics
GetTextMetrics
|
|
|
|
|
|
hi guys this is rocky,,,,,,
i cant understand one thing please help me to understand that........
check the code .............
// Initialize TAPI
hr = pTapi.CreateInstance((CLSID_TAPI));
hr = pTapi->Initialize();
// Look for the requested line
pEnumAddress = pTapi->EnumerateAddresses();
while ( pEnumAddress->Next(1, &pAddress, &ul) == S_OK )
{
name = pAddress->AddressName;
//if ( name == bstrLine )
//break;
pAddress.Release();
pAddress = 0;
}
// If the line was found, then make a call
if ( pAddress )
{
pCall = pAddress->CreateCall(bstrNumber,
LINEADDRESSTYPE_PHONENUMBER,
TAPIMEDIATYPE_AUDIO);
// Make the call
hr = pCall->Connect(true);
i think what this is doin there are so many numbers are here...........
i want to call only one no example 123456789 lests its hard coded how can i call this no with the above code what change i have to make for this
thnx in advance guys
Best Regards
Rocky
|
|
|
|
|
1. how can i find out if there is any file(s) under a certain directory
2. how can i simply copy a directory from 1 location to the other
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: how can i find out if there is any file(s) under a certain directory
Check out FindFirstFile(..)
YaronNir wrote: how can i simply copy a directory from 1 location to the other
You have to do it...
Use FindFirstFile(..) and FindNextFile(..) to know the files and sub-directories in the folder and duplicate the same in the source location (ie., read the content and open a file with the name in the source location and write the content as on..)
Do your Duty and Don't expect the Result
|
|
|
|
|
YaronNir wrote: 2. how can i simply copy a directory from 1 location to the other
For moving directories, you can use MoveFile() or MoveFileEx()
For copying directories, you can use CopyFile() or CopyFileEx()
-- modified at 8:01 Thursday 10th August, 2006
|
|
|
|
|
I guess he is intrested in copy the file..
if so use CopyFile(..) or CopyFileEx(..)
right now i found these APIs
Do your Duty and Don't expect the Result
|
|
|
|
|
You are right, the question is about copy a directory, not to move it. Sorry
|
|
|
|
|
For #1 - try PathIsDirectoryEmpty(...) since you asked about finding if any files exist, not how to enumerate them. This function also does the right thing by ignoring the . and .. directories.
For #2 - MoveFile(...) , MoveFileEx , and SHFileOperation(...) can all move directories. Which one you use depends on what kind of directory, how it needs to be moved, and where (same drive, same machine, or different ones).
-- modified at 7:55 Thursday 10th August, 2006
Doh! As WhiteSky pointed out, you asked about Copying a directory. SHFileOperation can copy an entire directory, but the other two functions I suggested cannot (at least, not without tricking the system under certain situations).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I think he needs to CopyFileEx instead MoveFile
|
|
|
|
|
Doh! Copy! You are correct! Post updated.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
will try that!
thanks
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
FO_COPY instead FO_MOVE in SHFileOperation(&foperation)
|
|
|
|
|
James R. Twine wrote: ...not without tricking the system under certain situations).
What tricks are involved?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Obvious things like preventing the deletion part of the move operation that normally takes place after the copy portion (cross-drive/system moves).
Hooking the API, renaming the source file or making it read-only inbetween the time it is copied but before the source file is deleted...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
use Handle handle=FindFirstFile(...)
|
|
|
|
|
You have to be careful about doing that - you do not want to match the . or .. directories and assume that the directory is not empty.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
WhiteSky wrote:
use Handle handle=FindFirstFile(...)
ShFileOperation will take care of this!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
YaronNir wrote:
1. how can i find out if there is any file(s) under a certain directory
PathFileExists YaronNir wrote: 2. how can i simply copy a directory from 1 location to the other
ShFileOperation
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|