|
Hi Kanel,
It is just what I am looking for! Sorry for the late response, I am a little busy these days.
regards,
George
|
|
|
|
|
George_George wrote: It is just what I am looking for! Sorry for the late response, I am a little busy these days.
No problem, sometime I also busy with my work too. In the future, if you have any problem you can post a question in this forum. I and the other people would try to support you any time as much as possible.
Good luck with your work
|
|
|
|
|
I use RemoveFontResourceW in GDI32 to remove the system font Roman, but failed. The step as follows,
1. Call RemoveFontResourceW. (The return value is non-zero, that is, the function succeeds)
2. Call SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0) (The return value indicates it succeeds)
3. Move roman.fon file from C:\windows\fonts to another folder using File.Move function in .net framework.
After finish the steps, I can still see the font file in c:\windows\fonts folder, although the file size has been changed to 0. Roman entry has been remove in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts.
In order to verify if Roman font is actually removed from system, I open the wordpad program and try to select the Roman font. The result is Roman is still in the listbox.
So anybody can tell me how to programly remove the specific system font from my local box? Thanks in advance!
RemoveFontResouce function in MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_1m3p.asp
Thanks a lot!
Bo
|
|
|
|
|
Bo,
If you read further down the page you linked in the remarks section:
"If there are outstanding references to a font, the associated resource remains loaded until no device context is using it."
I would take that to mean you would not be able to remove the Roman font, as it is an original system font until after a reboot. Also If I'm not mistaken, all the original system fonts are also protected from being moved and or deleted by windows file protection.
Does it work when you add and remove a font that is not an original windows system font?
progload
|
|
|
|
|
hi progload,
Thanks for your quick reply. I didn't try removing an custom font since no one is on hand. Maybe I give it a try.
I am curious that I can manually remove the Roman font via Windows Explorer. It indicates Roman font is not used by other applications.
I got the following interesting result:
1. backup roman.font to another folder
2. After reboot the machine, the code works fine at the first time.
3. Reinstall the roman font. You can do it by clicking the "Install New Font..." menu in System Fonts folder.
4. The code failed in subsequent runs.
Any idea? Thank you very much!
Thanks a lot!
Bo
|
|
|
|
|
Bo,
Windows Explorer would be the program (I would guess) that did have the most "rights" to use and remove the Roman system font. It is the most likely canidate for holding it in use, so it still looks to me like it is most likely a windows protection issue, At any rate, I would be very leary about removing Original system fonts, I have seen very bad things happen when they are "accidentally" removed and most font managers either avoid or warn you not to remove original system fonts.
Anyway, I'm curious about if it works ok with a custom font.
Progload
|
|
|
|
|
I'll try to remove a custom font with above code, and let you know once I finish it.
Unfortunately in my case I must remove the system font in order to verify a feature in our product. Hope I find a good way.
Thanks a lot!
Bo
|
|
|
|
|
This article[^] will show you a simple way to install and delete the font. But in this article its also inform that the font also record in the registry. That might be the registry that you try to delete. Try to do move the font another folder, delete the font, delete the registry key and restart the computer.
|
|
|
|
|
Hi Roath,
Thanks for your help .
I notice that the corresponding registry key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts has been removed after run my code.
The system font can be easily removed/added via Windows Explorer, and doesn't need to reboot the computer. I wonder if there is a programming code which is what I exactly expected to do the same thing.
Thanks a lot!
Bo
|
|
|
|
|
BoHuang wrote: Hi Roath,
My name is Kanel, please call me Kanel.
BoHuang wrote: I notice that the corresponding registry key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts has been removed after run my code.
The system font can be easily removed/added via Windows Explorer, and doesn't need to reboot the computer
In my opinion, you should build the code to prompt the user to restart the machine in order to take new effect after you change some configuration to the system.
|
|
|
|
|
Roath Kanel wrote: My name is Kanel, please call me Kanel.
Oh, sorry
Roath Kanel wrote: In my opinion, you should build the code to prompt the user to restart the machine in order to take new effect after you change some configuration to the system.
Maybe you're right, but it is the worst solution and cannot pass the code review. I'll try my best to find another solution.
Thanks for your help!
Thanks a lot!
Bo
|
|
|
|
|
BoHuang wrote: Oh, sorry
No problem. You are always welcome.
BoHuang wrote: Maybe you're right, but it is the worst solution and cannot pass the code review. I'll try my best to find another solution.
I might try to find another resource to help you about this case. If I found any information I will let you know later.
|
|
|
|
|
Thanks a lot, kanel
Thanks a lot!
Bo
|
|
|
|
|
Hello, could you please help me with this:
I am porting a solution for PocketPC 2003 written in eVC 4.0 using MFC to Visual Studio 2005 (Visual Studio 8).
Now I recognized there is no CDumpContext in the MFC-Version in VS 2005? Why is this? When looking into afx.h, where CDunpContext is declarated for Embedded C++ 4.0, it does not belong to WinCE-devices:
#ifndef _WIN32_WCE
class CDumpContext
{
...
}
#endif
Is there any replacement for dumping?
Thanks a lot...
Martin
-- modified at 7:28 Monday 12th June, 2006
|
|
|
|
|
|
hi there,
I keep getting this error whenever I work on Visual basic or sometimes other things: The instruction at "0x30840c77" referenced memory at "0x0ef20000". The memory could not be "Read".
Please Help
|
|
|
|
|
Hi, You must change attributes of this memory page. use this code.
DWORD VirtualQuery(
LPCVOID lpAddress,
PMEMORY_BASIC_INFORMATION lpBuffer,
SIZE_T dwLength);
this function fills MEMORY_BASIC_INFORMATION structure & then call
BOOL VirtualProtect(
LPVOID lpAddress,
SIZE_T dwSize,
DWORD flNewProtect, // PAGE_READONLY
PDWORD lpflOldProtect
);
Zqr
|
|
|
|
|
In my opinion, you have a problem with your computer RAM. Try to replace another memory.
|
|
|
|
|
totally pointless answer.
he has a memory access violation due to some application. it's not a RAM full problem, because he would have get an error saying so.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Thank you very much for your comment. It is not a completely fault RAM. If full RAM is fall, you will not be able to start an operating system. But in this case, if his application is importance that need to work with, he should try another RAM because it might solve the problem that he's challenges.
|
|
|
|
|
This is almost certainly not a ram problem. This error normally comes from a bogus pointer. Failing ram or a failing/overheating cpu could cause this, but unless the system's heavily overclocked the the cause is almost always a program bug.
|
|
|
|
|
Thank you very much for your detail explaination. Good luck!!!
|
|
|
|
|
Roath Kanel wrote: Good luck!!!
why ?!
Roath Kanel wrote: Thank you very much for your detail explaination
he said what toxcct sait with other words...
-- TTD --
|
|
|
|
|
super_ttd wrote: Roath Kanel wrote:
Good luck!!!
why ?!
The way that I greeting people.
super_ttd wrote: he said what toxcct sait with other words...
Yes, I know. Thank you!!!
|
|
|
|
|
hi ,
plz give me links for online studies and screen shots for MAC / LINUX os
thanks for paying attention
rst...
|
|
|
|