473,810 Members | 3,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SendMessage, fonts

2G
Hi everybody

I think i'm doing something wrong . :)

When I install a new font, all my programs (like photoshop) that are running
don't respond anymore for like 2 min, after that I can use the font whitout
restarting the applications but I can not delete the font untill i reboot my
pc (i tried killing all processes but that didn't work).

If anyone would take a look , I do the following :

[DllImport("user 32.dll", CharSet=CharSet .Auto)] static extern IntPtr
SendMessage(Int Ptr hwnd, int msg, int wParam, int lParam);

private const int HWND_BROADCAST = 0xffff;

private const int WM_FONTCHANGE = 0x001D;

private void cmdInstall_Clic k(object sender, System.EventArg s e){

clsFontFamily f = (clsFontFamily) cboFonts.Select edItem;

string n = f.Path.Substrin g(f.Path.LastIn dexOf("\\")+1);

File.Copy(f.Pat h, iPath + "\\" + n, false);

SendMessage((Sy stem.IntPtr)HWN D_BROADCAST, WM_FONTCHANGE, 0, 0);

int i = AddFontResource (iPath + "\\" + n);

}

Thx in advance.


Nov 15 '05 #1
2 7053
Hi 2G,
Probably you should notify after adding the font to the fornt resource pool.
Have you tried to change places of SendMessage and AddFontResource calls.

--
HTH
B\rgds
100
"2G" <2g@pandora.b e> wrote in message
news:5k******** **********@phob os.telenet-ops.be...
Hi everybody

I think i'm doing something wrong . :)

When I install a new font, all my programs (like photoshop) that are running don't respond anymore for like 2 min, after that I can use the font whitout restarting the applications but I can not delete the font untill i reboot my pc (i tried killing all processes but that didn't work).

If anyone would take a look , I do the following :

[DllImport("user 32.dll", CharSet=CharSet .Auto)] static extern IntPtr
SendMessage(Int Ptr hwnd, int msg, int wParam, int lParam);

private const int HWND_BROADCAST = 0xffff;

private const int WM_FONTCHANGE = 0x001D;

private void cmdInstall_Clic k(object sender, System.EventArg s e){

clsFontFamily f = (clsFontFamily) cboFonts.Select edItem;

string n = f.Path.Substrin g(f.Path.LastIn dexOf("\\")+1);

File.Copy(f.Pat h, iPath + "\\" + n, false);

SendMessage((Sy stem.IntPtr)HWN D_BROADCAST, WM_FONTCHANGE, 0, 0);

int i = AddFontResource (iPath + "\\" + n);

}

Thx in advance.

Nov 15 '05 #2
2G
Yep, did that but with the same result.

Grtz.

"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:OY******** ******@TK2MSFTN GP11.phx.gbl...
Hi 2G,
Probably you should notify after adding the font to the fornt resource pool. Have you tried to change places of SendMessage and AddFontResource calls.

--
HTH
B\rgds
100
"2G" <2g@pandora.b e> wrote in message
news:5k******** **********@phob os.telenet-ops.be...
Hi everybody

I think i'm doing something wrong . :)

When I install a new font, all my programs (like photoshop) that are running
don't respond anymore for like 2 min, after that I can use the font

whitout
restarting the applications but I can not delete the font untill i

reboot my
pc (i tried killing all processes but that didn't work).

If anyone would take a look , I do the following :

[DllImport("user 32.dll", CharSet=CharSet .Auto)] static extern IntPtr
SendMessage(Int Ptr hwnd, int msg, int wParam, int lParam);

private const int HWND_BROADCAST = 0xffff;

private const int WM_FONTCHANGE = 0x001D;

private void cmdInstall_Clic k(object sender, System.EventArg s e){

clsFontFamily f = (clsFontFamily) cboFonts.Select edItem;

string n = f.Path.Substrin g(f.Path.LastIn dexOf("\\")+1);

File.Copy(f.Pat h, iPath + "\\" + n, false);

SendMessage((Sy stem.IntPtr)HWN D_BROADCAST, WM_FONTCHANGE, 0, 0);

int i = AddFontResource (iPath + "\\" + n);

}

Thx in advance.


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
19414
by: Mark Overstreet | last post by:
I am trying to click a button in another window and I have it's hWnd value so I was trying to use Send message. Here is my code but it doesn't work as expected... response = Win32API.SendMessage(hWndYesButton,Win32API.BM_SETSTATE,0,null); response = Win32API.SendMessage(hWndYesButton,Win32API.WM_LBUTTONDOWN,1,"11"); response = Win32API.SendMessage(hWndYesButton,Win32API.WM_LBUTTONDOWN,1,null); response =...
3
10167
by: JSK | last post by:
Hi, As any one worked in VB.NET and made use of Sendmessage API? The Issue I am running into is how to pass pointers of Data Structures (UDT) to the SendMessage. I starting looking at "IntPrt" as a data type but it appears to fall short of using pointer types. Any help or insight would be greatly appreciated. Thank You
0
1716
by: SamSpade | last post by:
In my C# library I have many SendMessages like the following: public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, ref PARAFORMAT2 pf2); I use this one like this:
3
5346
by: Rob | last post by:
Hi all, I am having trouble converting the code below (found on http://vbnet.mvps.org/index.html?code/core/sendmessage.htm) into a format that will work using vb .NET. Can anyone have a look at it and let me know what I need to change. I have tried changing the "hwnd" type into intptr's but there seem to be other problems too, like it won't allow "lParam As Any" to be declared.
18
6568
by: Lars Netzel | last post by:
Hello! Thanx to this newgroup I have finally, with the help of you guys, gotten this to work halfway.. but the final action is still not working, clicking the "Button2" thru SendMessage(). Private Declare Auto Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Auto Function FindWindowEx Lib "user32" (ByVal hWnd1 As
4
2137
by: Abubakar | last post by:
Hi, My application has a lot of threads which at some point call SendMessage api passing it the handle of the gui window. The calls r a lot. My question is that should I call the SendMessage api by protecting it in a critical section, or the SendMessage api itself handles this kind of situation where a lot of threads in the same process r calling it. Regards,
22
9264
by: SQACSharp | last post by:
I'm trying to get the control name of an editbox in another window. The following code set the value "MyPassword" in the password EditBox but it fail to return the control name of the EditBox. I'm sure the problem is the way i'm using the sendmessage API, the return string and the lParam return 0....is anybody have a clue? any sendmessage api expert here? public static extern Int32 FindWindow(String lpClassName,String
1
13421
by: Necromis | last post by:
Ok, I have gotten my head around things better regarding SendMessage and FindWindow functions. However, I am running into an issue with my code still. The program I am working with is EXTRA! by Attachmate. It is a mainframe terminal. Here is the issue and strange part of it. It is accepting sendmessage when I use the WM_KEYDOWN/UP commands. However, when I use WM_SETTEXT to send my string it is not imputing the string to the session...
5
5238
by: michelqa | last post by:
Hi, I need to call a lot of different native SendMessage to retreive informations from non managed application. Some win32 messages use struct pointer for lparam....how to create and marshaling the struct to be able to use it in sendmessage... Here is an example LM_GETITEM: http://msdn.microsoft.com/en-us/library/bb760720(VS.85).aspx
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.