home *** CD-ROM | disk | FTP | other *** search
- {$S-,I-,R-}
- unit HWmain;
-
- interface
-
- uses
- OpSwap1;
-
- procedure HelloWorldMain;
-
- implementation
-
- const
- HotKey = $080F; {code for Alt-Tab}
- Swap1 = 'HELLO1.SWP';
- Swap2 = 'HELLO2.SWP';
-
- {$F+}
- procedure PopupEntryPoint;
- {-Routine called when our hotkey is pressed}
- begin
- WriteLn('Hello world!');
- end;
- {$F-}
-
- procedure HelloWorldMain;
- {-Define a popup and go resident}
- begin
- {disable swapping message if swapping to EMS}
- SetSwapMsgOn( not WillSwapUseEms(ParagraphsToKeep) );
-
- {define the popup}
- if DefinePop(HotKey, PopupEntryPoint, Ptr(SSeg,SPtr)) then begin
- WriteLn('TSR loaded, press <Alt><Tab> to activate.');
-
- {Make popup routines active.}
- PopupsOn;
-
- {try to go resident}
- StayResSwap(ParagraphsToKeep, 0, Swap1, Swap2, True);
- end;
-
- {if we get here we failed to go resident}
- WriteLn('Unable to go resident.');
- end;
-
- end.
-