|
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.
|
|
|
|
|
Look at the ::InternetXXX functions. There are some that probably do what you want, such as ::InternetHangUp( ), ::InternetOpen( ) etc. MSDN is your best friend there
|
|
|
|
|
Hi,
I have two applications and want to close one by clicking on command button from the other application.
I know that i must use theses functions : CreateMutex, OpenMutex, FindWindow , ... But i don't know how to realize this action
Can anybody help me .
Thanks in advance
|
|
|
|
|
Do you own the two applications ? Or do you want to kill a third party application from your own application ?
~RaGE();
|
|
|
|
|
No i don't want to kill a third party application. The two application are mine ( created with visual C++6.0)
Thanks
|
|
|
|
|
Then use a user defined message (search for this here on CP or in MSDN), and use SendMessage() or PostMessage() in the first application to send it to your second application. In your second application (the one which ought to be terminated), handle your message in the message map, and end your application calling DestroyWindow() or OnOK() if it is a MFC dialog.
~RaGE();
|
|
|
|
|
HWND hWnd = ::FindWindowEx(NULL, NULL, NULL, "Calculator" );<br />
<br />
if (!hWnd)<br />
{<br />
AfxMessageBox("Could not find \"Calculator\" window");<br />
return;<br />
}<br />
else<br />
::PostMessage(hWnd, WM_CLOSE, 0, 0);
|
|
|
|
|
This is the easiest way in most cases.
John
|
|
|
|
|
If you can get a handle to the other app the SedMessage( .. WM_CLOSE .. ) or something like that should work fine.
Please don't SHOUT at us.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I am working with WinXP, and i have a problem with Tab control.
All control like CStatic,CheckBox,slider.... haven't transparent backround, it's a little gray.
(i found this picture http://wallsoft.form08.com/Tab.jpg[^] )
Do you know how to get transparent background ?
thx in advance
|
|
|
|