Jump to content
edumanilha

Button doesn't appear...

Recommended Posts

Hi again...

I saw this transparent GUI but, I created a new topic, so I wont ressurect the older one...I'm trying a transparent GUI with buttons...

And code look like this:

#include <GDIPlus.au3>
#include <ButtonConstants.au3>
#include <Array.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
 _GDIPlus_Startup()

$hSplashlogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\auto.bmp")


$logoheight = (@DesktopHeight/2) - (_GDIPlus_ImageGetHeight($hSplashlogo)/2) - 50
$logowidth = (@DesktopWidth /2) - (_GDIPlus_ImageGetWidth($hSplashlogo)/2)
$SplashGUIlogo = GUICreate("", _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo), $logowidth, $logoheight, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW))
_SetBitmap($SplashGUIlogo, $hSplashlogo, 255, _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo))
GUISetState(@SW_SHOWNA, $SplashGUIlogo)

;criação do contexto
Local $idContextmenu = GUICtrlCreateContextMenu()

;botão 1 autocompletar
$buttonauto = GUICtrlCreateButton ("autocompletar", 10, 10, 150, 170, $BS_BITMAP)
GUICtrlSetImage ($buttonauto, @ScriptDir & "\Dados\Imagens\auto.bmp")
Local $idButtoncontext = GUICtrlCreateContextMenu($buttonauto)
Local $idMenuAboutauto = GUICtrlCreateMenuItem("Só digitar o final da unidade em que você está!", $idButtoncontext)


;botão 2 preencher
$buttonfill = GUICtrlCreateButton ("preenchimento", 180, 10, 150, 170, $BS_BITMAP)
GUICtrlSetImage ($buttonfill, @ScriptDir & "\Dados\Imagens\fill.bmp")
Local $idButtoncontext = GUICtrlCreateContextMenu($buttonfill)
Local $idMenuAboutfill = GUICtrlCreateMenuItem("Preencher todo o IP em caso de outra unidade!", $idButtoncontext)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd

 _GDIPlus_Shutdown()




Func _SetBitmap($hGUI, $hImage, $iOpacity, $n_width = 200, $n_height = 200)
    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", $n_width)
    DllStructSetData($tSize, "Y", $n_height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _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

The code show no errors, but load only the image, not the buttons...What I'm doing wrong?...Thanks!

 

EDIT: today when I updated Autoit, I got this error...

 

image.png.4cf9acedb18cba53e1e49ed20487e70d.png

Edited by edumanilha
wrong code

Share this post


Link to post
Share on other sites

Using this:
 

#include <GDIPlus.au3>
#include <ButtonConstants.au3>
#include <Array.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <StaticConstants.au3>
 _GDIPlus_Startup()

$hSplashlogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\background.png")
$logoheight = (@DesktopHeight/2) - (_GDIPlus_ImageGetHeight($hSplashlogo)/2) - 50
$logowidth = (@DesktopWidth /2) - (_GDIPlus_ImageGetWidth($hSplashlogo)/2)
$SplashGUIlogo = GUICreate("", _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo), $logowidth, $logoheight, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW))
_SetBitmap($SplashGUIlogo, $hSplashlogo, 255, _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo))
GUISetState(@SW_SHOW, $SplashGUIlogo)

$button1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\auto.bmp")
$buttonheight = 25
$buttonwidth = 30
$SplashGUIbutton1 = GUICreate("", _GDIPlus_ImageGetWidth($button1), _GDIPlus_ImageGetHeight($button1), $buttonwidth, $buttonheight, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $SplashGUIlogo)
_SetBitmap($SplashGUIbutton1, $button1, 255, _GDIPlus_ImageGetWidth($button1), _GDIPlus_ImageGetHeight($button1))
GUICtrlCreateLabel("Type the name of a file on your desktop and press Enter", 50, 12, 140, 50)
GUISetState(@SW_SHOW, $SplashGUIbutton1)

$button2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\fill.bmp")
$buttonheight2 = 25
$buttonwidth2 = 190
$SplashGUIbutton2 = GUICreate("", _GDIPlus_ImageGetWidth($button2), _GDIPlus_ImageGetHeight($button2), $buttonwidth2, $buttonheight2, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $SplashGUIlogo)
_SetBitmap($SplashGUIbutton2, $button2, 255, _GDIPlus_ImageGetWidth($button2), _GDIPlus_ImageGetHeight($button2))
GUISetState(@SW_SHOW, $SplashGUIbutton2)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        ;Case $GUI_EVENT_PRYMARYDOWN
        ;   Exit
        Case $SplashGUIbutton1
            Exit
    EndSwitch
WEnd

 _GDIPlus_Shutdown()




Func _SetBitmap($hGUI, $hImage, $iOpacity, $n_width = 500, $n_height = 200)
    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", $n_width)
    DllStructSetData($tSize, "Y", $n_height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _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

Func _SetBitmap2($hGUI, $hImage, $iOpacity, $n_width = 150, $n_height = 170)
    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", $n_width)
    DllStructSetData($tSize, "Y", $n_height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _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

I managed to show the background and the first two buttons...But I can't place buttons, guigetmsg or anything...I'm planning to use te images as buttons...All images are inserted as GUI...Can anybody help me please?...

Images are set as GUI, because I tried as Buttons and images without success...

image.png.2661b0b8adb5ca597f4a3a9be7359404.png

Edited by edumanilha
more info

Share this post


Link to post
Share on other sites

I'm trying to put buttons on a png background GUI...I got no error, the buttons is there (It works when I click his position) but I can't show him...I tried  GUISetState, GUI_SHOW and GUI_ONTOP...But nothing...Heres the code:

#include <GDIPlus.au3>
#include <ButtonConstants.au3>
#include <Array.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <StaticConstants.au3>
 _GDIPlus_Startup()

$hSplashlogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\background.png")
$logoheight = (@DesktopHeight/2) - (_GDIPlus_ImageGetHeight($hSplashlogo)/2) - 50
$logowidth = (@DesktopWidth /2) - (_GDIPlus_ImageGetWidth($hSplashlogo)/2)
$SplashGUIlogo = GUICreate("", _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo), $logowidth, $logoheight, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW))
_SetBitmap($SplashGUIlogo, $hSplashlogo, 255, _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo))

$button2 = GUICtrlCreateButton ("comandos", 25, 30, 150, 170, $BS_BITMAP)
GUICtrlSetImage ($button2, @ScriptDir & "\Dados\Imagens\comandos.bmp")
GUICtrlSetState ($button2,$GUI_ONTOP)

GUISetState(@SW_SHOWNA, $SplashGUIlogo)


While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        ;Case $GUI_EVENT_PRYMARYDOWN
        ;   Exit
        Case $button2
            Exit
    EndSwitch
WEnd

 _GDIPlus_Shutdown()




Func _SetBitmap($hGUI, $hImage, $iOpacity, $n_width = 500, $n_height = 200)
    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", $n_width)
    DllStructSetData($tSize, "Y", $n_height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _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

Thanks...

Share this post


Link to post
Share on other sites

Your script isn't runable:

Quote

>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\hB\AutoIt3.MySource\LogoGUI.au3
"C:\Users\hB\AutoIt3.MySource\LogoGUI.au3"(60,101) : warning: $ULW_ALPHA: possibly used before declaration.
    _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\hB\AutoIt3.MySource\LogoGUI.au3"(60,101) : error: $ULW_ALPHA: undeclared global variable.
    _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\hB\AutoIt3.MySource\LogoGUI.au3"(60,101) : error: _WinAPI_UpdateLayeredWindow(): undefined function.
    _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\hB\AutoIt3.MySource\LogoGUI.au3 - 2 error(s), 1 warning(s)
!>17:41:18 AU3Check ended. Press F4 to jump to next error.rc:2
+>17:41:18 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 46.51

 

Share this post


Link to post
Share on other sites
1 hour ago, edumanilha said:

I just changed the aproach to 2 GUI's to a GUI and buttons...Can I delete one of them?

Merged. Please stick to one topic going forward.


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
2 hours ago, AutoBert said:

Your script isn't runable:

 

I can run it...But It only show the white GDI background and don't show the button...I'm making some progress here. brb.

Share this post


Link to post
Share on other sites
On 2/17/2020 at 8:37 PM, edumanilha said:

I can run it...But It only show the white GDI background and don't show the button...I'm making some progress here. brb.

None of the three scripts posted in this (meanwhile merged) thread is runable, at last one include is missing. And please attach used image files.

Share this post


Link to post
Share on other sites
21 minutes ago, AutoBert said:

None of the three scripts posted in this (meanwhile merged) thread is runable, at last one include is missing. And please attach used image files.

Weird...I can run...When I try to use buttons, they don't show...I put the images using create GUi...But they aren't clickable...I think the thing that I'm clicking on the image GUI position, suposed to be a button is "the GuiCreateLabel" thats getting the "GUICtrlSetOnEvent(-1, "umapertado")" 

I Attached the images like you asked...

The script is looking like this:

Opt("GUIOnEventMode",1)
#include <GDIPlus.au3>
#include <ButtonConstants.au3>
#include <Array.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <GuiListBox.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <StaticConstants.au3>
 _GDIPlus_Startup()

$hSplashlogo = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\background.png")
$logoheight = (@DesktopHeight/2) - (_GDIPlus_ImageGetHeight($hSplashlogo)/2) - 50
$logowidth = (@DesktopWidth /2) - (_GDIPlus_ImageGetWidth($hSplashlogo)/2)
$SplashGUIlogo = GUICreate("", _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo), $logowidth, $logoheight, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW))
_SetBitmap($SplashGUIlogo, $hSplashlogo, 255, _GDIPlus_ImageGetWidth($hSplashlogo), _GDIPlus_ImageGetHeight($hSplashlogo))

GUISetState(@SW_SHOW, $SplashGUIlogo)

;$button2 = GUICtrlCreateButton ("comandos", 25, 30, 150, 170, $BS_BITMAP)
;GUICtrlSetImage ($button2, @ScriptDir & "\Dados\Imagens\comandos.bmp")
;GUICtrlSetState ($button2,$GUI_SHOW)
;WinSetOnTop($button2,'',1)


$button1 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\auto.bmp")
$buttonheight = 25
$buttonwidth = 30
$SplashGUIbutton1 = GUICreate("", _GDIPlus_ImageGetWidth($button1), _GDIPlus_ImageGetHeight($button1), $buttonwidth, $buttonheight, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $SplashGUIlogo)
_SetBitmap($SplashGUIbutton1, $button1, 255, _GDIPlus_ImageGetWidth($button1), _GDIPlus_ImageGetHeight($button1))
GUICtrlSetOnEvent(-1, "umapertado")
$label = GUICtrlCreateLabel("Type the name of a file on your desktop and press Enter", 15, 30, 150, 170,$SS_RIGHT)
GUICtrlSetState ($label,$GUI_SHOW)
GUISetState(@SW_SHOW, $SplashGUIbutton1)



$button2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Dados\Imagens\fill.bmp")
$buttonheight2 = 25
$buttonwidth2 = 190
$SplashGUIbutton2 = GUICreate("", _GDIPlus_ImageGetWidth($button2), _GDIPlus_ImageGetHeight($button2), $buttonwidth2, $buttonheight2, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $SplashGUIlogo)
_SetBitmap($SplashGUIbutton2, $button2, 255, _GDIPlus_ImageGetWidth($button2), _GDIPlus_ImageGetHeight($button2))
GUISetState(@SW_SHOW, $SplashGUIbutton2)
GUICtrlSetOnEvent(-1, "doisapertado")
$label2 = GUICtrlCreateLabel("Type the name of a file on your desktop and press Enter", 300, 30, 150, 170,$SS_RIGHT)
GUICtrlSetState ($label2,$GUI_SHOW)
GUISetState(@SW_SHOW, $SplashGUIbutton2)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        ;Case $GUI_EVENT_PRYMARYDOWN
        ;   Exit
        Case $button1
            Exit
        Case $button2
            Exit
        Case $SplashGUIbutton1
     MsgBox($MB_SYSTEMMODAL, "OK Pressed", "está ok botão switch 1")
    EndSwitch
WEnd

 _GDIPlus_Shutdown()

         While 1
            Switch GUIGetMsg()
               Case $GUI_EVENT_CLOSE
                     Exit
               Case $SplashGUIbutton1
    MsgBox($MB_SYSTEMMODAL, "OK Pressed", "está ok botão switch 2")
                     ExitLoop
            EndSwitch
         WEnd






Func umapertado()
    ;MsgBox($MB_SYSTEMMODAL, "OK Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
    MsgBox($MB_SYSTEMMODAL, "OK Pressed", "está ok func")
        ;Exit
EndFunc   ;==>OKPressed

Func doisapertado()
    ;MsgBox($MB_SYSTEMMODAL, "Cancel Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle & " CtrlHandle=" & @GUI_CtrlHandle)
        MsgBox($MB_SYSTEMMODAL, "OK Pressed", "está ok func 2")
    ;Exit
EndFunc   ;==>CancelPressed


Func _SetBitmap($hGUI, $hImage, $iOpacity, $n_width = 500, $n_height = 200)
    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", $n_width)
    DllStructSetData($tSize, "Y", $n_height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", 1)
    _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

 

background.png

auto.bmp fill.bmp

Share this post


Link to post
Share on other sites

I am by no means an expert in this arena but I looked over my code and I did notice a couple of things:

I think you are on the right track with your last post. Setting the buttons as gui's themselves. But you won't be able to use GUICtrlSetOnEvent like that. Use GUIRegisterMsg to get the click from a gui.

I noticed that I used png's for my button images not bmps. Maybe this is the issue?

And on a side note: consider using _GDIPlus_ImageGetWidth/Height just once for each image and then using the variable it returns. That part of your code works but could be more efficient.

Share this post


Link to post
Share on other sites
3 hours ago, MagnumXL said:

I am by no means an expert in this arena but I looked over my code and I did notice a couple of things:

I think you are on the right track with your last post. Setting the buttons as gui's themselves. But you won't be able to use GUICtrlSetOnEvent like that. Use GUIRegisterMsg to get the click from a gui.

I noticed that I used png's for my button images not bmps. Maybe this is the issue?

And on a side note: consider using _GDIPlus_ImageGetWidth/Height just once for each image and then using the variable it returns. That part of your code works but could be more efficient.

I'm no expert too, thanks for your response! I'm thinking about work with coords, since I can't put buttons...Maybe fake buttons...A complete png image, with drawn buttons, close, etc...And work with coords...to simulate button presses...I'll try you sugestions! Thanks!

EDIT: I've been messing around this script, please don't remind the trash in the example...

Edited by edumanilha
change word

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...