|
I have an MFC application that gets poked by a remote app and shows a modal dialog. I want the modal dialog to make itself the active application and give itself focus.
Is this possible?
J
|
|
|
|
|
Check this out:
http://www.codeproject.com/dialog/dlgboxtricks.asp[^]
Shog9
------
Rather hammer futiley at the locked door than just sit and ignore it. Obviously finding a way to get through the locked door would be even better though. - Paul Watson, My Ignorance
|
|
|
|
|
Thanks Shog. SetForegroundWindow() was what I needed.
J
|
|
|
|
|
We have boundschecker and we have a lot of workspaces with projects in it. So we normaly use a .bat file to compile all of our workspaces. But now I've boundschecker and I want the same type of compiling with a bat file.
Does anyone have any idea how I can create a bat file witch will build all my workspaces at once with boundschecker integration.
Le Ridder Noir
Considderd to be the worlds fastest knoppenbonker.
one year of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru and Crystal Ace.
|
|
|
|
|
Does anyone use languages other than english in vc.net?
How can I use charachter other than english in VC.NET?I install farsi on my windows xp but I can't use them in VC.I get ??? in place of charachters.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Tried Russian - no problem. VS.NET is a true Unicode application. Check if there's something else misconfigured on your machine.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
Thanks for reply.I'll try another language,but I don't think it is some thing misconfigurated on my windows,because I don't have problem in C#,it is only in VC.I changed the language culture in project setting to Farsi too,but there is no change.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Even with Unicode, not all fonts support all characters... it is just too much work for the average font maker to put in every single character. It could be that the right fonts aren't installed on your machine..
I guess it depends - are you saying the ?? characters show up in the VC.NET IDE, or in your program's output/windows? If the former, I suppose you can probably change the fonts in VC.NET to ones that support Farsi. If it is your app, make sure it is being compiled in Unicode mode, and, again, that it is using fonts that have all the necessary characters.
Hope that helps.
Even a broken clock is right twice a day.
|
|
|
|
|
I don't know where is IDE. but when I write them in 'properties' it is ok,but in the dialog bar it shows ????.I compile with Unicode option too.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Hi dear Mazdak,
Trust me, It's not Unicode problem !
As i told you before i installed VS .NET on a computer without any problem.
I install Farsi as non-Unicode.
I've same problem with you in my pc in home
Is it M$ bug ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi Hadi:
Hadi_Rezaie wrote:
As i told you before i installed VS .NET on a computer without any problem.
I install Farsi as non-Unicode.
So you install farsi version?! You can do it at work?How?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I used ULTRA-POWER :P
I don't know really !
I think VS .NET is intelligent, It could understand when you install it at work
But i've same problem at home
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
But can't you select you language in the Wizard?
But you'll need the right language file I think then!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
But can't you select you language in the Wizard?
Nope.But I can choose culture in project options.
Rickard Andersson wrote:
But you'll need the right language file I think then!
Well,thats true in ASP.NET but I don't know about VC>
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Mazdak wrote:
Nope.But I can choose culture in project options
What the heck?
Where do you do that? And what kind of project are you crteating?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
Where do you do that? And what kind of project are you crteating?
MFC application project.In Resources--->General---->Culture
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Okay, then it must be the same I meant when I said "select your language".
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hello I need your expert help. I am trying to make my app to auto hide on start up. Here are part of the code..
CTestDlg.h
----------
I put this on the message map.
afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
CTestDlg.cpp
------------
I put the following line in BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_WM_WINDOWPOSCHANGING()
And have the following function
void CTestDlg::OnWindowPosChanging (WINDOWPOS* lpwndpos)
{
CDialog::OnWindowPosChanging(lpwndpos);
if (lpwndpos->flags & SWP_SHOWWINDOW) {
lpwndpos->flags &= ~SWP_SHOWWINDOW;
}
}
It compile without any error but when I run the program the dialog are still visible. Any ideas?
Thank you very much.
|
|
|
|
|
Try to change flags before call to base class function.
|
|
|
|
|
In OnInitDialog try:
if(!this->ShowWindow(SW_HIDE))
{
<code>
...
}
to show it again:
if(!this->ShowWindow(SW_SHOW))
{
<code>
...
}
Nitron
_________________________________________--
message sent on 87% post consumer electrons.
|
|
|
|
|
This is not very fast solution.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Mazdak wrote:
This is not very fast solution.
um... ... ok...
So how do you show/hide a modeless dialog?
A show/hide cycle on my machine took about 12.679709572027 ms over 1000 samples.* That would be 6.3398547860135 ms to show or hide. I don't know about you, but I'm sure I can't distinguish the difference between 1/158th of a second or 1/200th of a second.
* Measurements acquired via timer class found here[^].
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Well for the modeless dialog you have to do that.In slow machines if you do your way,the main dialog or window maybe become visible for a very short time.Thats why I say it is slower.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Here's a simpler way:
1. Uncheck the "Visible" checkbox from the dialog resource.
2. Construct the dialog box modelessly:
In your CWinApp-derived class, replace the code in your InitInstance (after Enable3dControlStatic) with something like this:
static CYourDlg dlg;
dlg.Create(CYourDlg::IDD);
m_pMainWnd = &dlg;
return TRUE;
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
|
|
|
|
|
I am trying to modify the message map at run-time, to create new handles.
Everything lokks fine, but i get this error
Compiler Error C2276 'operator' : illegal address of bound member function expression
when I try to assign the handle function "MaximizeDialog"
AFX_MSGMAP_ENTRY newEntry;
newEntry.nMessage = WM_COMMAND;
newEntry.nCode = CN_COMMAND;
newEntry.nID = (WORD)nID;
newEntry.nLastID = (WORD)nID;
newEntry.nSig = AfxSig_bw;
newEntry.pfn = (AFX_PMSG)(BOOL (AFX_MSG_CALL CCmdTarget::*) (UINT))&MaximizeDialog;
_messageEntries[i] = newEntry;
What can I do ? thanks !
-----
Mit freundlichen Grüssen/Best Regards/Un cordial saludo.
Ing. José Manuel Hostalet Wandosell, Fraunhofer IPA, Abt.323/Robotersysteme
Nobelstrasse 12, D-70569 Stuttgart (Germany)
mailto:jose.hostalet@ipa.fhg.de, http://www.ipa.fhg.de
|
|
|
|