|
If you have a modeless dialog (activated with Create ), I think you should try WM_ACTIVATE notification, sent to your dialog when another window is activated.
Make a handler for this message and watch for WA_INACTIVE value of WPARAM .
Otherwise, if your dialog is modal (activated with DoModal ), then I think you should process WM_NCACTIVATE notification with FALSE value of WPARAM .
I hope it helps.
|
|
|
|
|
It worked! This is what I did.
BOOL CChartInfoDisplay::OnNcActivate(BOOL bActive )
{
if (bActive == FALSE)
CDialog::OnOK();
return TRUE;
}
I tried with
afx_msg void OnActivate( UINT nState, CWnd* pWndOther, BOOL bMinimized ); but I got some errors I could not understand.
Thank a lot.
Fortitudine Vinsinues!
|
|
|
|
|
Try with
afx_msg void OnActivate( UINT nState, CWnd* pWndOther, BOOL bMinimized );
nState must be WM_INACTIVE , then call OnOK();
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Is there any registry path where all the installed components in the system are listed?
I found that components to be uninstalled are listed in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Just like that i want to know whether any place is there where all the installed components are listed.
|
|
|
|
|
If they did not use MSI, then there is almost no chance of locating everything.
If they were installed using MSI, then you can use the MSI API to get lists of installed 'packages'. A product does not necessarily have to be installed using MSI to end up in the 'add/remove programs' list.
I've seen better runs in my shorts! - Patches O'Houlihan
|
|
|
|
|
HI all,
I am trying to replace FreeImage Libraries with JPEG Package in my VC++ MFC Code.
Where i can refer JPEG Package ?
Is it a free Package ? If so, where can i download ?
Kindly suggest me.
Karthik M
|
|
|
|
|
Gooooooooooogle search.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
im trying to overwrite the date in flex grid on runtime,(the data was initially written on complie time). please help me out
i am unable to do it....
also send me ur answers on following.....
mansoor_yahya@yahoo.com
{I c E}
|
|
|
|
|
Dear all,
I have .html file and i want to show the file contents on the dialogbox as error messages/ warning messages in formated way. How to implement this?
thanks in advance
Regards,
aj
|
|
|
|
|
I think you can use the WebBrowser ActiveX control. Go to dialog editor, right-click on dialog, select Insert ActiveX Control, and then select Microsoft Web Browser.
Then create a control variable for this new control.
Next call Navigate2 member function in this manner:
_bstr_t urll1(_T("file://path-to-your-html-file"));
_variant_t url2 = url1;
m_cMyControl.Navigate2(&url2, NULL, NULL, NULL, NULL);
Alternatively, you can format a nice message using some editor (like Write) and save as RTF file or resource. Then load this content to a rich-edit control (CRichEditCtrl ).
I hope this helps.
|
|
|
|
|
See ShowHTMLDialog or IHostDialogHelper .
Steve
|
|
|
|
|
i have a bitmap image on my hard drive.i want to display this imag eon my dialog button control.
how to do it?
thanx
|
|
|
|
|
CBitmapButton and see Here[^]
whitesky
|
|
|
|
|
i know that but i don't how to load existing image in it.
|
|
|
|
|
<br />
CBitmapButton m;<br />
m.LoadBitmaps(nIDinResourcefile,..)<br />
you can see example in MSDN
whitesky
|
|
|
|
|
Please stop! The OP said: "i have a bitmap image on my hard drive"
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Not problem LoadImage SetBitmap
whitesky
|
|
|
|
|
i think its better
<br />
CBitmapButton m_BitmapButton;<br />
m_BitmapButton.Create("Test",BS_BITMAP|WS_CHILD|WS_VISIBLE,CRect(0,40,150,63),this,1);<br />
m_BitmapButton.SetBitmap((HBITMAP)LoadImage(NULL,"c:\\0.bmp",IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION));<br />
whitesky
|
|
|
|
|
Sincerely, I don't think it's better.
Let's go back to C++ and MFC basics:
CBitmapButton is derived from CButton. You have created a CBitmapButton object and call a CBitmap function (CBitmap::SetBitmap) which CBitmapButton, of course, inherits.
Once you don't use any of CBitmapButton added functionality, what's better?
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
oh no its better for show SetBitmap and LoadImage (only)not its better use CBitmapButton instead CButton ok,
whitesky
|
|
|
|
|
You have to:
- be sure the button has BS_BITMAP style; you can do this in the resource editor or by calling ModifyStyle.
- call ::LoadImage Windows API function to load the bitmap fromthe file
- call CButton::SetBitmap
Here is an example:
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
LoadButtonBitmapImage(IDC_BUTTON3, _T("c:\\mybutton.bmp"));
}
void CMyDialog::LoadButtonBitmapImage(UINT nButtonResID,
LPCTSTR pszBitmapFile)
{
CButton* pButton = (CButton*)GetDlgItem(nButtonResID);
pButton->ModifyStyle(BS_ICON, BS_BITMAP);
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL,
pszBitmapFile,
IMAGE_BITMAP, 0, 0,
LR_DEFAULTCOLOR|LR_LOADFROMFILE);
pButton->SetBitmap(hBitmap);
}
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
hello
i did like this
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
LoadButtonBitmapImage(IDC_BUTTON1, _T("C:\Documents and Settings\swaraj\Desktop\sipXezPhone\res\1_down.bmp"));
}
and
void CNewProjectDlg::LoadButtonBitmapImage(UINT nButtonResID,LPCTSTR pszBitmapFile)
{
CButton* pButton = (CButton*)GetDlgItem(IDC_BUTTON1); // be sure the button has BS_BITMAP style
pButton->ModifyStyle(BS_ICON, BS_BITMAP);
// load bitmap from file
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL,pszBitmapFile,IMAGE_BITMAP, 0, 0,LR_DEFAULTCOLOR|LR_LOADFROMFILE);
// set the button bitmap
pButton->SetBitmap(hBitmap);
}
but it not showing me anything..
one thing more i'm getting where from the value will pass into
UINT nButtonResID,LPCTSTR pszBitmapFile
plz tell me the solution.....where i'm amking mistake
byee
|
|
|
|
|
See my post to Mr ovidiucucu i think it work
C:\Documents and Settings\swaraj\Desktop\sipXezPhone\res\1_down.bmp
C:\\Documents and Settings\\swaraj\\Desktop\\sipXezPhone\\res\\1_down.bmp
whitesky
|
|
|
|
|
i Tried it like this but its not displaying any image......
i don't know why? where i'm making mistakes
|
|
|
|
|
Do you check this problem
C:\Documents and Settings\swaraj\Desktop\sipXezPhone\res\1_down.bmp
to
C:\\Documents and Settings\\swaraj\\Desktop\\sipXezPhone\\res\\1_down.bmp
and are you sure path is valid
whitesky
|
|
|
|