|
|
hello,
im trying to make a simple program that has a dialog bar with buttons on it,
now, i would really like to have the button react to different states (mouse over, mouse down etc.), just like internet explorer
image1 and winzip
image2 that will change accordinly
to what version of windows the user is using like this
image3
image4
my buttons dont even have to have a bitmap on them,
just those special states..
thank you.
asher
http://www.backup2000.com
|
|
|
|
|
You could create a new class for you button and catch the message WM_MOUSEMOVE, setting there a boolean value according to the position of the mouse, and modify the drawing according to this boolean value.
You may find useful info in this article: CButtonST v3.9 (MFC Flat buttons)[^]
Dansez sur moi, dansez sur moi,
Le soir de mes funerailles
Que la vie soit feu d'artifice
Et la mort un feu de paille
Claude Nougaro (1929-2004)
|
|
|
|
|
To my understanding, a CD has 0's and 1's (binary) written on it, and a laser reads the binary. Then the computer translates it. Please correct me if I am wrong. I am using MFC, and what I am trying to do is get all the binary data off of a CD, and put it to a char. Is this possible? Any help at all is appreciated.
-Dev578
|
|
|
|
|
a CD has nothing "written" on it!
there are pits and pats (or whatever they are called... dunno).
a change between pit and pat is a 1, if it doesnt change then it is 0.
to read the binary sectors from a CD you will need IOCTLs or even better SCSI.
IOCTL_CDROM_RAW_READ is the IOCTL, but i dont know if you will find it in MSDN, my doc is part of the DDK.
if you want to use SCSI then have a look at CDex src.
Don't try it, just do it!
|
|
|
|
|
Im makin a program that will respond to system restart and shutdown and i want to know how to idnetify shutdown from restart.
on WM_QUERYENDSESSION:
how do i know if the application is shutting down or making a restart?
What is the value of lParam parameter for shutdown and restart?
be glad if anyone would answer.
|
|
|
|
|
you cant get this information from WM_QUERYENDSESSION.
it just tells you, that you app will be closed and if it is just the user logging off.
Don't try it, just do it!
|
|
|
|
|
any idea where can i get that information?
|
|
|
|
|
no, why is this information interesting for you?
Don't try it, just do it!
|
|
|
|
|
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.
|
|
|
|