you can use WaitForInputIdle(...) for the process to finish initializing before you try to find its HWND. this will not work with apps that start with a process and switch to another while excuting (e.g. mozilla fire fox).
"If you judge people, you have no time to love them."
I have an issue that requires either the rotation of the application (MFC Doc/View architecture - yes i know but it's a legacy application) or the screen (ATI Radeon). I've tried using the ChangeDisplaySettings API call (it does this already to set the required resolution, and yes I know this is a bad thing generally but this project requires the switching of two legacy applications both of which are EPoS and the operator is trained and paid to put up with it) and setting the rotation flag to DM_180 but I always get a DISP_CHANGE_BADMODE.
So I have a display on a hinge, and one application (the doc/view one) ends up being upside down. The ATI card has a tray application which lets the display be flipped, but I can't how to do it using API calls, or even calling into an ATI dll. (The ATI card isn't guaranteed to be used throughout the life of the project, it could well be replaced by another make/model). Unless some clever person out there can tell me how to rotate the display programically, the only other way is to add some code so that the output of the doc/view application is inverted.
Thanks, I gave that a go just now on one of the dialogs and managed to rotate the background but none of the controls on the dialog. I suspect I would have to override the onpaint events for absolutely everything, which for a new application could be a fun flag for the registry but for a crusty old legacy app it's not happening.
I want to change the icon of my application,so, i changed it in resource file and the exe created with new Icon itself.But my problem,after running the EXE, the system taskbar which shows the icon and application name...IN THAT THE ICON IS OLDER ONE.IT DOES NOT SHOW THE NEW ICON.
I dont know wat to do.The res file and ICON in the Workspace,all shows the new Icon only.Even my EXE in Debug file also shows new Icon.But in system taskbar shows the older one.
Till now i wont use SetIcon but the taskbar shows right icon,then now why it does not shows the new one.where the application takes the old icon.because i checked in all files there is no older icon.then how its possible?Pls clear my doubts.
Have you changed the function's parameter ,for example ,if you want show the new icon which ID is IDR_NEW on the dialog, you can modify the LoadIcon function .
CTestIconDlg::CTestIconDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestIconDlg::IDD, pParent)
// NOTE: the ClassWizard will add member initialization here
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
// modify this sentense m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_hIcon = AfxGetApp()->LoadIcon(IDR_NEW);
-=- JamesIf you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)