|
-
Apr 2nd, 2000, 02:10 PM
#1
Thread Starter
Lively Member
ok, i have seen all kinds of code on how 2 get progs hwnds. but.. what can u do with it?? i mean what all can u do with knowing the hwnd number of a prog?
any help is great.. thanx!
Charlie Jacquez
16 Year Old Software Developer
Email: [email protected]
Web: CJWARES Online
AIM: CJWARES, SlimmShadee2000, or BIOSzapper
ICQ: 58493454
I program: Basic, Visual Basic, HTML, and TI-Calculators
My System Specs: Click here
-
Apr 2nd, 2000, 03:33 PM
#2
Hyperactive Member
Usually you're not even intrested in the hWnd, but you can for instance make a program invisible, close it, move it, to name a few things.
-
Apr 2nd, 2000, 05:18 PM
#3
transcendental analytic
Many API functions are declared to get your hwnd for some odd reason, I don't know why. Ie ShellExecute
-
Apr 2nd, 2000, 05:34 PM
#4
Hyperactive Member
Those API's want the hWnd as kind of a parentwindow for message's that might be displayed. Usually not intresting... :-)
-
Apr 2nd, 2000, 09:55 PM
#5
Addicted Member
It is important to know if you are trying to create an application that is dependent on another application. Example: If this application is open then do this otherwise do this. You can determine if the ap[plication is open by searching for the application by the handle(hwnd). You may never use it but when you do, it will be very valuable.
-
Apr 2nd, 2000, 10:05 PM
#6
Hyperactive Member
I've developed a program that deals with nothing but hwnd's, I'll let you look at it if you really want, but it's not done yet. It's beta, because I haven't added everything I want. Email me if you want to see it.
-
Apr 2nd, 2000, 10:06 PM
#7
Or, simply, because some functionality in VB was never meant to be done. For example there's no VB way to get how many lines in the textbox, or get a particular line from the textbox. And that's where API come in. But you need a window handle (hWnd) of the control you want to get the text from. hWnd is a representation of window (or control which is also a window) for the Windows OS. Every object on the screen potentially has an hWnd (well, almost every object). Check out MSDN library to get the idea on how hWnd works and how to work with it.
-
Apr 2nd, 2000, 10:15 PM
#8
P.S If you really think about VB's functionality, then you'll realize that it is just a basic wrapper around API calls. For example, when you're getting text from the TextBox:
strMyVariable = Text1.Text
Simply what it does, just calls SendMessage API with the WM_GETTEXT message.
Or if you get the Count from the ComboBox:
intCount = Combo1.ListCount
It just calls SendMessage API again:
intCount = SendMessage(Combo1.hWnd, WM_GETCOUNT, 0, 0)
I hope this will clear a lot of things for you.
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
|