je suis actuellement confronter a un petit souci au niveau de ma GUI. j'utilise un png transparent comme fond de celle-ci, j'arrive a ajouter et utiliser des controles (bouton, texte, radio, etc...), mais par contre impossible d'ajouter un controle tab, il ne s'affiche pas du tout :/
Voici le code que j'ai actuellement :
► Afficher le texte
Code : Tout sélectionner
#cs
includes
#ce
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <TabConstants.au3>
#include <SliderConstants.au3>
#include <GuiSlider.au3>
#include <StaticConstants.au3>
#include <NomadMemory.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#cs
End of includes
#ce
#cs
Hotkeys
#ce
#cs
End of Hotkeys
#ce
#cs
variables
#ce
Global Const $AC_SRC_ALPHA = 1
$version = "v2.0.a"
_GDIPlus_Startup()
$pngSrc = @ScriptDir & "\tws2mhbg.png"
$hImage = _GDIPlus_ImageLoadFromFile($pngSrc)
$width = _GDIPlus_ImageGetWidth($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)
#cs
End of variables
#ce
#cs
GUI
#ce
$GUI = guicreate("The Title " & $version, $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
SetBitmap($GUI, $hImage, 255)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
$ControlGUI = GUICreate("ControlGUI", $width, $height,0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $GUI)
GUICtrlCreatePic(@ScriptDir & "\grey.gif", 0, 0, $width, $height)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateTab(20,150, Default, Default,$TCS_OWNERDRAWFIXED)
GUICtrlCreateTabItem("test")
GUICtrlCreateLabel("toto", 45,175)
GUICtrlCreateTabItem("")
;Exit button
$button_exit = GUICtrlCreateButton("Exit", 340, 290, 40, 20)
;show it
GUISetState()
#cs
End of GUI
#ce
#cs
Main while
#ce
while 1
$msg = GUIGetMsg()
Select
case $msg = $button_exit
_Quit()
EndSelect
WEnd
#cs
End of main while
#ce
#cs
Functions
#ce
func _Quit()
GUIDelete($controlGui)
_WinAPI_DeleteObject($hImage)
_GDIPlus_Shutdown()
Exit
EndFunc
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
If ($hWnd = $GUI) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc ;==>WM_NCHITTEST
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, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap
#cs
End of functions
#ce
En espérant que quelqu'un pourra m'aider a trouver une solution pour ça.
Kuchiha.