Arba’in – The Fourth

Sci,Tech and Ent

API Programming Lesson 1

I’ve begun to study the API Functions of VB6 alongside VB2005 Coding (OMG, it’s gonna be tough 😮 ).

Notes from Lesson 1:

  • These are the basic functions of API : FindWindow, FindWindowEx, GetCursorPos, WindowFromPoint, GetClassName, GetWindowText, and SetWindowText (SendMessage could be the basic function too, but i have not studied about it. I’ll write about it in lesson 2 :))
  • These are the basic functions which need buffer for storing the return value : GetClassName and GetWindowText (Does it mean that all API functions began with ‘get’ always need buffer ? I’ll find the answer :))
  • FindWindow, FindWindowEx and WindowFromPoint will return the handlewindow (hWnd) of a window. If you know the class name, use FindWindow/FindWindowEx. If you don’t know the class name, use WindowFromPoint instead.
  • FindWindow could be used to determined if a window was a parent or a child window. Just use it with a class name (class got by windowfrompoint function). If the return value is 0 then it’s a child window and vice versa.
  • If you want to edit a window text with SetWindowText function individually, use hWnd generated by WindowFromPoint. If you want to set window text globally, use hwnd genereted by FindWindowGetClassName instead (Still confusing me).


I think it’s enough for today 🙂 


January 29, 2007 - Posted by | Activity, IT

1 Comment »

  1. I really like your blog, wrote brilliantly, thank you for sharing!
    By Jordan Retro 11

    Comment by Jordan Retro 11 | May 23, 2010 | Reply

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: