|
-
Dec 26th, 2001, 02:22 PM
#1
Thread Starter
New Member
New to API
Ok, Isn't API where you can find like the TEXT box thingy in the program? Well I use 6.0 Enterprise and I want to find the API for a program. I have no clue on what to do.
-
Dec 26th, 2001, 02:36 PM
#2
Isn't API where you can find like the TEXT box thingy in the program?
What do you want ? What is the thingy ? You mean carret?
-
Dec 26th, 2001, 02:42 PM
#3
Thread Starter
New Member
Its arcmatch.exe, I want to find the Text box that you write your text in and find a way to make it Enter when done.
-
Dec 26th, 2001, 07:57 PM
#4
Frenzied Member
First off, API is Application Programming Interface, which allows you to do a load of things not possible in regular windows (like shutdown windows, draw squiggles, change window shapes, etc, etc).
If you want to find the hwnd of a textbox, use the Findwindow API:
VB Code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
USAGE:
var = FindWindowEx(FindWindow(vbNullString, "Window's Text"), 0&, "Edit", vbNullString)
You should really start off by understanding the API with something like Karl Moore's API Tutorial, Part I of I.
MicroBasic
Dragon Shadow Trainer
There is no good or evil in the world...only programmers and fools .
-
Dec 27th, 2001, 11:53 AM
#5
What do you mean by "make it enter?"
-
Dec 27th, 2001, 01:08 PM
#6
Frenzied Member
Ah, and you don't find the "API" of a program. You can, however, find the process ID of a program or the hwnd of a window in a program, but not the API (because API is a group of Windows functions compiled with C that is NOT specific to a program).
If you mean stimulating an Enter keystroke, use this:
VB Code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_CHAR = &H102
USAGE:
Dim hvar As Long
hvar = FindWindowEx(FindWindow(vbNullString, "Window's Text"), 0&, "Edit", vbNullString
SendMessage hvar, WM_KEYDOWN, 13, 0
SendMessage hvar, WM_KEYUP, 13, 0
SendMessage hvar, WM_KEYCHAR, 13, 0
+ =
+ =
MicroBasic
Dragon Shadow Trainer
There is no good or evil in the world...only programmers and fools .
-
Dec 27th, 2001, 06:26 PM
#7
Originally posted by Microbasic
If you mean stimulating an Enter keystroke:
You mean simulating, right? ;-)
(Sorry; I'm a major grammar freak).
-
Dec 27th, 2001, 06:32 PM
#8
Frenzied Member
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
|