Show procedure name on window

One of the things I constantly need to do is to find exactly what procedure the window belongs to that I'm looking at on the screen.  In some cases it can be difficult, particularly in larger client projects where you may not remember the properties of every window.

Few lines of code, along with the Icetips Standardized Window Code Wizard from the Icetips Utilities to the rescue!

The first thing I did was to add two variables to the procedure data embed:

ProcNameFEQ   LONG
Loc:ShowProcNameInCaption BYTE

Then I added this code at the top of the procedure:

Loc:ShowProcNameInCaption = INIMgr.Fetch('ProgramSettings','Loc:ShowProcNameInCaption')
IF Loc:ShowProcNameInCaption
  0{PROP:Text} = 0{PROP:Text} & ' (' & GlobalErrors.GetProcedureName() & ')'
  ITU.ODS('Procedure name: ' & GlobalErrors.GetProcedureName())  
  ProcNameFEQ = CREATE(0,CREATE:string,0)
  ProcNameFEQ {PROP:Xpos} = 1
  ProcNameFEQ {PROP:Ypos} = 0{PROP:Height} - 14
  SETFONT(ProcNameFEQ,'Segoe UI',12,,FONT:bold)
  ProcNameFEQ {PROP:Text} = GlobalErrors.GetProcedureName()
  ProcNameFEQ {PROP:Hide} = FALSE 

That's it!  Now the procedure name shows up in the lower left corner of the windows in apps that use the WindowInitCode procedure as well as in the window caption bar and be sent to DebugView.  Here is an example of how this works on a simple login screen.

The caption may not always show properly if your windows are small or if there is a lot of text in the caption.  The control in the lower left corner may be overlapped by some controls.  But with the DebugView output as well, you are pretty much safe so you can see where you are!


Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk