@jim said:
Win32API allows you to call Windows API functions.
Win API functions are some of the fundemental behind the scenes functions used by Windows itself to manage the Windows GUI.
MS doesn't advertise them because many can be used to affect other peoples compiled programs. (In this case they are being used to manipulate the Ruby console.
They can be difficult to learn to use properly as how they interact with each other is not published in depth. One fairly good source is:
http://allapi.mentalis.org/apilist/f.shtml (Note the alphabetical list at the top of the web page.)
FindWindow is used to locate a top level window by ClassName and WindowTitle. It returns a pointer to the found window.
Windows pointers are created and destroyed constantly so you cannot save and reuse the value once you glom onto it.
FindWindowEx is used to find Child or Sibling Window handles.
Just about every Graphical object in Windows is a window. Textboxes, Listboxes Etc...
SendMessage is an all purpose tool used to manipulate a Window.
The kind of manipulation is defined by a list of MessageCode Constants.
0x000C is the SET TEXT message. There are many more.
The Win32API module that you are referencing in Ruby must remap some of the parameters as there appear to more than the functions normally take.
In this case I believe that 'N' stands for number which would be the window pointers and P stands for a String Pointer. (Course that is just a guess.)