|
-
August 3rd, 2001, 03:58 AM
#1
SendMessage to RichTextBox
Please tell me why the following code works on Win2K Server but not in Win9x.
I use the same version of Richtx32.ocx, riched32.dll and riched20.dll.
public Type CHARFORMAT2
.....
.....
End Type
dim charf as CHARFORMAT2
......
charf.cbSize = LenB(charf)
charf.dwMask = CFM_BACKCOLOR
charf.crBackColor = nColor
ret = SendMessageLong(rtfText1.hwnd, EM_SETCHARFORMAT, SCF_SELECTION, VarPtr(charf))
.....
-
August 3rd, 2001, 04:08 AM
#2
Re: SendMessage to RichTextBox
Is it a typo or it exists a SendMessageLong function or you have subclassed SendMessage.
Try with:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 3rd, 2001, 04:15 AM
#3
Re: SendMessage to RichTextBox
Thank you for your reply.
I declared function as :
public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, byval lParam as Long) as Long
-
August 3rd, 2001, 04:43 AM
#4
Re: SendMessage to RichTextBox
Matter is I found no information about SendMessageLong...
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 3rd, 2001, 05:00 AM
#5
Re: SendMessage to RichTextBox
Thanks.
But that code runs on Win2K
-
August 3rd, 2001, 05:07 AM
#6
Re: SendMessage to RichTextBox
Yes, as you provided the alias "SendmessageA". Have a try declaring it like I posted (even if I am afraid this is not the matter: some differences may exist on parameters type in win2K and win9x) .
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|