|
Hello, folks,
I set a file association programmically. point the DefaultIcon key value to a .ico file. but after my setting operation. the icon is not be shown with the associated file. but, i noticed that the msi installer can refresh the explore and enable the associated icon with files after installing?
How to enable the setting immediately? what API should i call?
Thanks,
hawk
|
|
|
|
|
UpdateWindow(handle_to_desktop_window)
|
|
|
|
|
I got the answer, refresh explorer by using SHChangeNotify() .
|
|
|
|
|
Hi
I have written a Dialog based Application in VC++ 2008 and also I made some Modeless Dialogs which are created in response of Button Click.
I want my parent Dialog (main Dialog) to be notified of Child Dialog's destroy so I use the below code But It doesn't do any thing while child dialog is closed or destroyed.
void CMyAppDlg::OnParentNotify(UINT message, LPARAM lParam)
{
CDialog::OnParentNotify(message, lParam);
if ((LOWORD(message) == WM_DESTROY))
{
if((HWND)lParam == _mChildDlg->m_hWnd){
::AfxMessageBox(_T("My Code here"));
}
}
}
|
|
|
|
|
How does the child dialog tell the parent it is closing? It won't happen automatically.
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
According to the MSDN CWnd::OnParentNotify
A parent's OnParentNotify member function is called by the framework when its child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window.
So I think It should work. if not so what should I do?
|
|
|
|
|
From the same link you have given...
[quote]
All child windows except those that have the WS_EX_NOPARENTNOTIFY style send this message to their parent windows. By default, child windows in a dialog box have the WS_EX_NOPARENTNOTIFY style unless the child window was created without this style by calling the CreateEx member function.
[/quote]
How do you create your child dialog?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks I think that should works
|
|
|
|
|
You are welcome
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hai,
I am having a VC++ exe. i wat to create a setup file, I tried creating a setupfile by reading the msdn site.when i am running it, it is working in some machines, but not in other machines. will you please help me
|
|
|
|
|
Are you making the setup from your debug or your release version?
If you are making it from debug, it probably is the reason why in some machines does not work. They probably are machines where visual studio is not installed, and so your program is missing the needed libraries and dlls to be able to run the application.
What error do it appears in the machines where it is not working?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
i Am making it from the debug version.It is showing the error Application Not configuredf properly.Try reinstalling it.
|
|
|
|
|
As I said, if you do the setup from the debug version and you try to run the application in a machine where no visual studio is installed... you may have problems. The debug versions sometimes need to have some DLLs and other files in the target computer to run correctly.
Take a look with the dependancy-walker about what your programm needs when it is running and add it to the setup packet.
Or do the setup with released version. If you do this, I strongly recommend to take a look into:
Surviving the Release Version[^]
Debugging Release Mode Problems[^]
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Are you including visual studio runtime library in your setup? The Target machine may not have these files
|
|
|
|
|
I want show some options as checkbox in menu.
this menu could be called by right clicking the dialog.
If user select some menu item according to that i will make some operation.
how could i add checkbox to submenu item
|
|
|
|
|
If you go through MENUITEMINFO structure (which is used in InsertMenuItem() function) you can find fMask member which supports MIIM_CHECKMARKS value.
|
|
|
|
|
CMenu::GetSubMenu[^] and CMenu::CheckMenuItem[^] might help you with that...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi...
Hi i am having a multiline text box.
Initially i have some data in edit box. Then if i add any data, the previous datas are gone. i want both previous and current data.
For example, I am Having "This is Test \r\n This is multiline text box".
if i add "This is second line", the editbox should show both data.
How to do...
Please help me.
I used,
CString str1 = "Some String";
GetDlgItemText(IDC_EDIT1, str);
str2 = str+str1;
SetDlgItemText(IDC_EDIT1, str2);
Please tell me is there any otherway....
G.Paulraj
|
|
|
|
|
You can try EM_REPLACESEL message.
CString cs;
GetDlgItemText(IDC_EDIT1, cs);
SendDlgItemMessage(IDC_EDIT1, EM_SETSEL, cs.GetLength(), cs.GetLength());
SendDlgItemMessage(IDC_EDIT1, EM_REPLACESEL, 0, (LPARAM)_T("Some String"));
modified on Wednesday, December 23, 2009 5:34 AM
|
|
|
|
|
Good suggestion.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Thank you!
|
|
|
|
|
OK you modified that post. While I thought the EM_REPLACESEL itself was a great idea, I wouldn't have liked the usage of GetDlgItem() call. But hey, different people, different ways. (why I don't like GetDlgItem() ? Because I'm a terrific fan of Dr. Joseph Newcomer, and his philosophies and I take 'em seriously).
Added: Look at my second answer to the OP.
“Follow your bliss.” – Joseph Campbell
modified on Wednesday, December 23, 2009 5:48 AM
|
|
|
|
|
Me too don't like to use GetDlgItem(). It is always better and clean to use binded members with DDX/DDV. I thought I would provide an answer which resembles the sample code segment in the post . Thanks for the comment.
|
|
|
|
|
Rejeesh.T.S wrote: Me too don't like to use GetDlgItem(). It is always better and clean to use binded members with DDX/DDV.
You do realize, of course, that DDX_ macros internally call GetDlgItem? Newcomer's screed on the subject overlooks that fact. It really comes down to personal preference in coding style; one way is no more evil than another. Personally I try to avoid MFC-specific API's where possible - it makes porting code between frameworks a little less painful.
L u n a t i c F r i n g e
|
|
|
|
|
Use a control type member variable for the edit control. Then do something like
m_Edit.GetWindowText(szTemp );
szTemp += _T("Whatever");
m_Edit.SetWindowText(szTemp);
“Follow your bliss.” – Joseph Campbell
|
|
|
|