home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
smart21b.zip
/
SAMPLES
/
WIN31OS2
/
UDMDSAMP.DCT
< prev
Wrap
Text File
|
1995-03-02
|
6KB
|
137 lines
.Table =Test Win 3.1 Override
.Version =1.2
.Date =03-02-95
.Keyword =999 000 999 $$PRE_PROCESS
.SComment=Preprocess Command set
.Command = SmGetListPath( LISTPATH )
= $GVARS = LISTPATH "\VARS1.DAT"
= SmPromptDlg( "Enter filename for loading process variables:",
= $GVARS, OPTION, $GVARS, ~Ok | ~Abort )
= if OPTION = "Abort" then terminate
= SmLoadVars( $GVARS )
= if $GHAB = "" then
= $GHAB = "hab"
= SmPromptDlg( "Enter application HAB variable name:",
= $GHAB, OPTION, $GHAB, ~Ok | ~Abort )
= if OPTION = "Abort" then terminate
.Keyword =999 000 999 $$POST_PROCESS
.SComment=Postprocess Command set
.Command = SmSaveVars($GVARS, GLOBAL | STATIC )
.Keyword =010 010 130 HANDLE
.SComment=Replace HANDLE with user option
.LComment=Replace HANDLE with user option
.Template=$SPARAM3
.Command =SmSendToEditor( "$LFile($LLine:$LCol)R" )
=IF $Sparam3 = "" THEN
= $Sparam3 = "HWND"
=IF $SDat3 = "" THEN
= DO
= SmGetSmartPath( PATH )
= $SDat3 = PATH "\samples\win31os2\handle.dat"
= END
=SmListDlg("Select Template to be used for handle migration",
= $Sparam3, OPTION, $Sparam3, $SDat3)
=IF OPTION = "ABORT" then terminate
=SmMigrateKeyword( $T1 )
.Keyword =010 010 130 SetParent
.SComment=Replace with WinSetParent and WinSetOwner
.LComment=Replace with WinSetParent to change the parent and relative
=position of the window. If setting the new parent to the
=desktop then use WinSetOwner to set the owner to NULL,
=otherwise set the owner to the new parent window. Depending
=upon desired behavior it may be necessary to use
=WinSetWindowPos to reposition the window in the new parent's
=window. Use WinQueryWindow with QW_PARENT to determine the
=current parent.
.Sample =Windows:
= HWND hWndPrevParent = SetParent (hWnd, hWndParent);
=OS/2:
= HWND hWndPrevParent = WinQueryWindow (hWnd, QW_PARENT);
= WinSetParent (hWnd, hWndParent, TRUE);
= if ((hWndParent != HWND_DESKTOP) &&
= (hWndParent != HWND_OBJECT))
= WinSetOwner (hWnd, hWndParent);
= else
= WinSetOwner (hWnd, (HWND)0);
.Prototyp=HWND APIENTRY WinQueryWindow (HWND hwnd, LONG lCode);
=BOOL APIENTRY WinSetParent (HWND hwnd, HWND hwndNewParent,
= BOOL fRedraw);
=BOOL APIENTRY WinSetOwner (HWND hwnd, HWND hwndNewOwner);
.Template=$P2 = WinQueryWindow ($P1, QW_PARENT);
=WinSetParent ($P1, $P2, TRUE);
=if (($P2 != HWND_DESKTOP) &&
= ($P2 != HWND_OBJECT))
= WinSetOwner ($P1, $P2);
= else
= WinSetOwner ($P1, (HWND)0);
.Command =/* Replace source code */
=IF $KIND = "TRUE" THEN
= DO
= SmSendToEditor( "$LFILE($LLINE:$LCOL)R" )
= DISPLAY = "Check removal and replacement for keyword: " $KEY
= SmDisplayDlg( DISPLAY, OPTION, ~Yes | ~No | ~Abort )
= IF OPTION = "Abort" THEN
= DO
= TERMINATE
= END
= IF OPTION = "Yes" THEN
= DO
= SmRemove(LINE)
= SmOutputLine( $T1 )
= SmOutputLine( $T2 )
= SmOutputLine( $T3 )
= SmOutputLine( $T4 )
= SmOutputLine( $T5 )
= SmOutputLine( $T6 )
= SmOutputLine( $T7 )
= SmNoComment( ALL )
= NOTE = "Source line removed and code replaced for:" $KEY
= SmOutputNote( NOTE )
= END
= END
=ELSE
= DO
= string = "*** Unable to migrate : " $KEY
= SmOutputNote( string )
= SmOutputNote("*** Multi-line migration is embedded.")
= SmNoMigrate( )
= END
.Keyword =010 030 280 DeleteMenu
.SComment=Replace with WinSendMsg and MM_DELETEITEM
.LComment=Replace with WinSendMsg to send the MM_DELETEITEM message to
=the menu containing the item to delete. If MF_BYPOSITION is
=used then the identifier of the menu item must first be
=retrieved by sending the MM_ITEMIDFROMPOSITION message to
=the menu. Note that all menu items, including popup menu
=items must have an identifier assigned.
.Sample =Windows:
= DeleteMenu (hMenu, 2, MF_BYPOSITION);
=OS/2:
= SHORT sID = (SHORT)WinSendMsg (hMenu,
= MM_ITEMIDFROMPOSITION, MPFROMSHORT (2), MPVOID);
= WinSendMsg (hMenu, MM_DELETEITEM, MPFROM2SHORT(sID,FALSE),
= MPVOID);
.Prototyp=BOOL APIENTRY WinSendMsg (HWND hwnd, ULONG ulMsgID,
= MPARAM mParam1, MPARAM mParam2);
.Template=SHORT sID = (SHORT)WinSendMsg ( $P1, MM_ITEMIDFROMPOSITION, MPFROMSHORT (2), MPVOID)
= WinSendMsg ( $P1, MM_DELETEITEM, MPFROM2SHORT(sID,FALSE), PVOID);
.Command =if $KIND = "TRUE" then
= do
= SmMigrateKeyword( $T1 )
= SmOutputLine( $T2 )
= end
=else
= do
= SmNoMigrate()
= DISPLAY = "** No Migration. Embedded Keyword: " $KEY
= SmOutputNote( DISPLAY )
= end
.Refer =WinSendMsg
.Refer =MM_DELETEITEM