Res_Ctrl.au3


SUBMITTED BY: Guest

DATE: May 28, 2013, 6:20 a.m.

FORMAT: Text only

SIZE: 16.8 kB

HITS: 1797

  1. #include <Constants.au3>
  2. #include <WindowsConstants.au3>
  3. #include <WinAPI.au3>
  4. #include <Memory.au3>
  5. #include "Resource.au3"
  6. Global $Global_BackGroundArray[4][1]
  7. Func ResCtrlCreatePic($L,$T,$W,$H,$ResType,$ResName, _
  8. $ResLanguage = -1,$ModuleName = "",$Style = 0,$ExStyle = 0)
  9. $ImageHandle = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
  10. if @error Then Return SetError(1,0,0)
  11. $ImageType = @extended
  12. $ControlID = CtrlCreatePic($ImageHandle,$ImageType,$L,$T,$W,$H,$Style,$ExStyle)
  13. if @error Then Return SetError(2,0,0)
  14. Return SetError(0,$ImageType,$ControlID)
  15. EndFunc
  16. Func ResCtrlCreatePicEx($L,$T,$W,$H,$Text,$ResType,$ResName,$ResLanguage = -1, _
  17. $ModuleName = "",$Style = 0,$ExStyle = 0,$FontColor=0,$FontSize=8.5,$FomtWeight=400 _
  18. ,$FontAttribute=2,$Fontname="",$FontQuality=2)
  19. $ImageHandle = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
  20. if @error Then Return SetError(1,0,0)
  21. $ImageType = @extended
  22. $ControlID = CtrlCreatePicEx($ImageHandle,$ImageType,$L,$T,$W,$H,$Text,$Style, _
  23. $ExStyle,$FontColor,$FontSize,$FomtWeight,$FontAttribute,$Fontname,$FontQuality)
  24. if @error Then Return SetError(2,0,0)
  25. Return SetError(0,$ImageType,$ControlID)
  26. EndFunc
  27. Func ResCtrlCreate_Button($L,$T,$W,$H,$ResType,$ResName, _
  28. $ResLanguage = -1,$ModuleName = "",$Style = 0,$ExStyle = 0,$ReSize = False)
  29. $ImageHandle = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
  30. if @error Then Return SetError(1,0,0)
  31. $ImageType = @extended
  32. if ($ReSize) Then
  33. $SizeArray = GetImageSize($ImageHandle)
  34. if @error Then
  35. DeleteObj($ImageHandle,$ImageType)
  36. Return SetError(2,0,0)
  37. EndIf
  38. $W = $SizeArray[0]
  39. $H = $SizeArray[1]
  40. EndIf
  41. $ControlID = CtrlCreate_Button($ImageHandle,$ImageType,$L,$T,$W,$H,$Style,$ExStyle)
  42. if @error Then Return SetError(3,0,0)
  43. Return SetError(0,$ImageType,$ControlID)
  44. EndFunc
  45. Func ResSetBackGroundBmp($hWnd,$ResType,$ResName,$ResLanguage = -1 _
  46. ,$ModuleName = "",$DeletOldImage = True)
  47. $hImage = ResGetImage($ResType,$ResName,$ResLanguage,$ModuleName)
  48. if @error Then Return SetError(1,0,False)
  49. Local $ImageType = @extended
  50. if ($ImageType <> 1) Then DeleteObj($hImage,$ImageType)
  51. $SizeArray = GetImageSize($hImage)
  52. if @error Then
  53. DeleteObj($hImage,$ImageType)
  54. Return SetError(2,0,False)
  55. EndIf
  56. $BmpWidth = $SizeArray[0]
  57. $BmpHeight = $SizeArray[1]
  58. SetBackGroundBmp($hWnd,$hImage,$BmpWidth,$BmpHeight,$DeletOldImage)
  59. if @error Then
  60. DeleteObj($hImage,$ImageType)
  61. Return SetError(3,0,False)
  62. EndIf
  63. Return SetError(0,0,True)
  64. EndFunc
  65. Func ResSndPlaySound($ResType,$ResName,$ResLanguage = -1,$ModuleName = "",$LOOP = False)
  66. $ByteStruct = ResGet($ResType,$ResName,$ResLanguage,$ModuleName)
  67. if @error Then Return SetError(1,0,False)
  68. $LPVOID = DllStructGetPtr($ByteStruct)
  69. SndPlaySound($LPVOID,$LOOP)
  70. if @error Then Return SetError(2,0,False)
  71. Return SetError(0,0,True)
  72. EndFunc
  73. Func CtrlCreatePic($ImageHandle,$ImageType,$L,$T,$W,$H,$Style = 0,$ExStyle = 0)
  74. Local $SS_ICON_RES = 0x00000003,$SS_ENHMETAFILE_RES = 0x0000000F
  75. Local $SS_BITMAP_RES = 0x0000000E,$SS_REALSIZECONTROL_RES = 0x00000040
  76. Switch $ImageType
  77. Case 1 ;BITMAP
  78. $ImageStyle = BitOR($Style,$SS_BITMAP_RES,$SS_REALSIZECONTROL_RES)
  79. Case 4 ;ENHMETAFILE
  80. $ImageStyle = BitOR($Style,$SS_ENHMETAFILE_RES,$SS_REALSIZECONTROL_RES)
  81. Case 3,5 ;INCON OR CURSOR
  82. $ImageStyle = BitOR($Style,$SS_ICON_RES,$SS_REALSIZECONTROL_RES)
  83. Case Else
  84. Return SetError(1,0,0)
  85. EndSwitch
  86. $ControlID = GUICtrlCreateLabel("",$L,$T,$W,$H,$ImageStyle,$ExStyle)
  87. CtrlSetImage($ControlID,$ImageHandle,$ImageType)
  88. if @error Then Return SetError(2,0,0)
  89. Return SetError(0,$ImageType,$ControlID)
  90. EndFunc
  91. Func CtrlCreatePicEx($ImageHandle,$ImageType,$L,$T,$W,$H,$Text,$Style = 0,$ExStyle = 0, _
  92. $FontColor=0,$FontSize=8.5,$FomtWeight=400,$FontAttribute=0,$Fontname="",$FontQuality=2)
  93. Local $SS_BITMAP_RES = 0x0000000E,$SS_REALSIZECONTROL_RES = 0x00000040
  94. Local $SS_ICON_RES = 0x00000003,$SS_CENTER_RES = 0x01,$SS_CENTERIMAGE_RES = 0x0200
  95. Local $SS_ENHMETAFILE_RES = 0x0000000F
  96. Switch $ImageType
  97. Case 1 ;BITMAP
  98. $ImageStyle = BitOR($Style,$SS_BITMAP_RES,$SS_REALSIZECONTROL_RES)
  99. Case 4 ;ENHMETAFILE
  100. $ImageStyle = BitOR($Style,$SS_ENHMETAFILE_RES,$SS_REALSIZECONTROL_RES)
  101. Case 3,5 ;INCON OR CURSOR
  102. $ImageStyle = BitOR($Style,$SS_ICON_RES,$SS_REALSIZECONTROL_RES)
  103. Case Else
  104. Return SetError(1,0,0)
  105. EndSwitch
  106. $ControlID1 = GUICtrlCreateLabel("",$L,$T,$W,$H,$ImageStyle,$ExStyle)
  107. CtrlSetImage($ControlID1,$ImageHandle,$ImageType)
  108. if @error Then
  109. GUICtrlDelete($ControlID1)
  110. Return SetError(2,0,0)
  111. EndIf
  112. $ControlID2 = GUICtrlCreateLabel($Text,$L,$T,$W,$H,BitOR($SS_CENTER_RES,$SS_CENTERIMAGE_RES))
  113. GUICtrlSetColor(-1,$FontColor)
  114. GUICtrlSetBkColor(-1,-2);-2 $GUI_BKCOLOR_TRANSPARENT
  115. GUICtrlSetFont(-1,$FontSize,$FomtWeight,$FontAttribute,$Fontname,$FontQuality)
  116. Return SetError(0,$ImageType,$ControlID1)
  117. EndFunc
  118. Func DeletePicEx($ControlID)
  119. GUICtrlDelete($ControlID)
  120. GUICtrlDelete($ControlID + 1)
  121. EndFunc
  122. Func SetPosPicEx($ControlID,$L,$T,$W,$H)
  123. GUICtrlSetPos($ControlID,$L,$T,$W,$H)
  124. GUICtrlSetPos($ControlID + 1,$L,$T,$W,$H)
  125. EndFunc
  126. Func SetStatePicEx($ControlID,$State)
  127. GUICtrlSetState($ControlID,$State)
  128. GUICtrlSetState($ControlID + 1,$State)
  129. EndFunc
  130. Func SetStylePicEx($ControlID,$Style,$ExStyle)
  131. GUICtrlSetStyle($ControlID,$Style,$ExStyle)
  132. EndFunc
  133. Func CtrlCreate_Button($ImageHandle,$ImageType,$L,$T,$W,$H,$Style = 0,$ExStyle = 0)
  134. Local $BS_ICON_RES = 0x0040,$BS_BITMAP_RES = 0x0080
  135. Switch $ImageType
  136. Case 1 ;BITMAP
  137. $ImageStyle = BitOR($Style,$BS_BITMAP_RES)
  138. Case 3 ;ICON
  139. $ImageStyle = BitOR($Style,$BS_ICON_RES)
  140. Case Else
  141. Return SetError(1,0,0)
  142. EndSwitch
  143. $ControlID = GUICtrlCreateButton("",$L,$T,$W,$H,$ImageStyle,$ExStyle)
  144. CtrlSetImage($ControlID,$ImageHandle,$ImageType)
  145. if @error Then Return SetError(2,0,0)
  146. Return SetError(0,$ImageType,$ControlID)
  147. EndFunc
  148. Func CtrlSetImage($ControlID,$ImageHandle,$ImageType,$DeletOldImage = False)
  149. ;$ImageType
  150. ;$ImageType = 1 ==> BITMAP
  151. ;$ImageType = 3 ==> ICON
  152. ;$ImageType = 4 ==> ENHMETAFILE
  153. ;$ImageType = 5 ==> CURSOR
  154. ;$ControlID Of STATIC Control Or Button Control
  155. Local $ControHandle = $ControlID,$STM_SETIMAGE_RES = 0x0172,$IMAGE_ENHMETAFILE_RES = 3
  156. Local $IMAGE_BITMAP_RES = 0,$IMAGE_ICON_RES = 1,$IMAGE_CURSOR_RES = 2 , $RthImage = 0
  157. Local $BM_SETIMAGE_RES = 0xF7
  158. if Not IsHWnd($ControlID) Then $ControHandle = GUICtrlGetHandle($ControlID)
  159. Local $Class = _WinAPI_GetClassName($ControHandle)
  160. Select
  161. Case $Class == "Button"
  162. Switch $ImageType
  163. Case 1 ;BITMAP
  164. if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
  165. Local $OldImageType = @extended
  166. $RthImage = _SendMessage($ControHandle,$BM_SETIMAGE_RES,$IMAGE_BITMAP_RES,$ImageHandle)
  167. if ($DeletOldImage And $OldImage <> $ImageHandle _
  168. And $OldImage) Then DeleteObj($OldImage,$OldImageType)
  169. Case 3 ;ICON
  170. if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
  171. Local $OldImageType = @extended
  172. $RthImage = _SendMessage($ControHandle,$BM_SETIMAGE_RES,$IMAGE_ICON_RES,$ImageHandle)
  173. if ($DeletOldImage And $OldImage <> $ImageHandle _
  174. And $OldImage) Then DeleteObj($OldImage,$OldImageType)
  175. Case Else
  176. Return SetError(3,0,False)
  177. EndSwitch
  178. Case $Class == "Static"
  179. Switch $ImageType
  180. Case 1 ;BITMAP
  181. if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
  182. Local $OldImageType = @extended
  183. $RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_BITMAP_RES,$ImageHandle)
  184. if ($DeletOldImage And $OldImage <> $ImageHandle _
  185. And $OldImage) Then DeleteObj($OldImage,$OldImageType)
  186. Case 4 ;ENHMETAFILE
  187. if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
  188. Local $OldImageType = @extended
  189. $RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_ENHMETAFILE_RES,$ImageHandle)
  190. if ($DeletOldImage And $OldImage <> $ImageHandle _
  191. And $OldImage) Then DeleteObj($OldImage,$OldImageType)
  192. Case 3 ;ICON
  193. if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
  194. Local $OldImageType = @extended
  195. $RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_ICON_RES,$ImageHandle)
  196. if ($DeletOldImage And $OldImage <> $ImageHandle _
  197. And $OldImage) Then DeleteObj($OldImage,$OldImageType)
  198. Case 5 ;CURSOR
  199. if ($DeletOldImage) Then $OldImage = CtrlGetOldImage($ControlID)
  200. Local $OldImageType = @extended
  201. $RthImage = _SendMessage($ControHandle,$STM_SETIMAGE_RES,$IMAGE_CURSOR_RES,$ImageHandle)
  202. if ($DeletOldImage And $OldImage <> $ImageHandle _
  203. And $OldImage) Then DeleteObj($OldImage,$OldImageType)
  204. Case Else
  205. Return SetError(3,0,False)
  206. EndSwitch
  207. if IsHWnd($ControlID) Then $ControlID = _WinAPI_GetDlgCtrlID($ControlID)
  208. $ControHandle = GUICtrlGetHandle($ControlID + 1)
  209. if ($ControHandle) Then _WinAPI_RedrawWindow($ControHandle,0,0,$RDW_INVALIDATE)
  210. Case Else
  211. Return SetError(2,0,False)
  212. EndSelect
  213. if ($RthImage) Then DeleteObj($RthImage,$ImageType)
  214. Return SetError(0,0,True)
  215. EndFunc
  216. Func CtrlGetOldImage($ControlID)
  217. ; Return $OldImage Or Zero
  218. ;$ImageType = @extended
  219. ;$ImageType = 1 ==> BITMAP
  220. ;$ImageType = 3 ==> ICON
  221. ;$ImageType = 4 ==> ENHMETAFILE
  222. ;$ImageType = 5 ==> CURSOR
  223. Local $ControHandle = $ControlID,$STM_GETIMAGE_RES = 0x0173,$IMAGE_ENHMETAFILE_RES = 3
  224. Local $IMAGE_BITMAP_RES = 0,$IMAGE_ICON_RES = 1,$IMAGE_CURSOR_RES = 2 , $OldImage = 0
  225. Local $BM_GETIMAGE_RES = 0x00F6
  226. if Not IsHWnd($ControlID) Then $ControHandle = GUICtrlGetHandle($ControlID)
  227. Local $Class = _WinAPI_GetClassName($ControHandle)
  228. Select
  229. Case $Class == "Button"
  230. $OldImage = _SendMessage($ControHandle,$BM_GETIMAGE_RES,$IMAGE_BITMAP_RES,0)
  231. if ($OldImage) Then Return SetError(0,1,$OldImage)
  232. $OldImage = _SendMessage($ControHandle,$BM_GETIMAGE_RES,$IMAGE_ICON_RES,0)
  233. if ($OldImage) Then Return SetError(0,3,$OldImage)
  234. Return SetError(1,0,0)
  235. Case $Class == "Static"
  236. $OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_BITMAP_RES,0)
  237. if ($OldImage) Then Return SetError(0,1,$OldImage)
  238. $OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_ICON_RES,0)
  239. if ($OldImage) Then Return SetError(0,3,$OldImage)
  240. $OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_CURSOR_RES,0)
  241. if ($OldImage) Then Return SetError(0,5,$OldImage)
  242. $OldImage = _SendMessage($ControHandle,$STM_GETIMAGE_RES,$IMAGE_ENHMETAFILE_RES,0)
  243. if ($OldImage) Then Return SetError(0,4,$OldImage)
  244. Return SetError(1,0,0)
  245. Case Else
  246. Return SetError(2,0,0)
  247. EndSelect
  248. EndFunc
  249. Func SetBackGroundBmp($hWnd,$hBmpImage,$BmpWidth,$BmpHeight,$DeletOldImage = True)
  250. Local $GuiTest = False , $UBound = UBound($Global_BackGroundArray)
  251. For $i = 0 To $UBound - 1
  252. if ($Global_BackGroundArray[$i][0] = $hWnd) Then
  253. $GuiTest = True
  254. ExitLoop
  255. EndIf
  256. Next
  257. if ($GuiTest = False) Then ReDim $Global_BackGroundArray[$UBound + 1][4]
  258. if ($DeletOldImage) And ($Global_BackGroundArray[$i][1]) _
  259. Then _WinAPI_DeleteObject($Global_BackGroundArray[$i][1])
  260. $Global_BackGroundArray[$i][0] = $hWnd
  261. $Global_BackGroundArray[$i][1] = $hBmpImage
  262. $Global_BackGroundArray[$i][2] = $BmpWidth
  263. $Global_BackGroundArray[$i][3] = $BmpHeight
  264. GUIRegisterMsg($WM_ERASEBKGND,"WM_ERASEBKGND")
  265. _WinAPI_RedrawWindow($hWnd)
  266. EndFunc
  267. Func RemoveBackGroundBmp($hWnd,$DeletImage = True)
  268. Local $GuiTest = False , $UBound = UBound($Global_BackGroundArray)
  269. Local $NewBackGroundArray[$UBound - 1][4]
  270. For $i = 0 To $UBound - 1
  271. if ($Global_BackGroundArray[$i][0] = $hWnd) Then
  272. $GuiTest = True
  273. ExitLoop
  274. EndIf
  275. Next
  276. if ($GuiTest = True) Then
  277. For $i = 0 To $UBound - 1
  278. if ($Global_BackGroundArray[$i][0] = $hWnd) Then ContinueLoop
  279. $NewBackGroundArray[$i][0] = $Global_BackGroundArray[$i][0]
  280. $NewBackGroundArray[$i][1] = $Global_BackGroundArray[$i][1]
  281. $NewBackGroundArray[$i][2] = $Global_BackGroundArray[$i][2]
  282. $NewBackGroundArray[$i][3] = $Global_BackGroundArray[$i][3]
  283. Next
  284. $Global_BackGroundArray = $NewBackGroundArray
  285. Else
  286. Return SetError(1,0,False)
  287. EndIf
  288. _WinAPI_RedrawWindow($hWnd)
  289. Return SetError(0,0,True)
  290. EndFunc
  291. Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
  292. Local $GuiTest = False , $UBound = UBound($Global_BackGroundArray)
  293. Local $BGhWnd = WindowFromDC($wParam)
  294. if Not @error Then
  295. For $i = 0 To $UBound - 1
  296. if ($Global_BackGroundArray[$i][0] = $BGhWnd) Then
  297. $GuiTest = True
  298. ExitLoop
  299. EndIf
  300. Next
  301. if ($GuiTest) Then
  302. $Pos = WinGetClientSize($BGhWnd)
  303. $hdc = _WinAPI_CreateCompatibleDC($wParam)
  304. $HGDIOBJ = _WinAPI_SelectObject($hdc,$Global_BackGroundArray[$i][1])
  305. StretchBlt($wParam,0,0,$Pos[0],$Pos[1],$hdc,0,0,$Global_BackGroundArray[$i][2], _
  306. $Global_BackGroundArray[$i][3],$SRCCOPY)
  307. $HGDIOBJ = _WinAPI_SelectObject($hdc,$HGDIOBJ)
  308. _WinAPI_DeleteDC($hdc)
  309. Return True
  310. EndIf
  311. EndIf
  312. EndFunc
  313. Func SndPlaySound($Ptr,$LOOP = False)
  314. ;File Type Or Format File.wav
  315. Local $SND_MEMORY = 4, $SND_ASYNC = 1 ,$SND_SYNC = 0,$SND_NODEFAULT = 2 , _
  316. $SND_LOOP = 0x0008 , $SND_NOSTOP = 0x0010 ,$SND_FILENAME = 0x00020000
  317. Local $fuSound = BitOR($SND_MEMORY,$SND_ASYNC,$SND_NODEFAULT)
  318. if ($LOOP) Then $fuSound = BitOR($fuSound,$SND_LOOP)
  319. $BOOL = DllCall("winmm.dll", "int", "sndPlaySound","ptr",$Ptr,"UINT",$fuSound)
  320. If @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
  321. Return SetError(0,0,True)
  322. EndFunc
  323. Func DeleteObj($Object,$ObjectType)
  324. Switch $ObjectType
  325. Case 1
  326. if (_WinAPI_DeleteObject($Object)) Then Return True
  327. Case 2
  328. if (DeleteMetaFile($Object)) Then Return True
  329. Case 3
  330. if (_WinAPI_DestroyIcon($Object)) Then Return True
  331. Case 4
  332. if (DeleteEnhMetaFile($Object)) Then Return True
  333. Case 5
  334. if (DestroyCursor($Object)) Then Return True
  335. EndSwitch
  336. Return SetError(1,0,False)
  337. EndFunc
  338. Func StretchBlt($hdcDest,$nXOriginDest,$nYOriginDest,$nWidthDest,$nHeightDest,$hdcSrc,$nXOriginSrc, _
  339. $nYOriginSrc,$nWidthSrc,$nHeightSrc,$dwRop)
  340. $Rt = DllCall("Gdi32.dll" ,"BOOL","StretchBlt","ptr",$hdcDest,"int",$nXOriginDest,"int",$nYOriginDest,"int",$nWidthDest , _
  341. "int",$nHeightDest,"ptr",$hdcSrc,"int",$nXOriginSrc,"int",$nYOriginSrc,"int",$nWidthSrc,"int",$nHeightSrc,"DWORD",$dwRop)
  342. if @error Or $Rt[0] = 0 Then Return SetError(1,0,0)
  343. Return SetError(0,0,$Rt[0])
  344. EndFunc
  345. Func WindowFromDC($hDC)
  346. $HWND = DllCall("User32.dll","ptr","WindowFromDC","ptr",$hdc)
  347. if @error Or $HWND[0] = 0 Then Return SetError(1,0,0)
  348. Return SetError(0,0,$HWND[0])
  349. EndFunc
  350. Func GetImageSize($hBmp)
  351. Local $ntagBITMAPINFO = "DWORD biSize;LONG biWidth;LONG biHeight;USHORT biPlanes;" & _
  352. "USHORT biBitCount;DWORD biCompression;DWORD biSizeImage;LONG biXPelsPerMeter;" & _
  353. "LONG biYPelsPerMeter;DWORD biClrUsed;DWORD biClrImportant;BYTE RGBQUAD[4]"
  354. Local $vBITMAPINFO = DllStructCreate($ntagBITMAPINFO)
  355. DllStructSetData($vBITMAPINFO,"biSize",(DllStructGetSize($vBITMAPINFO) - 4))
  356. Local $hDC = _WinAPI_CreateCompatibleDC(0)
  357. if @error Then
  358. _WinAPI_DeleteDC($hDC)
  359. Return SetError(1,0,0)
  360. EndIf
  361. _WinAPI_GetDIBits($hDC,$hBmp,0,0,0,DllStructGetPtr($vBITMAPINFO),0)
  362. if @error Then
  363. _WinAPI_DeleteDC($hDC)
  364. Return SetError(2,0,0)
  365. EndIf
  366. _WinAPI_DeleteDC($hDC)
  367. Local $biWidth = DllStructGetData($vBITMAPINFO,"biWidth")
  368. Local $biHeight = DllStructGetData($vBITMAPINFO,"biHeight")
  369. Local $SizeArray[2]
  370. $SizeArray[0] = $biWidth
  371. $SizeArray[1] = $biHeight
  372. Return $SizeArray
  373. EndFunc
  374. Func DeleteMetaFile($hmf)
  375. $BOOL = DllCall("Gdi32.dll","BOOL","DeleteMetaFile","ptr",$hmf)
  376. if @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
  377. Return SetError(0,0,True)
  378. EndFunc
  379. Func DeleteEnhMetaFile($hemf)
  380. $BOOL = DllCall("Gdi32.dll","BOOL","DeleteEnhMetaFile","ptr",$hemf)
  381. if @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
  382. Return SetError(0,0,True)
  383. EndFunc
  384. Func DestroyCursor($hCursor)
  385. $BOOL = DllCall("User32.dll","BOOL","DestroyCursor","ptr",$hCursor)
  386. if @error Or $BOOL[0] = 0 Then Return SetError(1,0,False)
  387. Return SetError(0,0,True)
  388. EndFunc

comments powered by Disqus