Code Snippets and Tips

Code to display messages to the screen in PM.
(Larry Salomon Jr.) 1-05

Save and restore window positions.
(Mark Harrison) 1-06

Split a fully qualified file name into its components.
(Larry Salomon Jr.) 1-07

Code to size major notebook tabs according to text length
(Larry Salomon Jr.) 2-04

lafaix@ibm.net (Martin Lafaix) 5-02
neridan@central.co.nz (Neil Daniell) 5-02
wilan01@ingres.com 5-02
rhasty@dialnet.net 5-02

Hook code to circumvent built-in methods of OS/2
pfitz@echo-on.net (Peter Fitzsimmons) 5-03

Code to emulate TN3270 for new PC/3270 users.
lionel.b.dyck@kp.org (Lionel B. Dyck) 5-04

A simple Telnet with pipes.
oobles@loose.apana.org.au (David Ryan) 5-05

jim@www.vwm.com (Jim Louvau) 5-11
Jim Louvau: "Ezapp.zip has the skeleton that I use for "down & dirty" applets and small/trivial applications. It's a typical "dialog box as a frame window" affair, the major exception being that virtually nobody mentions (knows?) that you can attach a program icon, main-menu and an accelerator table to the thing. In effect, you can create a "real" main window using a dialog template in a resource file (with the added benefit of not having to hand-load and position any controls you might have wanted)."

jim@www.vwm.com (Jim Louvau) 5-12
EZFrame.zip is much the same as above, except that it demos defining an honest-to-God frame window in a resource file. This is buried under the "FRAME" control keyword in the resource file documentation, but isn't explained or "exampled" for squat. Basically you define the frame, define the child window within it, and load the whole mess with WinLoadDlg() (which of course, will add your controls in the appropriate places in the child window). In this case, you end up with the real McCoy, not a dialog window, but you get to define your main window with a dialog editor, instead of screwing around with WinCreate*() and manually hassling with controls. I've found that damn near nobody knows you can do this :-)

jim@www.vwm.com (Jim Louvau) 6-01
PMTools.zip has a whole slug of trivial yet handy snippets in it that I seem to always be using in my code, from a window centering (not just on the desktop, but within a parent also) function, to code that prevents loading a second instance of an application (and will optionally switch focus to the running copy if one exists), and a function for loading and associating a help file/instance.

Painting a percent bar
peter.koller@wanadoo.fr (Peter Koller) 6-02

Rebooting OS/2
rplyler@raleigh.ibm.com (Bob Plyler) 6-05

Painting a Dialog
jscott@us.ibm.com (James Scott, Jr.) 6-06
This package provides basic services needed to use dialog controls on a regular PM Client window.
Feedback Search Top