|
I got a very simple solution for you. All you have to do is to add up arrow click to the accelerator table. You can find it in the ResourceView. Specify an ID for the up arrow click and then just click on the View menu and open Class Wizzard. There select which class you want the up arrow message to be processed and then find the ID you wrote in before. In messages double click on COMMAND and that's gonna add a method into your class that gets called every time you click up arrow.
hope u get it to work
|
|
|
|
|
I got a very simple solution for you. All you have to do is to add up arrow click to the accelerator table. You can find it in the ResourceView. Specify an ID for the up arrow click and then just click on the View menu and open Class Wizzard. There select which class you want the up arrow message to be processed and then find the ID you wrote in before. In messages double click on COMMAND and that's gonna add a method into your class that gets called every time you click up arrow.
hope u get it to work
|
|
|
|
|
Hello, Codeguru.
I used to have the same problem a long time ago, but I did't remeber how to fix this problem so well..
But,
1) We can use PreTranslateMessage funnction in the dialog, and this function catches all message of the
keystorke or mouse event before the message dispatches to each control. And, try to use CWnd* GetFocus()
to check whether the up-arrow message is sure for the control which you want to check.
2) OnKeyDown function of each control may be called in subclassed derived class of each control.
That is, we derived from the new class from each control class, and the message will be catched inside
this class, and OnKeyDown will works.
Since I didn't find these codes in my old project, I'm not sure these works.
But, PreTranslateMessage function will works more than 2)
HTH.
-Masaaki Onishi-
|
|
|
|
|
Actually all you have to do is catch the WM_KEYUP event. Just go to classWizard, select the class
you like to handle the event, and then choose WM_KEYUP from the message entries. Then, choose
add function, and finally choose edit code. Then try AfxMessageBox(" up pressed"), and that will
tell you if you were able to catch it or not. It worked for me, so I am sure it will for you. I tried the
suggestion of adding the ID to the accelerator table but that didn't work. If you got it to work, I would
be interested in how you did it.
sayed hashimi
|
|
|
|
|
does anyone know how to implement a splitter window with a statusbar in each split window?
i've added one like it does in mainfrm and i get no errors but it just doesn't show up. any ideas?
|
|
|
|
|
Have you tried using the member function .ShowWindow ();
of the status bar class you created??
|
|
|
|
|
I created a dialog and add a menu to the dialog.
And also i added the message map for the menu in dialog file
In OnUpdateCommand, i wrote pCmdUI->Enable(FALSE);
But it didn't disable the menu item.
can any one help me
Thanks in advance
Mani
|
|
|
|
|
CDialog does not have the logic for calling OnUpdateCmdUI ... you need to add it yourself.
RKM
|
|
|
|
|
I have been trying to add a toolbar to my Dialog-bases application in VC++6 and i haven't found a way to do it yet.
Does anyone know how to do it or is it undoable?
thanks,
Mark
|
|
|
|
|
The following article:
http://www.codeproject.com/docking/display_dialog_tooltips.asp
shows how to do it.
Regards...
RKM
|
|
|
|
|
Hi,
I developed an application using VC++ 6.0 in win95.
And i copied the exe file with MFC42.DLL, MSVCRT.DLL to other win95 machine it works well.
But i copy the same to winnt or win98 it is not working properly. I have no idea about the problem.
Any other dll files required for win98 or winnt.
Please help me.
Thanks with regards
Mani
|
|
|
|
|
you can compile the exe file with the dll static linked,you just need to open the settings of the project then change the link options to WITH MFC STATIC LINKED ,compile it ,that is ok!
|
|
|
|
|
Hi,
I am working on a little program that is running as NT service. I need to know at any given moment if somebody (user) is logged in to the system or not. It has to be running under System account, so GetUserName() API doesn't help much since it always returns SYSTEM. I know that there have to be a way to do it and it is probably very simple, but I cannot figure it out. The worst part is that I have to get it to work by Monday.
Please help!
Thank you in advance.
Kostya.
|
|
|
|
|
I had to do something similar a while back - have a service know when someone logged in. This is a total hack, and it's not elegant, but I was also in a pinch so it's what I came up with.
- The service creates a named event when it starts.
- A second program runs from the HKLM Run key. All this program does is open the named event and signal it.
- Back in the service, it sees that the event is signaled, so it knows a user just logged in.
Caveats:
- This won't tell you when the user logs out. To do this, the secondary program would need to keep running and signal the event again when it receives the WM_ENDSESSION message.
- This won't tell you if someone logs in remotely.
- The service must create the event with an empty DACL, so that the secondary program can use it. If you take the default security, the event will have the DACL of the system account, and the secondary program won't be able to access the event. (I don't have my code anymore - it's at my old job - so I can't give you the exact code for making the DACL.)
- This requires that you add an entry to the HKLM Run key. This means you'll have to have admin or power-user privs at some point during your install process.
|
|
|
|
|
I think this is on the right track.
There are articles by Paula Tomlinson in the Feb 99 and July 99 issues of Windows Developers Journal that address this issue, and some of the code samples might be very similar to what Mike describes - especially the July issue.
|
|
|
|
|
Mike and Tim,
Thank you both for your help. I've just put some final touches on my app(s) and it appears to be working fine.
Unfortunately, the article by Paula Tomlison is not accessable via web, but between MSDN, KB and some other information sources I was able to figure it out. In particular, I found CSharedMemory class by Jeff Prosise very useful (http://www.microsoft.com/msj/defaulttop.asp?page=/msj/1198/wicked/wicked1198top.htm).
Anyway, thank you again.
Kostya.
|
|
|
|
|
I need a process to be repeated so long as the mouse button is down.What condition should i test for in my loop
|
|
|
|
|
Well, you catch onLButtonDown. Do you stuff there until to get the onLButtonUp. If you tell us, what
the process is that would help alot. I know what I am telling you here is primitive, but, you have to tell
us a bit more.
sayed hashimi
|
|
|
|
|
Hello i am stupidly new to C++, and i am trying to learn by my own.
I have bought several books and all of they are good but they all lack to continue showing how to do stuff.
One of the things i need to know to understand better c++ is how do you tell c++ to move or copy a file to another directory?
What libraries i need?
ANyone can psot some code for that here?
or send it to my mail.
abravo@arcextreme.com
Thanks
|
|
|
|
|
Copying files is an OS-dependent operation, so it's not part of C++ itself. On Windows, you use the MoveFile() and CopyFile() functions to move/copy files.
|
|
|
|
|
Hi
I need to enter and get 'double'-values from CListCtrl.
At the moment, I can enter and get CString from CListCtrl.
So far, so good but CString is not double !-)
Can anybody help me or give a tip ?
bye,
Sascha
bye the way: www.codeguru.com is very good, but I need a simple solution if possible.
|
|
|
|
|
The _tcstod() family of functions convert from a string to a double.
|
|
|
|
|
VC++6. I want to have more than 16 colors in my toolbar buttons. Is it possible? How do I do it?
|
|
|
|
|
maybe http://www.codeguru.com/toolbar/index.shtml
(http://www.codeproject.com/docking/)
|
|
|
|
|
Hi,
I've been given the task of writing a program which will monitor how many pages have been printed on the printer attached to a system, and after a certain number have been printed, it will print a page of its own. The system could be a network printer server, or just a desktop system. Ideally, it should not be written as a printer dirver.
I could use some help with ideas as to how to approach this.
Thanks,
Aaron
|
|
|
|