|
that was it ! I just added a line of code in the BN_CLICKED message handler to remove the "BS_DEFPUSHBUTTON" style. The trouble was that multiple buttons showed this dark outline which looked goofy.
Thanks
|
|
|
|
|
I have a MFC MDI App, to which i have added new CDialog. Now when i pop-up the new dialog from MDI and use the controls in it, it will be using the main thread of the MDI App.
I wanted to make this new dialog run on a new thread, so that all controls in it will run on new thread and the MDI will have its main thread always free from dialog. Can anyone tell me how to do this?
Thanks
|
|
|
|
|
You need to create a UI Thread in MFC, check CWinThread for more info. You can then start your dialog in this thread.
-Prakash
|
|
|
|
|
do u have an idea of getting the filename from the handle returned by the FirstFindChangeNotification.
RabiaAslam
|
|
|
|
|
FindFirst/NextChangeNotification() don't work on files, they watch entire directories. You have to figure out on your own what changed.
You can use ReadDirectoryChangesW() to get more details change details.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
how to load an application developed in MFC in system tray of the windows taskbar.
RabiaAslam
|
|
|
|
|
|
RabiaAslam wrote: how to load an application developed in MFC in system tray of the windows taskbar.
http://www.codeproject.com/shell/CTrayIcon.asp[^]
"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
|
|
|
|
|
I would like to implement a custom caption bar with CLose, Min and Help buttons. The framework does not allow this. Any suggestions
Dave Regan
|
|
|
|
|
in WM_NCPAINT to draw it your self.
if you want different shape of caption bar, you need to draw more.
includeh10
|
|
|
|
|
Thanks for the reply.
I have hooked my CMainFrame wnd in line with a project by Paul DiLascia. In the new window process I am responding to several messages. I found that in order to display the correct tooltips I had to trap WM_NCHITTEST and where it was over my new Minimize button (original Maximize button position) return HTMINBUTTON instead. However when my new Minimize button is pressed, my new Help button is overwritten with a pressed Minimize button.
It all appears to be happening in the Default window proc.
Dave Regan
|
|
|
|
|
I'm constantly moving my laptop around to different networks, and at each place I need to change the static IP settings. I'm writing a little utility to store my various configurations and set the appropriate one when needed.
Right now I'm changing the IP settings from a batch file with the "netsh interface ip set..." command. Obviously, this is an ugly way to do it, but it works. This also makes it more difficult to add/edit my various listings.
I'm looking for a more elegant solution... and suggestions?
Thanks for any help -mutty
|
|
|
|
|
netswitcher
Google it to find downloads
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
netswitcher does much more than I need... and it also defeats the purpose of doing it myself.
|
|
|
|
|
Using VC6 on Win2K:
Given the following code:
DWORD dwFlags = OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ENABLESIZING;
CString sFile = _T("");
CFileDialog dlg(TRUE, "rc", NULL, dwFlags, "Resource Files (*.rc)|*.rc||");
if (IDOK == dlg.DoModal())
{
sFile = dlg.GetFolderPath();
}
The dialog displays, and allows me to select a file, but it asserts when I click OK.
The code is very simple and straightforward, but I get a debug assert in dlg.GetFolderPath() claiming the hwnd for the dialog is NULL. Can anyone tell me what I missed or did wrong?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
After DoModal, calling CFileDialog::GetPathName returns the file path.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
I don't think you understood the question.
Why does calling GetFolderPath() assert?
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
because it sends CDM_GETFOLDERPATH to the dialog window, which does not have a valid window to recieve it anymore.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
If the dialog box is still in scope, why doesn't it still have a valid hwnd?
EDIT - Nevermind.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
-- modified at 14:53 Saturday 31st December, 2005
|
|
|
|
|
John Simmons / outlaw programmer wrote: EDIT - Nevermind.
Were you able to resolve the problem, if yes, can you please post the solution, i am kinda interested in it
-Prakash
|
|
|
|
|
CFileDialog::GetFolderPath() is a wrapper for the CDM_GETFOLDERPATH message, and as such can only be used before the dialog is closed.
If you want just the directory part of the selected file, use CFileDialog::GetPathName() and PathRemoveFileSpec() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
so should CFileDialog::GetFolderPath() not been a protected/private member?
Thanks for the answer.
-Prakash
|
|
|
|
|
It should be a protected member. I called the function suggested by the first responder and everything is fine. :/
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's a wrapper for a message, making it protected would force you to make a new class derived from CFileDialog to call it, which wouldn't make sense.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Come quietly or there will be... trouble.
|
|
|
|
|
Well, since you can't call the damn thing anyway unless you're calling it from a derived class, I don't see that my statement is all that incorrect.
I think this stuff was written before Microsoft started getting serious about code reviews. Oh, wait...
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
-- modified at 14:51 Sunday 1st January, 2006
|
|
|
|