|
See Cedric Moonen answer.... and see SetCurrentDirectory(...) and see return value.Is your purpose
|
|
|
|
|
|
Christian's solution will work for the most part. I'd just add that after you select a file, use CFile::GetStatus to determine if it exists or not. The method will return TRUE if it succeeds, and FALSE if the file/directory doesn't exist.
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
|
|
|
|
|
Hello,
I am writing a function that control the staus from key pressed.
It works but how can check in one function at the same time if VK_CONTROL && VK_SHIFT are pressed !
Thank you !
AutreChien
|
|
|
|
|
NorGUI wrote: VK_CONTROL && VK_SHIFT are pressed
SHORT GetKeyState(int nVirtKey);
Return Value:
If the high-order bit is 1, the key is down; otherwise, it is up.
nVirtKey:
VK_LSHIFT
VK_RSHIFT
VK_LCONTROL // Check this parameter
VK_RCONTROL // or Check this parameter with GetKeyState in Key press event
VK_LMENU
VK_RMENU
Example:
if(GetKeyState (VK_LSHIFT) && GetKeyState (VK_LCONTROL))
{
// Do something the left shift and control key are pressed.
}
-- modified at 6:52 Tuesday 22nd August, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
In my application I am processing timer events. User has minimized my application by clicking on Minimize button. At some specific timer event I want to show the window of my application to maximized state and set the application to active state. How can I achive this?
Regards,
Hemant
|
|
|
|
|
Hemant kulkarni wrote: At some specific timer event I want to show the window of my application to maximized state and set the application to active state. How can I achive this?
At timer event use ShowWindow(SW_SHOWMAXIMIZED) for that window.
|
|
|
|
|
Hi,
I tried this, but this doesn't work as my application is minimised to taskbar and other application is active.
Regards and Thanks,
Hemant
|
|
|
|
|
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
|
|
|
|