|
you need to call something like this before exiting your app:
Shell_NotifyIcon(NIM_DELETE, &nidIconData);
|
|
|
|
|
ooops, sorry, i guess i am still sleepy, i missed that "when killed from task manager" part
|
|
|
|
|
One important thing: killing an application is a really bad thing to do . When you kill an application, the clean-up code is not executed and that's why your icon still remains. The best solution to this problem: quit your application normally . Your application isn't supposed to be finished with the task manager killing it.
|
|
|
|
|
If you kill it by your task manager you can't predict what will happen and ensure that the icon is removed ...
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Thanks for the reply.
My application is launched from installation. The applcation runs similiar to daemon or service. So, i need to terminate the process during uninstallation. I am using TerminateProcess() to kill the applcation.
Is there any alternative solution?
Thanks & Regards,
Madhu
|
|
|
|
|
You have 2 options after TerminateProcess() has killed it:
- Try Shell_NotifyIcon[^]with NIM_DELETE.
- Or force a repaint if you have the handle of the system tray:
<br />
CWnd *tray=FindWindow("Shell_TrayWnd", NULL);<br />
tray->SendMessage(WM_PAINT,0,0);<br />
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 4:30 Monday 29th August, 2005
|
|
|
|
|
MadhukarG wrote:
I am using TerminateProcess() to kill the applcation.
Why are you using TerminateProcess to Kill the process(Even MSDN caution you tp use that in extreme case), why don't you WM_QUIT /WM_CLOSE or similiar function to close the application
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
11:46 am IST Monday Aug 29, 2005
Good Morning,
How can I convert ascii code to char in vc++ for ascii codes between 128 - 255.
|
|
|
|
|
converting int to char is implicit, it happens by itself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
a char in C/C++ is only an integer which contain the ascii code (1 byte so) of the character it stores.
so, writing the two following lines is equal :
char c = 57;
char c = 0x39;
char c = '9';
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
Since you mention codes 128 - 255, it is probably better to use unsigned char, since char will be negative in that range.
As other replies have said, char and ASCII codes are the same thing. You can see either a character or a numeric value when using printf (or whatever other output).
To see the difference, try the following:
<br />
char cMyChar;<br />
unsigned char ucMyUnsignChar;<br />
uMyChar = 77;
ucMyUnsignChar = 77;<br />
printf ("Character is %c, value is %i, unsigned is %c, unsign value is %i.\n",uMyChar,uMyChar,ucMyUnsignChar,ucMyUnsignChar);<br />
ucMyChar = 220;
ucMyUnsignChar = 220;<br />
printf ("Character is %c, value is %i, unsigned is %c, unsign value is %i.\n",uMyChar,uMyChar,ucMyUnsignChar,ucMyUnsignChar);<br />
NOTE: I'm not sure if this is correct - I don't have access to a C compiler on my office PC. I'm sure others will help!
|
|
|
|
|
5:20 am EST USA
What the other respondents are saying is correct, there realy is no conversion required.
I suspect that your probably having a character set (font) problem.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
does anyone have a reliable way to detect whether a user's default input locale is RTL?
this is so that i can dynamically switch the direction of a richedit control.
thanks
.dan.g.
AbstractSpoon Software
|
|
|
|
|
Hello all,
how can I run a program? i want to run the Windows's calculator program which i don't know its location. (i only know that it is in program files).
also, how can run a non-executable program such as html files (Windows itself to run ie)? a function required.
|
|
|
|
|
Windows' calculator program location: %SystemRoot%\System32\calc.exe.
You can use 'spawn' to start new processes from your own program code.
Er zit een korstje op mijn aars.
|
|
|
|
|
ShellExecute does this for you, the HTML file as well.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Ali Tavakol wrote:
how can I run a program? i want to run the Windows's calculator program which i don't know its location. (i only know that it is in program files).
This article will Help:-
http://www.codeproject.com/system/newbiespawn.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
How To Implement ADSL Dialing in Win2K
--------------------------------------------------------------------------------
I learned from other articles to use RASDial Function to Implement Dialing ,but it seems that It can not apply to ADSL Dialing,Is that true
How Can I Implement ADSL Dialing
ps: Another Question about CFtpConnection
if I got a file handle from this and want to resume downloading a file
but it seemed that CInternetFile's Seek Function can not succeed ,how can I implement Rusuming downloading using CFtpConnection
|
|
|
|
|
Hi,
I'm not even sure of what the subject should be. I searched CP and the forums but couldn't find anything that sounded like my problem.
I have a program that shows the current date/time. However, if I close my laptop and it goes to sleep (hibernate?), when I open it up again my program does not "refresh" and the "old" date/time is still displayed.
The same thing happens on my desktop when I "lock" the computer or logoff. When I log back on, the date/time is not refreshed.
What Windows message does my program need to capture to know that a refresh is necessary? Or am I in even deeper doo-doo?
Thanks,
Abu Mami
|
|
|
|
|
like MoveFileEx(path);
but it only work on win NT,
I want to delete all file in the path after reboot the machine.
thanks!
|
|
|
|
|
DeleteFile will delete a file. MoveFile will move it. MoveFileEx does exist only for the NT stream, but MoveFile is fine.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
szcococut wrote:
I want to delete all file in the path after reboot the machine.
you have to modify the the WinInit.ini file to achieve the same.
It's an INI file, however for deleting it's harder because the format is:
[rename]
NUL=C:\\temp\\file1.exe
NUL=C:\\foo\\file2.exe
and so on. You can\'t use WritePrivateProfileString() because
the second NUL line would replace the first. You need to read
the whole file in,modify it, and write it back out
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
why will the exception appear, when the mfcie's window is maximized from normal or normal from maximized?
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
Warning: constructing COleException, scode = DISP_E_MEMBERNOTFOUND ($80020003).
First-chance exception in Book.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
First-chance exception in Book.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
the mfcie is a sample of MSDN.
|
|
|
|
|
I had designed a Dialog of Protocol Simulator. Inside the Dialog it have a IP address box to key in the the destination IP address, a edit box to tape your message, some button that when you click it will automatic send a message to the destination, and lastly a send button. I just don't know how to do the program that when I key in the IP address and click the button and it will send the message. I want to test the program using the 127.0.0.1 IP address. Can help me just give some guide and example.
|
|
|
|