|
I'm working on an MDI application using MFC in VC6.0. The application should run in Win98 or higher.
I need my application to notice and respond if the user changes their desktop display settings, changing the resolution or bit depth. I tried WM_DEVMODECHANGE but that seems to something different. I looked for WM_DISPLAYCHANGE but I couldn't find a way to add that using the wizards.
How do I get my MDI to receive notification of display changes?
|
|
|
|
|
Sometimes the user might move the dialog box around screen till it is partly outside the desktop. And you might want to bring the dialog box back into full view. There might also be a a situation where you did the development on a higher resolution and on your machine it comes up nice and full, but the final user might be using a lower screen resolution and thus part of the dialog will be out of the screen. Again you'd really want to make sure the dialog box is fully visible. Well, believe it or not, this can be accomplished with just one line of code.
SendMessage(DM_REPOSITION);
Smooth eh? Remember that this message only works for top level dialog boxes and will not work for child dialogs.
u can also check for GetSystemmetrix
|
|
|
|
|
|
hi ,
i have a dialog bases application in which repainting the application is very much necessary .... does anybody has any idea about the following and how to implement them:
1)SetRedraw
2)ReDrawWindow
3)Setting the parameters CS_VREDRAW and CS_HREDRAW in the WNDCLASS , so the window takes care about the repainting in the subsequent WM_PAINT message.
Please help me in this regard .... iam kinda lost
Thanking you
Satadru
|
|
|
|
|
Invalidate(TRUE) or RedrawWindow(). See MSDN for details.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
How to use CFileDialog to have a preview function?
I use this method:
class CFilePrevDialog : public CFileDialog
CFilePrevDialog::CFilePrevDialog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG_PREV);
}
-----
CString strFileDlg = "Jpg Files (*.Jpg)|*.Jpg|";
CFilePrevDialog dlg(TRUE, "Jpg", NULL,
OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT,
strFileDlg, NULL );
dlg.DoModal();
-----------------------
But i found what display is still the standard open filedialog...
who can give a advise to use it,not too hard...
Best Regards...
|
|
|
|
|
|
Hi all,
how can i get the *.dsw (workspace file) from the interfaces exposed by the add in????
please help
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
The simple answer is: you can't.
But you can get project paths and names and try to deduce the workspace path from them (perhaps even use CFileFind).
What do you need it for?
Maybe there is a different solution to your problem.
btw: I've written a thin wrapper library for DevStudio 6.0 interfaces. Maybe you'll find it useful. It is part of the following project: http://www.codeproject.com/macro/SmartReplace.asp
|
|
|
|
|
thanks for reply,
i found a code to get the dsw, it appears in one of the add ins here is code project (in the project http://www.codeproject.com/macro/restoreclassviewaddin2.asp?target=restore%7Cclass%7Cview#xxxx )
here is the code:
CString CCommands::GetWorkspacePath()
{
CWinApp* pApp = AfxGetApp();
CString szWorkspace;
POSITION posdt = pApp->GetFirstDocTemplatePosition();
while (NULL != posdt)
{
CDocTemplate* pdt = pApp->GetNextDocTemplate(posdt);
if (0 == strcmp("CProjectWorkspaceDocTemplate",
pdt->GetRuntimeClass()->m_lpszClassName))
{
POSITION posdoc = pdt->GetFirstDocPosition();
if (NULL == posdoc) break;
CDocument* pdoc = pdt->GetNextDoc(posdoc);
if (NULL == pdoc) break;
szWorkspace = pdoc->GetPathName();
if (0 == szWorkspace.GetLength()) break;
}
}
return szWorkspace;
}
the problem is this code doesn't work for me !!!
the line
POSITION posdt = pApp->GetFirstDocTemplatePosition();
returns null for posdt
i've debug the project restoreclassviewaddin2, and there it works! it returns the full path for the dsw...
can any1 help me here???
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi,
I'm new to COM tech. My few COM experiences are just a few OLE Automation samples in MFC. But now I have a Project that will require me calling an object mtd across machine boundary.
Can I achieve this in MFC 7.0? If yes how?
Thanks in advance!
What would life be without programmers and salesmen?
|
|
|
|
|
Kene wrote:
DCOM/COM+ without ATL?
Why without ATL ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
Why without ATL ?
My first taste of VC++ some years back was with MFC. I was particular thrilled about the wizards. Since then, I've been used to doing things in MFC style.
You can still help me out by giving me steps I can take to achieve results (either in MFC or ATL).
Surely any advise or help will be appreciated
What would life be without programmers and salesmen?
|
|
|
|
|
Kene wrote:
Since then, I've been used to doing things in MFC style.
As has been pointed out ( and this is where I was headed ), VC7 has a new version of ATL, and there's no reason you can't use it with MFC.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
MFC7 and ATL7 are best buddies nowadays. At least the source code is hinting it (MFC and ATL shares a lot of code)
--
Intellectualize my blackness[^]
|
|
|
|
|
Does somebody has an idea how it is possible to change button color. I am wondering it does not have such a property.
Raima
|
|
|
|
|
I think 'WM_CTLCOLOR' is helpful to you.
|
|
|
|
|
|
Please prompt me,how to convert the raw WAV data into WMA format?
Which API fuctions are needed?
Rap off for you,for me,for our human.
|
|
|
|
|
hi,
Does movefileex (with DELAY_UNTIL_REBOOT) use registry ? I want to replace the registry hive system on restart with this function (for a backup app).
thanks for any help
regards
hari
Hari Krishnan
|
|
|
|
|
pranavamhari wrote:
Does movefileex (with DELAY_UNTIL_REBOOT) use registry ?
Yes.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi VC++ experts,
I want to get the full path of a file(For example c:\Mytrial\Sample\Display.txt )by just giving the file name(For example Display.txt)as input
The File may be present at anyone of the drives in my PC (Any random directory path). I want to find the full path of the file by running a C++ or VC++ code from some other drive in the same PC and giving just the file name as input( For example Display.txt ) to the code.
I tried with CFileFind class without success. Any VC++ experts help me by sending some sample code.
By
T.V.Sankar
|
|
|
|
|
Try _fullpath
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Yes you can do it but in a different concept...
You can get what you want if the file is in the path.. But there could be a problem if more than one file with the same name is in the path.
Any way here is the sol.
1.Get the evironment string path
2.Seperate the string that are ; seperated for each path.
3.Look into that path.
regards.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|