|
im makin a program that should react only on user shutdown.
|
|
|
|
|
and what does this program do?
Don't try it, just do it!
|
|
|
|
|
well its just a simple program. it will just post a messagebox( reminder } on every shutdown and that reminder should not appear during log-off and restart sessions.
got any idea how to do it besides trapping the WM_QUERYENDSESSION message?
|
|
|
|
|
The net result of both a shutdown and a restart is the same (i.e., memory has been flushed, data has been written to disk, programs have been closed). The fact that it came back up with a restart should be irrelevant. However, without more details of what you are after, it's hard to suggest a more elegant solution.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
well i have this program that remains hidden and be shown when shutdown is detected. my problem is that it should not appear when the system restarts or logs off.
well logoff and shutdown can be detected on WM_QUERYENDSESSION and WM_ENDSESSION.
in what way or how does windows commands the system to power up again after shutting down ( restart ).
do you have any idea on how to accomplish it?
|
|
|
|
|
I have a program where I create various objects in mainframe. The objects are data members of class mainframe. I need to access these objects using member functions in dialog and view.cpp. How can I access objects in mainframe from dialog and view? Right now I am using a Extern to do it, but I dont like doing it that way.
Can someone give me a few ideas?
Thanks.
Jerry
|
|
|
|
|
use
CMyMainFrm *pFrm;
pFrm = (CMyMainFrm*)AfxGetMainWnd();
pFrm->{access the member functions or variables}
This space is empty.
|
|
|
|
|
I have a cmainframe in my project, but when I do the following:
(cmainframe is derived from cmdiframewnd)
cmainframe *pframe = (cmainframe*)afxgetmainwnd();
in a function that is part of my view.cpp file...
it doesnt recognize cmainframe
|
|
|
|
|
What error do you get, if you are getting any?
The Logic should work without any probs.
This space is empty.
|
|
|
|
|
I think I know what I did wrong, thanks. The compiler did not recognize the cmainframe object. I needed an include statement.
Thank you very much.
Jerry
|
|
|
|
|
I'm trying to filter the characters that are typed into an edit box. For example, I only want the characters A,B,C,D,E,F to be allowed to be typed into the box. Any other characters typed will not be displayed in the box.
Does anyone know how to do this?
Thanks,
Freddie
|
|
|
|
|
Basically you customise the edit control.
Derive a class from the CEdit and listen to the keyboard inputs if they are not amoung the charecters that you want then ignore them.
There are lot of these types of controls here in the codeproject. You can follow the link for CEdit on the leftside at www.codeproject.com
This space is empty.
|
|
|
|
|
Here's a quick and dirty implementation:
afx_msg void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags);
DECLAR_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
ON_WM_CHAR ()
END_MESSAGE_MAP()
<p></p>
void CMyEdit::OnChar (UINT nChar, UINT nRepCnt, UINT nFlags)
{
int lwr = tolower (nChar);
if (lwr >= 'a' && lwr <= 'f' && lwr != '.' ||
lwr == VK_BACK || lwr == VK_DELETE
)
CEdit::OnChar (nChar, nRepCnt, nFlags)
} Then add a control variable for the editbox and in your .h file change it's type to CMyEdit instead of CEdit. Not the best way to do it, but you could get by with it.
- Aaron
|
|
|
|
|
Hi
I want to implement Cut,copy,paste for explorer items.
I tried with SHFileOperation() But I didn't find a proper way for Cut and Paste. One more this how can I create a new folder?
Could anyone please help me to solve this?
Regards
Neha
|
|
|
|
|
did you consider MoveFile(...) for cut n paste operation?
Neha wrote:
One more this how can I create a new folder?
CreateDirectory(...)
This space is empty.
|
|
|
|
|
Thanks for the reply..
But I want to implement it in the same way as the explorer does.
That is if I say select any file and say copy it should copy the file to clipbord and I should be able to paste it anywhere.
|
|
|
|
|
I have a rtf editor based on dialog box in Visual C++.I have to use this function in my app.When i complile my app, it says undeclared identifier.In documentation says that this fct requires Windows 98.I have this operating system.Then why i get this message?
If this function works it saves my work.
Thanks a lot.
Adriana
|
|
|
|
|
|
Hello !!
I need the source code in C++ for a
Ladder Logic Editor for PLC Programming.
It can be similar editor as digital-editor or something
Thanx
cu
schonu
|
|
|
|
|
I'm trying to use ShellExecute to display the properties of file, like in explorer. I'm using something like this,
ShellExecute(NULL,"PROPERTIES","c:\\winnt\\notepad.exe",NULL,NULL,SW_NORMAL);
but it always returns code 31, which is invalid verb ("PROPERTIES"). I checked on MSDN, and the verb is correct, and it doesn't seem to be obsolete (I'm testing on a 2000 machine).
Any suggestions on what I'm doing wrong?
Thanks,
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
try "properties" in lower case and also try using ShellExecuteEx if possiable.
This space is empty.
|
|
|
|
|
That doesn't appear to make a difference for any of the verbs.
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Even I have the same problem.
I am getting the error as ERROR_NO_ASSOCIATION.
|
|
|
|
|
From your reply i did some R&D on this, for some reason
"properties" verb does not work with ShellExecute(...) but works with ShellExecuteEx(...)
This space is empty.
|
|
|
|
|