If you use classes derived from the common dialog classes
(for example CFileDialog) in the MFC, DDX member variables do not get updated when you choose the "OK" button. The reason for this is that the base class "OnOK()", provided for these classes, does not call...
Below sample code will find a window based on its name/title
// ?????????? is the name/title of the window you want
// to find
LPCTSTR lpWindowName = ??????????;
HWND hWnd = ::FindWindow(NULL, lpWindowName);
if (hWnd)
{
// Add additional code here
}
If this is win32 include windows.h
Although not "Bullet Proof" this may help:
In you Dialog's InitInstance() add this:
CWnd* PrevWnd, ChildWnd;
// Returns NULL if no such window is found
PrevWnd = CWnd::FindWindow(NULL, "NameOfYourDialogWindow");
if (PrevWnd)
{
ChildWnd = PrevWnd->GetLastActivePopup()...
I am using a derived CFileDialog class in my app
(Explorer "2000" style) but can't Center the Dialog to the DesktopWindow. Tried first in OnInitDialog using CenterWindow(), goes to default Upper Left Hand corner. Tried MoveWindow() too, but same results. Last resort used a CALLBACK...
How do you get the correct file order selection from CFileDialog?
When selecting multiple-files (OFN_ALLOWMULTISELECT flag set) the string returned (using GetStartPosition, GetNextPathName, etc) is NOT necessarily the selected file order? Example: select 1.txt, 2.txt, 3.txt from the OPEN dialog...
I use the Common Dialogs through my .dll interface to Comdlg32.dll (I actually use PowerBuilder as my main GUI tool, hence the .dll). My problem lies when I use the OFN_MULTISELECT flag. Example: Choose at least two files for the Open Dialog and the FIRST chosen file becomes second in the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.