Important alert: (current site time 7/16/2013 12:31:32 AM EDT)
 

article

_A Supreme Window API tutorial ****

Email
Submitted on: 1/3/2003 12:45:08 AM
By: Jaime Muscatelli  
Level: Beginner
User Rating: By 76 Users
Compatibility: VB 6.0
Views: 91947
author picture
(About the author)
 
     READ ALL**** This is a COMPLETE tutorial on api concerning actual windows. FINDWINDOW(), FINDWINDOWEX(), GETPARENT(), GETWINDOWTEXT(), SETWINDOWTEXT(),SENDMESSAGE(), WindowFromPoint(),WM_ constants, EM_ constants. All separate tutorials for advanced programmers, and also go in order for new api programmers. I cover pointers, buffers, basic api, window api, cover it deeply and completely, and include sample code and examples. You need to see if you have a pretty good or no grasp of window api. Learn how to make an API spy from this as well. You will be extremely pleased. Uses notepad for all examples. Also teaches parent/child hwnd types, explains hwnd, does everything! Please download and vote :-) KEYWORDS: Jaime Muscatelli

 
winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 17 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

1/3/2003 7:43:15 AMDondata

I like you code
Allso I like SendMessage() too :-)

You got me vote!
(If this comment was disrespectful, please report it.)

 
1/5/2003 12:52:00 AMJeff Bramwell

Nice and concise. A great refresher for those of us who have been using VB for a while.
(If this comment was disrespectful, please report it.)

 
1/6/2003 3:24:17 PM

Great work! I was pulling my hair out not understanding the handle relationship and now it's VERY clear. Thanks.
(If this comment was disrespectful, please report it.)

 
1/6/2003 8:25:00 PMJaime Muscatelli

Thanks guys, don't forget to vote!
(If this comment was disrespectful, please report it.)

 
1/16/2003 2:15:51 AMRalphy Boy

Really good work. Easy to understand and concise

Is there anywhere (other than the VB API viewer) that we could find a full list of SENDMESSAGE constants?
(If this comment was disrespectful, please report it.)

 
1/16/2003 8:46:25 PMJaime Muscatelli

Sure, try www.vbapi.com, or search google for SendMessage()
(If this comment was disrespectful, please report it.)

 
1/30/2003 2:08:38 PMthe_tron

Very nice! It's rare to come across such a detailed explanation of code with lots of comments etc. You get 5 globes from me, keep up the good work! ;)
(If this comment was disrespectful, please report it.)

 
1/31/2003 4:55:23 PM

keep up the good work!
(If this comment was disrespectful, please report it.)

 
2/4/2003 1:54:19 PM

umm i was wonding how to select mutilpal EDIT boxes
(If this comment was disrespectful, please report it.)

 
2/23/2003 4:46:22 PMNathanael B

This was just what I needed! 5 globes and keep up the good work. Part 2 was good as well.
(If this comment was disrespectful, please report it.)

 
3/1/2003 9:20:10 AMJaime Muscatelli

Hi, thanks for the great comments. As for the "multiple textboxes", I have placed a new tutorial on PSC for that. It is called A Supreme Window API Tutorial Part 2. Check it out and vote!
(If this comment was disrespectful, please report it.)

 
3/1/2003 11:37:38 PM

Excellent code man! If you have anymore tutorials could you post them here or email them to me? Thanks! Once again, GREAT JOB!
(If this comment was disrespectful, please report it.)

 
3/4/2003 9:24:29 AM

i'm looking article how to make operating system
(If this comment was disrespectful, please report it.)

 
3/4/2003 7:41:13 PM8BallPayer

Great article. It was a big help with some questions I was having. Thanks for putting up the tutorial, five globes from me.
(If this comment was disrespectful, please report it.)

 
3/10/2003 6:48:50 PM

Very helpful. It helped me get a Handle on VB (pun intended). Thank you.
(If this comment was disrespectful, please report it.)

 
3/16/2003 10:30:30 AMFrEdDeApA

Very good code! Thx
(If this comment was disrespectful, please report it.)

 
3/25/2003 12:59:45 AM

this is good for beginners in api procedures thank u
(If this comment was disrespectful, please report it.)

 
3/25/2003 8:45:25 AM

Hi Jaime..

Again.. really nice work.. it helped to solve my problem AND it is entertaining while I learn..
keep it up..

Martin :-)
(If this comment was disrespectful, please report it.)

 
5/26/2003 1:41:39 PM

This is cool . i was looking 4 such a tute since a week . you get 10 by 10
marks
(If this comment was disrespectful, please report it.)

 
6/21/2003 1:13:50 AM

Jaime,
Excellent!!
Elegant piece of work :)

Thanks

(If this comment was disrespectful, please report it.)

 
7/3/2003 6:40:23 AM

cool to teach some people like me how to do that stuff man.
(If this comment was disrespectful, please report it.)

 
7/21/2003 5:09:55 AMyan f

It's really bad tutorial , cause that I gave you 5^5^5^n globes :-)
(If this comment was disrespectful, please report it.)

 
7/22/2003 1:38:36 AM

thank you for tour tutorial!!!
(If this comment was disrespectful, please report it.)

 
8/18/2003 4:11:50 AM

Excellent tutorial, Exactly what I needed.
I loved the Sendmessage part.
Five globes from me.
(If this comment was disrespectful, please report it.)

 
10/25/2003 3:09:41 PM

keep up the good word, your work is more than enough
(If this comment was disrespectful, please report it.)

 
12/9/2003 10:05:27 AMNelson T

More than helpful. Thanks for your submission.
(If this comment was disrespectful, please report it.)

 
1/3/2004 8:35:09 AMNecron

Funny Virus!!

Would Anyone Know how i Can Get Windows to RepAint Its Self on the Whole Screen?
(If this comment was disrespectful, please report it.)

 
1/16/2004 7:53:59 AMBen Jones

Wel done, its a brilliant tutorial, i got it first time i read it thanx
(If this comment was disrespectful, please report it.)

 
1/18/2004 1:45:43 PM

I am trying to use this technique for paltalk, although it has 3 RichEdit20A windows, and it doesnt work, could anyone direct me around this: djwhiteknight@hotmail.com
I'm also on MSN with that email if u wana contact me
(If this comment was disrespectful, please report it.)

 
1/18/2004 4:04:49 PMJaime Muscatelli

Yes, my second window api tutorial covers multiple nested windows.
(If this comment was disrespectful, please report it.)

 
1/18/2004 7:17:28 PM

I tried your other code, edited correctly, and all i received was
the banner display in Text1
nothing in Text2
and the banner again in Text3

does anyone code for paltalk or can help me out??
MSN Or Email: djwhiteknight@hotmail.com
(If this comment was disrespectful, please report it.)

 
4/26/2004 10:19:09 PMKevin Ritch

Why include anything called "fake virus"... sad, but you lost my vote for that. Good luck, Kevin
(If this comment was disrespectful, please report it.)

 
5/3/2004 4:15:11 AMHenry_Mendes

Thanks Man! This helped me a lot! Now these things are very clear for me!!
Hey!! can you send more C++ tutorials??
(If this comment was disrespectful, please report it.)

 
6/18/2004 9:05:57 PMC.Smith

Excellent tutorial. Everything that can be said has been. :)
(If this comment was disrespectful, please report it.)

 
9/17/2004 4:20:55 AMRaiden_X

Very easy to understand...I look forward to see more of your tutorials here in PSC...
(If this comment was disrespectful, please report it.)

 
9/17/2004 4:22:42 AMRaiden_X

Hey could you write a tutorial about remote access of computers, I mean not without using Winsock. There has gotta be another way on how to do this. Thanks!



(If this comment was disrespectful, please report it.)

 
10/11/2004 2:00:12 AMTechni Rei Myoko

How can I use sendmessage to click a command button using it's hwnd? I tried sending the mousedown then up events but that didnt work (please respond via email)
(If this comment was disrespectful, please report it.)

 
11/7/2004 7:03:15 PM

nice work. creates a good foundation for someone new to the api
(If this comment was disrespectful, please report it.)

 
2/21/2005 9:15:09 AMCamtastrophe

Absolutely awesome. Rarely do I vote, but you got mine. Great job!!!
(If this comment was disrespectful, please report it.)

 
3/23/2005 2:37:09 PM

Very Nice Work man.. these ApIs come in handy :) ty u get 5 from me..
(If this comment was disrespectful, please report it.)

 
8/31/2005 11:22:45 AMPatabugen-

This tutorial rocks =] nice work =]

just a small note, you never mention that you need to declare the functions, it may be obvious to most people but it had me a little confused as to wether or not i needed to...
(If this comment was disrespectful, please report it.)

 
12/20/2005 2:32:35 PMChaosTheEternal

Nice tutorial.

Kinda a late comment, but the second hwnd parameter in FindWindowEx is used when you have to find another control of the same type in a window without being able to use the caption. You just use the hwnd of the control you got in the previous search and it'll find the next one, if there is one.

Like:
lHwnd = FindWindow("#32770", vbNullString) '#32770 is usually a system message box or a Save As prompt
lRet = FindWindowEx(lHwnd, 0&, "Static", vbNullString)
lRet = FindWindowEx(lHwnd, lRet, "Static", vbNullString)

Don't know how often you'd use that, but that's what I found it was for.
(If this comment was disrespectful, please report it.)

 
1/30/2006 12:37:54 AMDjoeDjoe

Very good tutorial :D
(If this comment was disrespectful, please report it.)

 
4/13/2006 10:37:32 AMmethod

HI all i am trying to send to an api using an example that i found in a website but i could not change it to my own api from notpad.

I used window grabber to get the class name :


CODE
RichEdit20A
#32770
AtlAxWin71
ATL:0053D798
WTL_Splitter Window
WTL_SplitterWindow
WTL_SplitterWindow
My
Window Class


I be happy if u based on classe name above tell me what changes should i make to send text to my api instead of sending text to notepad. I assume my api textbox is already open. I tried to replaces the class name but i could not send text to my api!

(If this comment was disrespectful, please report it.)

 
7/30/2006 1:13:06 AM

trying to use this to get the data in a treeeview, but the data isnt a caption so no help there.. any one know?
(If this comment was disrespectful, please report it.)

 
3/3/2007 4:39:13 AM

very nice coding 5 gloves
(If this comment was disrespectful, please report it.)

 
1/20/2008 12:07:27 AMical

very nice. it is not use if textbox using serial port
(If this comment was disrespectful, please report it.)

 
5/1/2008 9:58:42 AMSyukran

your tutorial rocks!
(If this comment was disrespectful, please report it.)

 
12/10/2009 8:11:20 PMafallenhope

To be honest. it was an okay tutorial.
I wouldn't say it was amazing.
You kind of insult People who are new to the API programming world. I personally would have re-written it but I just don't have the time.

Just note that you misspelled "Window" a few times and I don't know why you continuously wrote everything in uppercase. To a newbie I believe that would be difficult for them to understand. I would say 2.5 out of 5 for me Sorry mate.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.