home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / toolbar.zip / README < prev    next >
Text File  |  1995-06-03  |  2KB  |  62 lines

  1. 31 December 1994, 11:58 PM
  2.  
  3. /* notes to self */
  4. MODIFIED:
  5.     31 MAY 1995- make use of the .URC inclusion method
  6.  
  7. -- this is an adaptation to Gpf of sample code from IBM --
  8. -- it is not guaranteed to be beautiful or bullet-proof --
  9.  
  10. /* end notes to self */
  11.  
  12. This application subclasses the frame window, after which all
  13. kinds of mischieve can be performed. The subclassing occurs during
  14. the clients's WM_CREATE message, during which nothing is visible.
  15. Since we're only interested in altering the appearance of the frame,
  16. this is a pretty good time to insert our trojan horse.
  17.  
  18. A little known mechanism within Gpf:
  19. Most users are familiar with the fact that the Gpf code generator
  20. will insert a user .H file if it finds one with the same name as the
  21. application. It is placed in the application's .C file as the last
  22. "#include". What is less known is that the generated .RC file can be
  23. similarly modified. If the code generator 'sees' a .URC file it will
  24. automatically be RCINCLUDEd at the top of the .RC file. Getting down
  25. to specifics- the APPLICATION (.ORC) file in this case is TB.ORC.
  26. I manually created two additional files:
  27.     TB.H
  28.     TB.URC    <-- also includes "tbx.h"
  29. Gpf is nice enough to include them as described. Of course each of
  30. these can have nested includes.
  31.  
  32.  
  33. Notes:
  34. 1. All files of the form "tb.xxx" are Gpf-generated, except TB.H
  35. & TB.URC
  36. 2. file "tb.h" was manually created, forcing Gpf to 'include' it
  37. 3. files "tbx.h" and "tb.urc", definitely related, were created by
  38. hand. TB.URC forces Gpf to include it into TB.RC.
  39. 4. files "uftb.mak" and "uftb.c" are the user function production
  40. and source files, respectively. They are made known to Gpf on the
  41. application's Property screen (Gpf's initial screen.) Function
  42. prototypes are in TB.H.
  43.  
  44. User Functions (uftb.c):
  45. UfMainCreate- attached to client window at 'Window Create'
  46. UfMainCommand- attached to client, at 'All other command/control'. It
  47.   is here that you will need to add truly useful code. Typically
  48.   toolbars are used as accelerators for existing menu functions.
  49.   Examine 'case MID_TB1' to see how this can be done.
  50. UfPBDel- attached to the 'Delete' pushbutton
  51. UfPBAdd- attached to the 'Add' pushbutton
  52.  
  53. NewFrameProc- subclass procedure, invoked during UfMainCreate
  54.  
  55. Have a nice day.
  56. Alexander Charov
  57.  
  58.  
  59.  
  60.  
  61.  
  62.