badgers
January 3rd, 2000, 02:41 PM
Hello, I have these two api calls that I would like to use. They seem to call the find/replace windows. I just have a simple project with a text box and a command button. I would like to have the ability to call the find/replace window. I understand I will have to use VB code to do the find/replace. I am wondering if it is possible to call these windows so that my project will "look" standardized.
module contains
option Explicit
public Declare Function FindText Lib "comdlg32.dll" Alias "FindTextA " (pFindreplace as FINDREPLACE) as Long
public Declare Function ReplaceText Lib "comdlg32.dll" Alias "ReplaceTextA" (pFindreplace as FINDREPLACE) as Long
public Type FINDREPLACE
lStructSize as Long ' size of this struct 0x20
hwndOwner as Long ' handle to owner's window
hInstance as Long ' instance handle of.EXE that
' contains cust. dlg. template
flags as Long ' one or more of the FR_??
lpstrFindWhat as string ' ptr. to search string
lpstrReplaceWith as string ' ptr. to replace string
wFindWhatLen as Integer ' size of find buffer
wReplaceWithLen as Integer ' size of replace buffer
lCustData as Long ' data passed to hook fn.
lpfnHook as Long ' ptr. to hook fn. or null
lpTemplateName as string ' custom template name
End Type
command button code
private Sub Command1_Click()
Dim result as Long
Dim x as string
Dim test as FINDREPLACE
x = "svelt"
test.lpstrFindWhat = x
'what to do what to do
End Sub
I am very new to the whole API thing and VB.
I can see that I have to find the handles of some windows. How do I do that?
also, how could I get this project to flash the find/replace window and get some info from it.
thank you for your time and have a good day
I’m so skeptical I can hardly believe it!
module contains
option Explicit
public Declare Function FindText Lib "comdlg32.dll" Alias "FindTextA " (pFindreplace as FINDREPLACE) as Long
public Declare Function ReplaceText Lib "comdlg32.dll" Alias "ReplaceTextA" (pFindreplace as FINDREPLACE) as Long
public Type FINDREPLACE
lStructSize as Long ' size of this struct 0x20
hwndOwner as Long ' handle to owner's window
hInstance as Long ' instance handle of.EXE that
' contains cust. dlg. template
flags as Long ' one or more of the FR_??
lpstrFindWhat as string ' ptr. to search string
lpstrReplaceWith as string ' ptr. to replace string
wFindWhatLen as Integer ' size of find buffer
wReplaceWithLen as Integer ' size of replace buffer
lCustData as Long ' data passed to hook fn.
lpfnHook as Long ' ptr. to hook fn. or null
lpTemplateName as string ' custom template name
End Type
command button code
private Sub Command1_Click()
Dim result as Long
Dim x as string
Dim test as FINDREPLACE
x = "svelt"
test.lpstrFindWhat = x
'what to do what to do
End Sub
I am very new to the whole API thing and VB.
I can see that I have to find the handles of some windows. How do I do that?
also, how could I get this project to flash the find/replace window and get some info from it.
thank you for your time and have a good day
I’m so skeptical I can hardly believe it!