Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Новый участник


Сообщения: 36
Благодарности: 2

Профиль | Отправить PM | Цитировать


Изображения
Тип файла: png 2.png
(22.1 Kb, 21 просмотров)

Цитата Creat0R:

PHP код: Выделить весь код

#NoTrayIcon

#include <GDIPlus.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <Misc.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WinAPI.au3>
Global Const $AC_SRC_ALPHA 1;, $ULW_ALPHA 2
Global $launchDir = @DesktopDir$GUI
Global $hUser32DllOpen DllOpen("User32.dll")
$temp "E:\VBA\AutoIt\GUI\1.png"
Transp_PNG($temp)
Func Transp_PNG($temp$iOpacity 255$EnableFade True)
 If 
$iOpacity 0 Then $iOpacity 0
 
If $iOpacity 255 Then $iOpacity 255
Load PNG file as GDI bitmap
 _GDIPlus_Startup
()
 
$pngSrc $temp
 $hImage 
_GDIPlus_ImageLoadFromFile($pngSrc)
Extract image width and height from PNG
 $width 
_GDIPlus_ImageGetWidth($hImage)
 
$height _GDIPlus_ImageGetHeight($hImage)
Create layered window
$GUI 
GUICreate("lod3n launcher"$width$height, -1, -1$WS_POPUP$WS_EX_LAYERED)
GUIRegisterMsg($WM_NCHITTEST"WM_NCHITTEST")
 
GUISetState()
 
WinSetOnTop($GUI""1)
If 
$EnableFade Then
 
;fade in png background
 
For $i 0 To $iOpacity Step 1
 SetBitmap
($GUI$hImage$i)
 
Next
 
Else
 
SetBitmap($GUI$hImage$iOpacity)
 EndIf
set default button for Enter key activation renders outside GUI window
 $BtnExit 
GUICtrlCreateButton("Exit"$width$height1010$BS_DEFPUSHBUTTON)
While 
1
 
Switch GUIGetMsg()
 Case 
$GUI_EVENT_CLOSE$BtnExit
 ExitLoop
 
EndSwitch
If 
_IsPressed(01$hUser32DllOpenThen ExitLoop
 WEnd
If $EnableFade Then
 
;fade out png background
 
For $i $iOpacity To 0 Step -1
 SetBitmap
($GUI$hImage$i)
 
Next
 
Else
 
SetBitmap($GUI$hImage0)
 EndIf
CancelPressed()
EndFunc ;==>Transp_PNG
Func CancelPressed
()
 
DllClose($hUser32DllOpen)
Exit
EndFunc
Handle the WM_NCHITTEST for the layered window so it can be dragged by clicking anywhere on the image.
Func WM_NCHITTEST($hWnd$iMsg$iwParam$ilParam)
 Switch 
$iMsg
 
Case $WM_NCHITTEST
 
If $hWnd $GUI Then Return $HTCAPTION
 
EndSwitch
EndFunc ;==>WM_NCHITTEST
SetBitMap
Func SetBitmap
($hGUI$hImage$iOpacity)
 
Local $hScrDC$hMemDC$hBitmap$hOld$pSize$tSize$pSource$tSource$pBlend$tBlend
$hScrDC 
_WinAPI_GetDC(0)
 
$hMemDC _WinAPI_CreateCompatibleDC($hScrDC)
 
$hBitmap _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
 
$hOld _WinAPI_SelectObject($hMemDC$hBitmap)
 
$tSize DllStructCreate($tagSIZE)
 
$pSize DllStructGetPtr($tSize)
 
DllStructSetData($tSize"X"_GDIPlus_ImageGetWidth($hImage))
 
DllStructSetData($tSize"Y"_GDIPlus_ImageGetHeight($hImage))
 
$tSource DllStructCreate($tagPOINT)
 
$pSource DllStructGetPtr($tSource)
 
$tBlend DllStructCreate($tagBLENDFUNCTION)
 
$pBlend DllStructGetPtr($tBlend)
 
DllStructSetData($tBlend"Alpha"$iOpacity)
 
DllStructSetData($tBlend"Format"$AC_SRC_ALPHA)
 
_WinAPI_UpdateLayeredWindow($hGUI$hScrDC0$pSize$hMemDC$pSource0$pBlend$ULW_ALPHA)
 
_WinAPI_ReleaseDC(0$hScrDC)
 
_WinAPI_SelectObject($hMemDC$hOld)
 
_WinAPI_DeleteObject($hBitmap)
 
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap [post=984502]»[/post
PHP код: Выделить весь код

 


Если чесно то не работает как надо ,Не важно куда я нажимаю мышкой на экране ,иконка закривается .А я хотел именно назимая на иконку ,закриват ее

Последний раз редактировалось shyra1976, 21-12-2008 в 12:28.


Отправлено: 08:58, 21-12-2008 | #1321