home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
toolbar.zip
/
README
< prev
next >
Wrap
Text File
|
1995-06-03
|
2KB
|
62 lines
31 December 1994, 11:58 PM
/* notes to self */
MODIFIED:
31 MAY 1995- make use of the .URC inclusion method
-- this is an adaptation to Gpf of sample code from IBM --
-- it is not guaranteed to be beautiful or bullet-proof --
/* end notes to self */
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.
A little known mechanism within Gpf:
Most users are familiar with the fact that the Gpf code generator
will insert a user .H file if it finds one with the same name as the
application. It is placed in the application's .C file as the last
"#include". What is less known is that the generated .RC file can be
similarly modified. If the code generator 'sees' a .URC file it will
automatically be RCINCLUDEd at the top of the .RC file. Getting down
to specifics- the APPLICATION (.ORC) file in this case is TB.ORC.
I manually created two additional files:
TB.H
TB.URC <-- also includes "tbx.h"
Gpf is nice enough to include them as described. Of course each of
these can have nested includes.
Notes:
1. All files of the form "tb.xxx" are Gpf-generated, except TB.H
& TB.URC
2. file "tb.h" was manually created, forcing Gpf to 'include' it
3. files "tbx.h" and "tb.urc", definitely related, were created by
hand. TB.URC forces Gpf to include it into TB.RC.
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.) Function
prototypes are in TB.H.
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