home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
toolbgpf.zip
/
README
< prev
next >
Wrap
Text File
|
1995-01-03
|
2KB
|
49 lines
31 December 1994, 11:58 PM
-- this is an adaptation to Gpf of sample code from IBM --
-- it is not guaranteed to be beautiful or bullet-proof --
This application subclasses the frame window, after which all
kinds of mischieve can be performed. The subclassing occurs during
the clients's WM_CREATE message, during which nothing is visible.
Since we're only interested in altering the appearance of the frame,
this is a pretty good time to insert our trojan horse.
The only un-slick piece of trickery is the appending of a menu
template to the Gpf-generated .RC file. The file appended is called
"TBX.RC", which was created manually. Each and every time Gpf created
"TB.RC", "TBX.RC" was tacked on with this command:
X:>copy tb.rc + tbx.rc
Perhaps you can modify the file "uftb.mak" to do this automatically;
be careful! Multiple appends will surely blow up the resource
compiler.
Notes:
1. all files of the form "tb.xxx" are Gpf-generated, with the
exception of
2. file "tb.h" was manually created, forcing Gpf to 'include' it
3. files "tbx.h" and "tbx.h", definitely related, were created by
hand
4. files "uftb.mak" and "uftb.c" are the user function production
and source files, respectively. They are made known to Gpf on the
application's Property screen (Gpf's initial screen.)
User Functions (uftb.c):
UfMainCreate- attached to client window at 'Window Create'
UfMainCommand- attached to client, at 'All other command/control'. It
is here that you will need to add truly useful code. Typically
toolbars are used as accelerators for existing menu functions.
Examine 'case MID_TB1' to see how this can be done.
UfPBDel- attached to the 'Delete' pushbutton
UfPBAdd- attached to the 'Add' pushbutton
NewFrameProc- subclass procedure, invoked during UfMainCreate
Have a nice day.
Alexander Charov