|
is there any way to run exe at shutdown, any registry key ?.
my app should check some things when windows exits.
there is no reason to keep it during whole session in memory.
|
|
|
|
|
no "usual" way
Don't try it, just do it!
|
|
|
|
|
See if the WM_ENDSESSION message is of any help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
it does, although application should be whole time in memory.
not a big deal, dos times are over and we have enough memory
|
|
|
|
|
Alex HexR wrote:
...although application should be whole time in memory.
Which is not what you indicated in your original post. "There is no reason to keep it during whole session in memory" is not the same as "although application should be whole time in memory."
Alex HexR wrote:
not a big deal, dos times are over and we have enough memory
This make no sense whatsoever. What does DOS and enough memory have to do with your post or my reply? You wanted to know when Windows was shutting down so that you could check some things. WM_ENDSESSION is the message you'll need to handle to know that Windows is shutting down.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow wrote:
dos times are over
"dos" -> "those", methinks.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I'm unclear on your intent here as none of my posts in this thread mentioned anything about "dos times are over."
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I was referring to Alex's post. I think he meant "those times are over", where as you interpreted his misspelling as having to do with DOS.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Nothing was misspelled. He clearly meant DOS.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
OK. It just didn't appear that way to me. We're both talking about this msg[^], right?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
We're both talking about this msg[^], right?
Correct.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
A Solution is to create a remote thread in explorer that just start do the work when it detects a M_QUERYENDSESSION
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
The problem with the WM_QUERYENDSESSION message is that an application can return 0 in response to it and Windows will not shut down.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Exactly what he may need if he want to do some processing and then call the ExitWindow family of API
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
If, during the processing of the WM_QUERYENDSESSION message, a call is made to ExitWindows[Ex]() , does that not re-send the WM_QUERYENDSESSION message?
As I read Alex's original post, he was interested in doing something if Windows was shutting down, not if Windows was asked to be shut down. If work was done during the processing of WM_QUERYENDSESSION , it is not guaranteed that Windows will shut down, thus the processing may be immature.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You're right
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
so, as i understand Alex's question (or even if it is not his, it's mine ), is there a way to lauch a program which is not executing when windows shuts down (and so don't use memory for nothing - because it is not needed before the loggout) ?
the problem is, when you catch the WM_ENDSESSION , the program must be currently running to catch the event...
TOXCCT >>> GEII power
|
|
|
|
|
Hi world...
What is the most useful way to change language in an application?
I've read we can do that with explicit link for DLL (one DLL for each languages ressource). Example:
- exported from french.dll file:
extern "C" __declspec(dllexport) char* get_text(int id_text);
- int the application:
typedef char* (MY_FUNCTION)(int);
HINSTANCE hInstance;
MY_FUNCTION *pFunction;
VERIFY(hInstance = ::Loadlibrary("c:\\winnt\\system32\\french.dll"));
VERIFY(pFunction = (MY_FUNCTION*) ::GetProcAddress(hInstance, "get_text"));
int id_text = 5427
char* good_translation = (pFunction*)(id_text);
Is that a good solution?
Thanks for your suggestions...
Hello World!!!
from Raphaël
|
|
|
|
|
use string resources in your software.
Don't try it, just do it!
|
|
|
|
|
Hi,
Does anyone know how to draw anti aliased lines and curves using MFC?
I've been playing with CDC::LineTo() and CDC::Pie(), etc but none of them produce the results I was looking for.
Any help would be appreciated.
Thanks,
Crercio O. Silva / DBTools Software
http://www.dbtools.com.br[^]
|
|
|
|
|
i'm not sure if windows would do this for you!
Don't try it, just do it!
|
|
|
|
|
Have a look at the GDI+ routines. It has a SetSmoothingMode() function that antialiase lines and circles.
Here[^]
I Dream of Absolute Zero
|
|
|
|
|
I have a Dialog based application .
I want to post message from this dialog to another class which is alos part of the same application.
Say When I click a button,this dialog posts a message to another class.
How should I achieve this?
how should I know about the class recieve that particular message?
Pls guide me with sample code.
Regards
YKUT
|
|
|
|
|
put that in the first dialog
const unsigned int wm_uiImportDone=RegisterWindowMessage("Import_Done");
give wm_uiImportDone as a pointer to the class
on the class, mae sure to add that to the message map
ON_REGISTERED_MESSAGE(wm_uiImportDone, OnImportDone)
then on the dialog, use:
::PostMessage (m_hWnd, wm_uiImportDone, 0, 0);
when m_hwnd is a pointer to the class that has to be derived from a window to get a message
|
|
|
|
|
Hi,
Let's say I have a CStatic control that is represented by a CString (m_str_status) which I pass to a working thread.
I want the thread to change this status while it works, and of course show it on the dialog....
THE PROBLEM IS --->Even if I pass a pointer to the dialog to the thread, UpdateData function is illegal and will cause an exception.
How do I force the dialog to update itself after I changed the value of the status string ?
Shay
|
|
|
|