 |
|
 |
Call me lazy for not looking at the code or even trying, but...
I ran across a lot of similar code snippets/classes to do this, and they all exhibit one annoying problem:
If you kill explorer.exe (or it dies) and restart it, the icon is not redrawn.
I suppose I could work around it, but I'm wondering what event or notification one should look for to trigger code to force the icon to redraw itself when explorer.exe is re-launched...
|
|
|
|
 |
|
 |
You need to handle (and register) the window message "TaskbarCreated" via adding it again.
Greeting from Germany
|
|
|
|
 |
|
 |
Hi!
While trying to compile your code I always get the following errors:
LinkedClass.hpp(159) : warning C4346: 'JetByteTools::TLinkedClass::Iterator' : dependent name is not a type prefix with 'typename' to indicate a type
LinkedClass.hpp(159) : error C2143: syntax error : missing ';' before 'JetByteTools::TLinkedClass::Begin'
LinkedClass.hpp(159) : error C2501: 'JetByteTools::TLinkedClass::Iterator' : missing storage-class or type specifiers
What's wrong?
Bye
Thom
|
|
|
|
 |
|
|
 |
|
 |
Ok, thanks.
May be another reader has an idea...
Bye
Thom
|
|
|
|
 |
|
|
 |
|
 |
Hi Len,
did you got the chance?
Bye
Thom
|
|
|
|
 |
|
|
 |
|
 |
It was quicker to take a look rather than update my todo list so...
the addition of typename below fixes the problem
template typename TLinkedClass::Iterator TLinkedClass::Begin()
{
return Iterator(s_pListHead);
}
template typename TLinkedClass::Iterator TLinkedClass::End()
and the docs seem to say that this one is required too
typedef typename TLinkedClassIterator Iterator;
but it doesnt seem to help or hinder
Len Holgate
www.jetbyte.com
The right code, right now.
|
|
|
|
 |
|
 |
It still doesn't work. If I try: template typename TLinkedClass::Iterator TLinkedClass::Begin() { return Iterator(s_pListHead); }; I get the following errors: LinkedClass.hpp(160) : error C2899: typename cannot be used outside a template declaration LinkedClass.hpp(160) : error C2955: 'JetByteTools::TLinkedClass' : use of class template requires template argument list LinkedClass.hpp(120) : see declaration of 'JetByteTools::TLinkedClass' As far as I understand the typename keyword should by used like this: template <typename T> TLinkedClass<T>::Iterator TLinkedClass<T>::Begin() { return Iterator(s_pListHead); }; But this is also not working: LinkedClass.hpp(160) : error C2143: syntax error : missing ';' before 'JetByteTools::TLinkedClass<T>::Begin' LinkedClass.hpp(160) : error C2501: 'JetByteTools::TLinkedClass<T>::Iterator' : missing storage-class or type specifiers
Have you tried your suggestion before posting? If so, please put you exact code here.
|
|
|
|
 |
|
 |
I didnt notice that the copy paste had eaten the < etc.
I'll post the fix again when I get back to the office.
I had a clean compile with that fix this morning using VS.Net 2003 (honest!)
Len Holgate
www.jetbyte.com
The right code, right now.
|
|
|
|
 |
|
 |
template <class T> typename TLinkedClass<T>::Iterator TLinkedClass<T>::Begin()
does the trick for me
Len Holgate
www.jetbyte.com
The right code, right now.
|
|
|
|
 |
|
 |
Hi Len yeah, that's the trick. Thanks alot Thom
|
|
|
|
 |
|
 |
I see you have left and right double-click handlers, but is there a way to only call the single-click handlers *after* you have determined the user has not double-clicked. I think there is a way to get the system property for the double-click time. After receiving a button up message, you'd have to wait this amount of time, then call the single click handler.
If you have implemented this, do you mind sending me a code snippet? Otherwise, I'm going to implement it, and I'll send the snippet to you.
Thanks,
bre++
|
|
|
|
 |
 | Menu  |  | Anonymous | 7:22 2 May '02 |
|
 |
Hi
Can u please give me an example on how to add extra menu entiries please?
Thanks
|
|
|
|
 |
|
 |
I try to use this code to show a menu and different icons (depending on the state of the service) from a service. But I couldn't show up the icon. How do I do?
I am in interactive mode. My service inherits from CServiceModule (standard ATL wizard).
May someone help me?
Thanks for your response
Sincerely yours
|
|
|
|
 |
|
 |
By definition, a service cannot have an interface. If you want to provide an icon in the notification area, you will have to write a separate application, and provide some means of communication between the application and the service. You could use shared memory, sockets, or even DCOM to accomplish this.
--
Paul
"I drank... WHAT?"
|
|
|
|
 |
|
 |
"By definition a service cannot have an interface" - I think a more accurate statement would be that only a. processes running in the interactive login session and b. proceses running in the SYSTEM logon session (and this could include services) can access to WinSta0. For services this can be either set programmatically or on the service's property page there's a checkbox that says "allow service to interact with the desktop". Processes running in other login sessions (e.g. authority\principal) cannot see WinSta0.
But the question remains, how do you get that pesky icon in the system tray (by this I mean how do you detect the start of an interactive logon session, or when the desktop is created?). If you are going to write a separate program, and this sounds reasonable, how can you - as Administrator - ensure it runs when an interactive session starts, or is this something only the interactive user can set? Don't know the answer to that one - guess I gotta get me some more learnin'.
DEM.
|
|
|
|
 |
|
 |
david ewan wrote:
I think a more accurate statement would be that only a. processes running in the interactive login session and b. proceses running in the SYSTEM logon session
But it's generally bad form to do so...
david ewan wrote:
But the question remains, how do you get that pesky icon in the system tray
Treat it as a different problem The service is always there. It's up to the user (or installation program) to decide if they want to run a monitoring application. So if it's set to run when the user logs in, it runs. It can then use whatever IPC you want to talk to the service part of the app and report status however you like...
Len Holgate
www.jetbyte.com
The right code, right now.
|
|
|
|
 |
|
 |
Ok - so at the risk of sounding like a plank - as an Administrator, how do I do this: if I want my service to display an icon in the system tray for each logged on user, can I get it to run for each and every interactive user just by adding to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon ?
I know the short answer is "well #%*&*%!@ try it" - and I will - when I get some time - but sometimes it's easier to stop and ask for directions.
|
|
|
|
 |
|
 |
david ewan wrote:
Ok - so at the risk of sounding like a plank
I always think it's worth the risk. I'd never learn anything otherwise
david ewan wrote:
if I want my service to display an icon in the system tray for each logged on user
I've not done it, and I dont know what OS you're using but... I'd try creating a shortcut to the monitoring app under "\Documents and Settings\All Users\Start Menu\Programs\Startup"
Len Holgate
www.jetbyte.com
The right code, right now.
|
|
|
|
 |
|
 |
Or you could be sneaky and hide the startup in the regrestry, I find many programs doing this (Special tahnks to msconfig)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
|
|
|
|
 |
|
 |
I run the MFCApplet under win2k, two questions arise:
1. two same icons in the taskbar tray
2. when you double click, the "MFC Task Bar Applet" dlg pops up, but it's
caption is grey, that is, it's not active, this problem is very troublesome.
Can you help me to answer the questions ? Thank you very much!
|
|
|
|
 |
|
 |
1) It's a sample, the sample demonstrates multiple applets in one exe by displaying the one applet twice...
2) I know. I think it's due to one of the calls to set foreground window in the message handling code but I havent had a chance to look at it and debug it. I'll see if I can take a look at the weekend.
|
|
|
|
 |
|
 |
Is it possible to create a mfc dialog based dll application with integration to Shell. For eg. On right click of a file , i would like to display the contents in a dialog based application which is again a dll. Since iam encountering problems in reading the resource file. Any good idea would be real great.
Kenu
|
|
|
|
 |