home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 18 / 18.iso / w / w377 / 1.ddi / AHD.SM_ / AHD.SM
Encoding:
INI File  |  1993-07-16  |  4.9 KB  |  316 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     ~default.sty
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     HP DeskJet Family
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Run American Heritage Dictionary from Ami Tools menu
  19.     
  20.     
  21.     
  22.     
  23.     741653912
  24.     39
  25.     672763988
  26.     412
  27.     4
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     0
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [l1]
  54.     0
  55. [pg]
  56.     4
  57.     18 0 6 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  58.     61 0 42 0 0 1 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  59.     69 0 5 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  60.     69 0 5 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  61. [edoc]
  62. <:#288,9360>The first macro, AHD1, installs AHD macros in the Tools Menu.
  63.  
  64. <:#288,9360>
  65.  
  66. <:#288,9360>The second macro, AHD, gets installed  in the Tools / American Heritage menu item.
  67.  
  68. <:#288,9360>
  69.  
  70. <:#576,9360>This macro should be installed under Tools/User  Setup as the macro to run at program load, or should be called from the current autoload macro.  Instalah.smm will do this for you.
  71.  
  72. <:#288,9360>
  73.  
  74. <:#288,9360>
  75.  
  76. <:#288,9360><+!>FUNCTION AHD1()<-!>
  77.  
  78. <:#288,9360>
  79.  
  80. <:#288,9360>M1 = GetRunningMacroFile$()
  81.  
  82. <:#288,9360>M1 = strcat$ (M1, "!AHD")
  83.  
  84. <:#288,9360>
  85.  
  86. <:#288,9360>DeleteMenuItem (1, "Too&ls", "American &Heritage")
  87.  
  88. <:#288,9360>AddMenuItem (1, "Too&ls", "American &Heritage", M1 )
  89.  
  90. <:#288,9360>
  91.  
  92. <:#288,9360><+!>END FUNCTION<-!>
  93.  
  94. <:#288,9360>
  95.  
  96. <**><:p<* >>
  97.  
  98. <:#288,9360><+!>FUNCTION AHD()<-!>
  99.  
  100. <:#288,9360>DEFINE FindWindow()    DLLCall("user,FindWindow,HCC", %1, %2)
  101.  
  102. <:#288,9360>DEFINE WinExec()    DLLCall("kernel,WinExec,HCH", %1, %2)
  103.  
  104. <:#288,9360>DEFINE SendMessage()    DLLCall("user,SendMessage,JHHHJ", %1, %2, %3, %4)
  105.  
  106. <:#288,9360>DEFINE GetAmiWindow()    DLLCall("user,GetActiveWindow,H")
  107.  
  108. <:#288,9360>
  109.  
  110. <:#288,9360>WndTitle = "The American Heritage Dictionary"
  111.  
  112. <:#288,9360>hWnd = FindWindow(0, WndTitle) 
  113.  
  114. <:#288,9360>IF (hWnd <;> 0)
  115.  
  116. <:#288,9360>    GOTO GetSelection
  117.  
  118. <:#288,9360>ENDIF
  119.  
  120. <:#288,9360>
  121.  
  122. <:#288,9360>AHDir = GetProfileString$("Program", "Path", "ahd3.ini")
  123.  
  124. <:#288,9360>IF (LEN(AHDir) = 0)
  125.  
  126. <:#576,9360>    Message("Can't find The American Heritage Dictionary.  Path not found in AHD3.INI.")
  127.  
  128. <:#288,9360>    EXIT FUNCTION
  129.  
  130. <:#288,9360>ENDIF
  131.  
  132. <:#288,9360>IF(RIGHT$(AHDir, 1) <<<;> "\")
  133.  
  134. <:#288,9360>    AHDir = strcat$(AHDir, "\")
  135.  
  136. <:#288,9360>ENDIF
  137.  
  138. <:#288,9360>AHExe = strcat$ (AHDir, "ahd3.exe")
  139.  
  140. <:#288,9360>
  141.  
  142. <:#288,9360>IF (FindFirst$(AHExe, 33) = "")
  143.  
  144. <:#576,9360>    Message("Can't find The American Heritage Dictionary.  Path in AHD3.INI is incorrect:  {AHDir}")
  145.  
  146. <:#288,9360>    EXIT FUNCTION
  147.  
  148. <:#288,9360>ENDIF
  149.  
  150. <:#288,9360>
  151.  
  152. <:#288,9360>hAHD = WinExec(AHExe, 1)
  153.  
  154. <:#288,9360>IF (hAHD << 32)
  155.  
  156. <:#288,9360>    Message("Can't load The American Heritage Dictionary.")
  157.  
  158. <:#288,9360>    EXIT FUNCTION
  159.  
  160. <:#288,9360>ENDIF
  161.  
  162. <:#288,9360>
  163.  
  164. <:#288,9360>hWnd = FindWindow(0, WndTitle)
  165.  
  166. <:#288,9360>IF (hWnd = 0)
  167.  
  168. <:#288,9360>    Message("Can't find The American Heritage Dictionary window.")
  169.  
  170. <:#288,9360>    EXIT FUNCTION
  171.  
  172. <:#288,9360>ENDIF
  173.  
  174. <:#288,9360>
  175.  
  176. <:#288,9360>GetSelection:
  177.  
  178. <:#288,9360>n = LEN(CurShade$())
  179.  
  180. <:#288,9360>IF (n <;> 50)    ' Limit selection to 50 chars max
  181.  
  182. <:#288,9360>    ClipboardWrite(LEFT$(CurShade$(), 50), 0)
  183.  
  184. <:#288,9360>ELSEIF (n <;> 0)
  185.  
  186. <:#288,9360>    Copy
  187.  
  188. <:#288,9360>ENDIF
  189.  
  190. <:#288,9360>hAmiWnd = GetAmiWindow()
  191.  
  192. <:#288,9360>lResult = SendMessage(hWnd, 273, 2026, hAmiWnd)
  193.  
  194. <:#288,9360> 
  195.  
  196. <:#288,9360><+!>END FUNCTION<-!>
  197.  
  198. <:p<* >>
  199.  
  200. >
  201.  
  202. [Embedded]
  203. 00003691
  204. >
  205. [macsum] 2
  206. AHD1 0 0 2 7
  207. AHD 149 0 9 18
  208. [macse]
  209. 14 AHD1
  210. 0 802
  211. 13
  212. 8 1
  213. 0 16 "{1}" "!AHD"
  214. 13
  215. 8 1
  216. 0 520 1 "Too&ls" "American &Heritage"
  217. 0 516 1 "Too&ls" "American &Heritage" "{1}"
  218. 6 0
  219. 15
  220. 9
  221. 14 AHD
  222. 7 "The American Heritage Dictionary"
  223. 8 1
  224. 0 284 "user,FindWindow,HCC" 0 "{1}"
  225. 13
  226. 8 2
  227. 6 2
  228. 5 0
  229. 18 3
  230. 11 00000139
  231. 10 00000849
  232. 0 286 "Program" "Path" "ahd3.ini"
  233. 13
  234. 8 3
  235. 0 14 "{3}"
  236. 13
  237. 5 0
  238. 18 0
  239. 11 00000316
  240. 0 3 "Can't find The American Heritage Dictionary.  Path not found in AHD3.INI."
  241. 6 0
  242. 15
  243. 9
  244. 0 807 "{3}" 1
  245. 13
  246. 7 "\"
  247. 18 1
  248. 11 00000386
  249. 0 16 "{3}" "\"
  250. 13
  251. 8 3
  252. 0 16 "{3}" "ahd3.exe"
  253. 13
  254. 8 4
  255. 0 280 "{4}" 33
  256. 13
  257. 7 ""
  258. 18 0
  259. 11 00000564
  260. 0 3 "Can't find The American Heritage Dictionary.  Path in AHD3.INI is incorrect:  {3}"
  261. 6 0
  262. 15
  263. 9
  264. 0 284 "kernel,WinExec,HCH" "{4}" 1
  265. 13
  266. 8 5
  267. 6 5
  268. 5 32
  269. 18 5
  270. 11 00000703
  271. 0 3 "Can't load The American Heritage Dictionary."
  272. 6 0
  273. 15
  274. 9
  275. 0 284 "user,FindWindow,HCC" 0 "{1}"
  276. 13
  277. 8 2
  278. 6 2
  279. 5 0
  280. 18 0
  281. 11 00000849
  282. 0 3 "Can't find The American Heritage Dictionary window."
  283. 6 0
  284. 15
  285. 9
  286. 0 24
  287. 13
  288. 0 14 [X]
  289. 13
  290. 8 6
  291. 6 6
  292. 5 50
  293. 18 3
  294. 11 00000963
  295. 0 24
  296. 13
  297. 0 806 [X] 50
  298. 13
  299. 0 1038 [X] 0
  300. 10 00001000
  301. 6 6
  302. 5 0
  303. 18 3
  304. 11 00001000
  305. 24 154
  306. 0 284 "user,GetActiveWindow,H"
  307. 13
  308. 8 7
  309. 0 284 "user,SendMessage,JHHHJ" "{2}" 273 2026 "{7}"
  310. 13
  311. 8 8
  312. 6 0
  313. 15
  314. 9
  315. 00003716
  316.