- Questions on MFC
- Posted by phyler on February 21st, 2006
Right now I am coding a programming that will scan a computer for mp3s
and display where they are located in a log or text file. I have built
the GUI using VS C++ MFC and things are looking good, but I wanted to
add a couple of features that I feel I am a little shaky on, so I
figured I would try my luck with you guys! Basically I want to add 2
things:
When the user clicks the scan button I would like a popup messagebox
stating the the program is infact scanning. The other function would be
a pop up that would come about after the scan has ceased. My source
code for the button is fairly basic as seen here:
void CMp3ScanGUIDlg::OnBnClickedButton2()
{
WinExec("Mp3Scan.exe", SW_HIDE);
}
I'm guessing it would be a ' if ' 'while' statement of some sorts, but
when I researched messageboxes on MSDN I couldn't quite understand how
it would work. Any ideas or help would be very appreciated. Thanks!
- Posted by Kellie Fitton on February 21st, 2006
Hi,
Well, the function WinExec() is obsolete, if you want to launch
your executable process and it's primary thread, then you should
use the following Win32 function:
CreateProcess()
Also, you can display your status text on the actual dialogBox or
create a read-only edit control and use it to display a message,
the message box will hault the execution of the program until the
user clicks a button.
http://msdn.microsoft.com/library/de...ateprocess.asp
http://msdn.microsoft.com/library/de...se/winexec.asp
http://msdn.microsoft.com/library/de...messagebox.asp
Hope these information helps,
Kellie.