|
WM_SYSCOMMAND and SC_MAXIMIZE should help.
|
|
|
|
|
Hi,
I tried this also , but this doesn't work as my application is minimised to taskbar and other application is active.
Regards and Thanks,
Hemant
|
|
|
|
|
Can you show your code why your code doesnt work with these.
|
|
|
|
|
here is code snapshot
void CAutoActivateAppView::OnTimer(UINT nIDEvent)
{
SetForegroundWindow();
SetFocus(); //Just playing safe
SetActiveWindow();
ShowWindow(SW_MAXIMIZE);
CView::OnTimer(nIDEvent);
return;
}
Regards,
Hemant.
|
|
|
|
|
You need to call ShowWindow on main frame window.use this code,
void CAutoActivateAppView::OnTimer(UINT nIDEvent)
{
GetParent()->ShowWindow(SW_SHOWMAXIMIZED);
CView::OnTimer(nIDEvent);
}
|
|
|
|
|
Thanks god ! ! !
It worked !
I was missing this activating parent window!
Thanks again for suggestion.
Thanks and Reagrd
Hemant
|
|
|
|
|
Do you really want to do this?
What happens if you press space, or enter on your window? If enter sets some process running, then imagine what could happen if a user is in the middle of typing an email, and just as your app pops up they press enter, only to find your app starts running away doing stuff they really didn't want to happen just yet?
It might be better to have a notification balloon pop up and tell them that they need to do something
|
|
|
|
|
Yes. But not exactly this.
The requirement is when user presses "F12" the application should start and display the window to user. If the application is already started but if it is in minimized state at taskbar it should become active, focused and show the window to user. If the application is not started it should start the.
I am checking the user keys in a hook procedure
Hope this will make the things clear
Regards,
Hemant.
|
|
|
|
|
yeah, that makes more sense!
I had a knightmarish flashback to an old app I used to maintain that took about 10 minutes on startup to initialise (it read the entire contents of a huge database over the network)
You'd start it going, get bored waiting, start writing emails, only to have the main dialog pop to the front, and capture the last enter you pressed, which helpfully quit the app!
Thank god I got away!
Anyway, I'm sure I've seen something like this myself, and I seem to remember I had to briefly force the window to be topmost for it to actually appear on top (then turn that off again, of course)
|
|
|
|
|
benjymous wrote: What happens if you press space, or enter on your window? If enter sets some process running, then imagine what could happen if a user is in the middle of typing an email, and just as your app pops up they press enter, only to find your app starts running away doing stuff they really didn't want to happen just yet?
I was thinking the same thing. I know of a few OS dialogs that do this (come to the top and mess up the foreground window) and it is very annoying.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I'm currently reading "Modern C++ design" by A. Alexandrescu (nice book but quite heavy to read, gives some headaches ).
There is one chapter going in details about typelists. Very nice, but.... what are their use ? I mean in a concrete application or algorithm. When is it usefull ?
|
|
|
|
|
as i don't know that book, i was wondering : was are those "typelists" all about something like STL containers, or else ?
|
|
|
|
|
toxcct wrote: was are those "typelists" all about something like STL containers
No, it has nothing to do with containers (in the way you think of them). In fact it's a kind of compile-time 'list' that contain types (so, integer, unsigned integer, ... or even classes type). It is devoid of any value and it uses template heavily but in a way that you wouldn't have imagined .
The concept is quite difficult to explain; maybe you can take a look here[^]
But I don't really see a concrete application for them.
|
|
|
|
|
You could ask Andrei directly ([^]) about that
SkyWalker
|
|
|
|
|
If memory serves me correctly, that is used in template meta-programming, which is a very detailed subject in and of itself. While some of the things it can do for you are both interesting and creative, I've yet to find a reason to use a meta-programming solution vs a coded solution. Meta-programs are more flexible, but are almost impossible to read. Right now, it is a solution looking for a problem.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: Right now, it is a solution looking for a problem.
That's exactly what I was thinking when reading this chapter
|
|
|
|
|
Cedric Moonen wrote: That's exactly what I was thinking when reading this chapter
Don't worry, that is what most people think when they look at this "nifty feature" of templates. There are a few books dedicated to meta-programming, but if you look at them, you see that the syntax is so complex that even simple things like loops become very difficult to read -- and try debugging something that is written at compile time :P
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi world...
I want to change the CMonthCalCtrl language. Is this possible?
Is there another calendar control where I could do that?
I don't use dotNET framework but MFC (I know...)
Thanks for any advice!
Hello World!!!
from Raphaël
|
|
|
|
|
Raphaël Kindt wrote: change the CMonthCalCtrl language
Subclassing the Control is one way to do this.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Could you give me more informations?
After subclassing, what must I do to translate the text inside the calendar?
Thanks for the reply.
Hello World!!!
from Raphaël
|
|
|
|
|
I think that the language of the control changes when you change the local settings of the computer (so if you are running on a french windows, it will be displayed in french). So, this is done automatically.
It is like the Ok and cancel texts that appears on the message boxes.
|
|
|
|
|
I know that.
But the user must be able to change the language directly from the menu.
At this time I'm writing new string ressource (DLL project) for each new language.
When the user change the language I dynamically load the good ressource (inside DLL) for this language.
Hello World!!!
from Raphaël
|
|
|
|
|
The ways the dates are used and the way they are displayed are based on the Regional Settings of the Control Panel.
There is a "silent way" to programmatically change those settings. You can use Rundll32.exe to call the Regional and Language Options Control Panel with an answer file that specifies the appropriate settings. The syntax for calling Rundll32.exe from the command line is as follows:
Rundll32 shell32,Control_RunDLL intl.cpl,,/f:"Some_Path\Your_File.txt"
That file must contain a [RegionalSettings] section that specifies the appropriate settings.
You will have to work on the line containing the following information:
Language="locale ID"LanguageGroup="language group ID","language group ID
SkyWalker
|
|
|
|
|
That seems interesting...
But only the application language must be change. Not all the Windows language.
Could I use this method to only change my application language?
Thanks for your reply.
Hello World!!!
from Raphaël
|
|
|
|
|
No!
In your case, you could derive a class for the base one and override the methods dealing with displaying text, where you could use some string resources you must create (which will contain the texts you write as translation texts).
SkyWalker
|
|
|
|