|
Johpoke wrote: How should i place that in MS visual c++ in a new win32 console project?
You need to create a Win32 GUI project.
|
|
|
|
|
thanks a mil
/Johannes
|
|
|
|
|
In my program can i easily add mfc support?
/Johannes
|
|
|
|
|
hi, this is my first live project. i am naive to VC++. i have to implement AES. As per my knowledge it uses symetric key + cipher for encryption and decryption.i have done a lot of study and getting confused a bit. please guide me how to generate that symetric key of 128 bit length. Is there any API or any self made method for generating this key and what should be my approach ??.Thankx so much in advance.it wud be so kind of u if u plz send me answer at my e-mail id.i have very critical dead lines.plz help.
|
|
|
|
|
|
Detecting mouse buttons itself is quite easy, but there an equaly easy way to detect if the mouse button is being held down for a period of time?
My method is to launch my own message loop, but if an error occurs it would kinda mess up the whole program. Please take a look at my code and if you see any potential probems, please point them out.
do
{
if ( ! ::GetMessage( &msg, 0, 0, 0 ) )
break;
if ( ::CallMsgFilter( &msg, MSGF_SCROLLBAR ) )
continue;
pt = msg.pt;
::ScreenToClient(m_hWnd,&pt);
if (msg.message == WM_LBUTTONUP)
HandleMouseUp(pt);
else if (msg.message == WM_MOUSEMOVE)
HandleMouseMove(pt);
else if (msg.message == WM_TIMER)
{
if ( bFirstRun )
{
bFirstRun = false;
for ( int i=0; i<50; i++ )
{
::Sleep(10);
MSG peek;
if ( PeekMessage(&peek,m_hWnd,WM_LBUTTONUP,WM_LBUTTONUP,FALSE) )
break;
}
continue;
}
HandleMouseDown(pt);
}
else
{
::TranslateMessage( &msg );
::DispatchMessageW( &msg );
}
} while ( msg.message != WM_LBUTTONUP );
|
|
|
|
|
Every time I see the Sleep function in user-interface code I know there has to be a better way. You NEVER, except under most unusual circumstances, want to Sleep in a user-facing thread.
Kudos to you for using CallMsgFilter. Been reading Raymond Chen?
What I would suggest would be rewriting it: (pseudocode)
WM_LBUTTONDOWN:
set a timer for 500ms
WM_LBUTTONUP:
kill the timer
WM_TIMER:
kill the timer
post / send / call a OnMouseHold handler
Much simpler, no Sleep()s, and unless I missed something it should work.
Mike
|
|
|
|
|
Hello,
I'm a newbie in computer programming.
I'm looking for a program help me to change file attributes(Created time,Modified time and last access) like FileDate By T.YogaRamanan.
Here is link :
http://www.codeproject.com/file/FileDate.asp[^]
But I want to ignore its user interface.(No Dialog box , No Text box)
I want to choose file as coding and change file attribute as coding too.
I have tried to read source code of FileDate above.
I still can't do.
Can you help me ?
Thank you.
|
|
|
|
|
Welcome
SetFileAttributes for attributes
SetFileTime for set date and time(your purpose)
SetFileShortName for set shor name
|
|
|
|
|
Any one can code it for me ?
|
|
|
|
|
|
Sure !
I want something like that.
But I want to choose file by coding, not Dialog box.
And set time by coding, not text box.
Can you modify it for me ?
Thank you.
|
|
|
|
|
If you see inside that exmaple you understand how do you change it.See OnBtnApply and SetFileDateTime on that example
|
|
|
|
|
|
Hi,
May I ask you again?
In source code of FileDate.
covered by void CFileDateDlg::OnBtnApply()
////////// created date & time ///////////////////////////////////////////////////////
// get the date & time from the CDateTimeCtrl s as COleDateTime
((CDateTimeCtrl*)GetDlgItem(IDC_DATECREATED))->GetTime(coleDate);
((CDateTimeCtrl*)GetDlgItem(IDC_TIMECREATED))->GetTime(coleTime);
Right ?
How can I replace it by my specific time.
Can you give me this code?
Thank you again.
Really thanks.
|
|
|
|
|
toeh wrote: Can you give me this code?
This is the third time for you to ask this question in the same thread.
The forum users are not here to do the work for you, give you code samples or modify existing code. We will sometimes give a code example if we want to explain something, sometimes we will re-write your own attempts if we see a problem. But under no cicumstances will anybody here answer a question like "I want this..." and give you a fully working project. In my opinion it is down right rude of you to even ask!
This website is teaming with articles, source codes, examples and projects. If you can't find what you are looking for, we will be more than happy to provide a link to something appropriate. But you must do the work on your own.
|
|
|
|
|
toeh wrote: I'm a newbie in computer programming.
Which means you should start with a very basic program. Why jump into the deep end of the pool when you can't even swim yet? Deciphering an existing MFC application is not practical at this point.
Start a new project with Visual Studio. I would go with a Win32 Console Application. You can opt for MFC support but that is not necessary. Give your project a name. Open the .cpp file that has the main() function in it. Now you can make calls to functions like SetFileAttributes() and SetFileTime() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
without mfc, how?
thanks in advance
|
|
|
|
|
try
int iHeight = ::GetSystemMetrics(SM_CYCAPTION);
|
|
|
|
|
sir,
I want to know something about the function signature.
Thanks
|
|
|
|
|
Buy a book. Seriously, if you don't know what a function signature is, you're at the most elementary level, and you need to work through a book before starting to ask questions here.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If you dont like to buy a book I suggest search learning c++ on the internet and you can find many helpful sites
|
|
|
|
|
amaneet wrote: I want to know something about the function signature.
well, i keep posting questions for help here in CP but i haven't seen anyone asking more elementary question than this in CP..
vijay.
|
|
|
|
|
amaneet wrote: I want to know something about the function signature.
Such as?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sir,
what is the difference between procedure oriented programming , structure oriented programming , object oriented programming.
Thanks
|
|
|
|