|
-
Mar 17th, 2004, 10:42 AM
#1
Thread Starter
Lively Member
What is faster?
Hello all,
What Im trying to find out is if using SendMessage is faster than using this with a RichTextBox:
Code:
RichText1.SelStart = Len(RichText1.Text)
RichText1.SelText = mystring
If so, I will appreciate if you could point me to the right Consts and maybe an insight of what to do. Thanks a lot.
-
Mar 18th, 2004, 04:13 PM
#2
Hyperactive Member
Use the GetTickCount and SendMessage API calls:
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Const WM_SETTEXT = &HC
Populate a long variable with the result of GetTickCount, then subtract this from another result of GetTickCount after you have done your comparison code.
I've put together this myself out of curiosity, was suprised at the results to be honest..
-adehh
-
Mar 20th, 2004, 05:49 PM
#3
Member
Re: What is faster?
Originally posted by Xcoder
Hello all,
What Im trying to find out is if using SendMessage is faster than using this with a RichTextBox:
Code:
RichText1.SelStart = Len(RichText1.Text)
RichText1.SelText = mystring
If so, I will appreciate if you could point me to the right Consts and maybe an insight of what to do. Thanks a lot.
Have you figured it out yet or still trying? B/C now im kinda courious myself, so I may give it a try. From jstu looking at it, I think that send message would give the command slower, since all the messages are handled, compared to using a function directly.
Good programming site:
*http://www.planet-source-code.com
Our CS Clan Page:
*http://h2p.inter-gamer.com/index.html
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
|