Re: popSelf( ) wont fly
Hi Derek,
Matt suggested using getSelf() to return the id but since its not
global it cant be used by an external program.
Returning the id of the control is important for at least these reasons:
1. User created message map to handle control functions not handled
by Win32Lib (what i need now). This is what the original intent
of onEvent() was (somewhat).
2. Enumerated controls: for messageing a large number of controls
of the same type, such as a calculator keypad. Makes the processing
code neat and compact if you can decode which of your controls
is being serviced. This is especially true when the controls
are very much the same (such as an alpha keypad).
3. A large number of C functions require the hwnd of the control
in order to call the function. Here's just one example:
hTarget=c_func(xSendMessage,{hwndFrom,TVM_HITTEST,0,lphti})
This is just one of many possible function calls and even
the wrapped version still requires the id of the control.
So how else would one use "sendMessage()" without knowing the id?
Having the id also allows getting the hwnd if desired.
Using sendmessage() in either form is an important part of the
windows API, and thats only one example. A lot more functions
require the hwnd of the control, so im surprised no one else
said anything yet. Is anyone using it that much?
The only way around the above that i can see is to add code to winlib
which then makes it somewhat specialized. It would be better to
allow the user to create his own message map if needed. This allows
for more flexibility also. To do this, the id has to be known.
Since getSelf() achieves all these goals, why not just make it a global?
--Al
|
Not Categorized, Please Help
|
|