|
|
Thank you buddy.
I am reading the article.
Thanks a lot.
cheers
harinath
Harinath Reddy
HOneywell Technology Solutions Lab,
Bangalore,
India-560076
harinath@vandemataram.com
|
|
|
|
|
Thanks
Harinath Reddy
HOneywell Technology Solutions Lab,
Bangalore,
India-560076
harinath@vandemataram.com
|
|
|
|
|
Hi,
I am trying to use a property page as a dialog. When I bring up the property page using DoModal funtion, the controls in the property page do not get tabbed. TAB does not move the focus to the next control.
Ex:
CPropertyPage* pPage = new CPropertyPage(IDD_DIALOG1);
pPage->DoModal();
If I use the same resource as a dialog, it works fine. I am able to tab to the next control in the dialog.
Ex:
CDialog* pDlg = new CDialog(IDD_DIALOG2);
pDlg->DoModal();
Has anyone seen this behaviour before?
Could I use property page as a dialog?
Please let me know if you have any solutions for this.
Thanks .
Praveen
|
|
|
|
|
Why do you want to use a Property Page like that ?
Create your property page, create one propertysheet, and Add() the propertypage to the property sheet. Then use pPropSheet->DoModal(); , and here the dialog tabs are handled "normally".
~RaGE();
|
|
|
|
|
I just wanted to reuse my code. I have the property page which I am adding it to the propertysheet in my app. I have commandline options for my app which will display only the property page as a dialog.
Please let me know if you have any solution for this.
Thanks .
Praveen
|
|
|
|
|
I am not sure about that, but I actually think that this is because of the Wizard Mode ability of Propertypages. Generally, the tabs in PropertyPages are handled by their PropertySheet, and not by the Pages themselves. This allows the tabs in wizard mode to be set only on the back, next and finish buttons.
Maybe you can try to mess with the m_psp member of the propertypage, maybe there actually is a way to set the tabs feature back, but I doubt it ...
~RaGE();
|
|
|
|
|
You must insert the Properthpage in propertysheet
Derive a Class from CPropertySheet says CMyProSheet oSheet;
Derive a Class from CPropertypage says CMyProPage oPage1;
in CMyProSheet Constructor,
You just add the
AddPage(&oPage1)
Then
oSheet.DoModal();
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
Thanks guyz for helping. I have found a the solutions. The below code would solve my problem.
BOOL MyPropPage::PreTranslateMessage(MSG* pMsg)
{
if( pMsg && (pMsg->message == WM_KEYDOWN))
{
if (pMsg->wParam == VK_TAB)
{
CWnd* pNextControl = GetNextDlgTabItem(GetFocus(), (GetKeyState( VK_SHIFT ) & 0x8000));
if (pNextControl)
GotoDlgCtrl(pNextControl);//pNextControl->SetFocus();
}
}
return CPropertyPage::PreTranslateMessage(pMsg);
}
Praveen
|
|
|
|
|
I create DialogBox using Api Windows
my question is how to get handle to this dialog before the dialog appears?
in MFC i got
CMyDlg dlg;
now I am able to pass dlg somwhere (to the tread in my case)
and I do dlg.doModal;
I want to do similar thing in WinAPi
but if I do
DialogBox(hInst, MAKEINTRESOURCE(IDD_AUTHORIZATION), h, (DLGPROC)authDialog);
the dialog box appears imiedetly, and I don't have HWND of it.
Please help
|
|
|
|
|
It's not possible to work with the HWND of a dialog before the dialog is created! There exists no HWND until the dialog is created!
If you want to use some functions that uses the HWND the dialog have to exist, otherwise the doesn't work!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Grab WM_INITDIALOG inside your authDialog proc. You can do the same stuff here you would do in OnInitDialog()
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Dear All,
How can we 'disable' close button in AfxMessageBox MessageBox ?
ie. it show it disabled and should not work.
Thanks in advance
Rohit Dhamija
|
|
|
|
|
One option would be to simply remove it. You can control what buttons are shown on a message box through the MB_xxx constants. If my memory serves me right then AfxMessageBox allows you to do that, otherwise you will have to use the ::MessageBox API directly.
If you already knew all this and you simply want to disable this button without removing it then there's no easy way to do it. Russ Freeman had an excellent article here somewhere where he described a method to hook into the creation of a message box and modify it - I can't seem to find it again. Then there is another article with a custom message box: http://www.codeproject.com/dialog/xmessagebox.asp[^] which you might want to take a look at.
Hope this helps.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Thanks a lot. Can you please which MB_XXX constant can be used to disable Close button ?
Rohit
|
|
|
|
|
there is no MB_xxx that allows you to do that!!!!!!!!!!!
you should be careful when guiding others, or don't guide them al all if you don't know what you are talking about !!
|
|
|
|
|
read the manual please ...
...<br />
Message_Box Types <br />
MB_ABORTRETRYIGNORE The message box contains three pushbuttons: Abort, Retry, and Ignore. <br />
MB_OK The message box contains one pushbutton: OK. <br />
MB_OKCANCEL The message box contains two pushbuttons: OK and Cancel. <br />
MB_RETRYCANCEL The message box contains two pushbuttons: Retry and Cancel. <br />
MB_YESNO The message box contains two pushbuttons: Yes and No. <br />
MB_YESNOCANCEL The message box contains three pushbuttons: Yes, No, and Cancel.<br />
...
Those are used to create the AfxMessageBox, maybe not for dynamically remove buttons.
If you want a message box with only an OK button, you create with MB_OK only flag.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
DEAR ALL.,,
I think I should make my problem more clearer to ALL.
-----------------------
How can we Disable Close button in title bar of a MessageBox ?
----------------------
Rohit
|
|
|
|
|
Lol .. Ok now I get what you want. You are talking about the cross in the upper right corner ? Then answer is easy : you can't. You shall make your own MessageBox if you want ot do this.
Why do you want to get rid of it ?
~RaGE();
|
|
|
|
|
Anonymous wrote:
you should be careful when guiding others, or don't guide them al all if you don't know what you are talking about !!
What are you trying to say ?
If you accuse dabs of giving wrong indications, then reread his post and you'll see what he says is perfectly correct.
If you mean Rohit Divas misunderstood what dabs answered and seems to ask something impossible, then please answer quietly its question.
In both cases, let me remind you that you are on a Forum here, that all the questions might seem silly when you already know the answer, but not when you don't know it, and that giving clues that may lead to a wrong direction (which happen very seldom on CP) is not a crime, but can happen to everybody. You are here to help, or to ask for help, but keep your sad remarks for you.
~RaGE();
|
|
|
|
|
quite well actually. i didn't expected any answer, though the answer being given it's polite to reply to it.
in most cases when someone tries to solve a problem receives bad or not related to suject answers and the reply from Rohit Divas seemed to be unappropriate. What's that so bothering? Does that concern you in any way?
|
|
|
|
|
Anonymous wrote:
in most cases when someone tries to solve a problem receives bad or not related to suject answers and the reply from Rohit Divas seemed to be unappropriate.
I'm sorry, I do not understand what you mean. Rohit actually _asked_ the question and did not answer anything.
Anonymous wrote:
What's that so bothering? Does that concern you in any way?
The "bothering" is that you flame at people that give answers on this forum, which breaks a universal (tacite) forum law about politeness. It concerns me because I try to help people on this forum, and I do not want anyone to flame at me if I say something unappropriate thinking it was. Usually, if I think I cannot answer, I do not do it. Sometimes, if a post about a subject unkown to me remains without answer for a long time, I try to answer all the same to give some hints to the thread author. Sometimes it is completely unappropriate, but sometimes it helps. In both cases, it is better than nothing.
And one more word, it also concerns me simply because I am a CPian, and I won't let another CPian be flamed at.
I won't go on arguing with you. If you see another "unappropriate" answer, just post "No, that's wrong, that's the right way to do it :" and explain. OK ?
~RaGE();
|
|
|
|
|
error LNK2001: unresolved external symbol __afxForceEXCLUDE
regards
safee
|
|
|
|
|
That's not a compilation error, that's a linker error. You are missing a directory declaration where a lib is in, or an #include, to tell the linker where to find afxForceEXCLUDE.
~RaGE();
|
|
|
|
|
If I need to disconnect from Internet or reconnect to Internet in your code, can I do that? Thanks.
|
|
|
|