Jump to content

GUI Window noob problem


Max007
 Share

Recommended Posts

Hello, i have a problem with my script, i was editing clock script from gui in examples and my previously created program... all works fine except that i don't know how to delete one window, becouse when i delete it, the other stops working...

here is image that describes what window i want to delete:

Posted Image

Here is a part of the script i think that couses the problem:

$hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, $WS_EX_TOPMOST)
  GUISetState()
  $hTime = GUICreate("Time" , 5000, 1800, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial)
  GUISetState()

Here is the whole script:

#include <GDIPlus.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

HotKeySet("{F4}", "Prihlas")
HotKeySet("{F5}", "Povol")

Opt("MustDeclareVars", 1)



Global Const $iCenter           = 400
Global Const $iOpacity          = 180
Global Const $nPI               = 3.1415926535897932384626433832795
Global Const $iRadius           = 500
Global Const $iSecRad           = 200
Global Const $AC_SRC_ALPHA      = 1
Global Enum $eScrDC=0, $eMemDC, $eBitmap, $eWidth, $eHeight, $eGraphic, $ePen, $eCap, $eBrush, $eFormat, $eFamily, $eFont, $eLayout, $eLast
Global $hDial, $hTime, $hHour, $hMin, $hSec, $hDot, $aTime, $aHour, $aMin, $aSec, $aCurr[3][2], $aLast[3][2], $stav

ClockInit()
ClockLoop()
ClockDone()

Global $povolene = 0
Global $skonci = 0
Global $adw = 0
Global $timer = 0
Global $full = 1
Global $timerbg = 0
Global $fullo = 1
Global $pismeno = ''
Global $pismenoad = 'a'
Global $prvykrat = 1
Global $timer = 0
Global $klikol = 0
Global $x = 0
Global $y = 0
Global $zistene = 0
Global $wide = 0
Global $povolenex = 1
Global $povoleney = 1
Global $pocetraz = 0
Global $sendkod = ''
Global $maxrand = 10000

Global $meno = ''
Global $heslo = ''
Global $accname = ''
Global $accpass = ''
Global $size[4]
Global $prvy = 1
 
 
 Func Prihlas()
     Global $zistene, $pocetraz, $povolenex, $povoleney, $y, $x, $wide, $klikol, $zaciatocnyget, $accname, $accpass
     Global $sizee[4]
     
     
     $zistene = 0
    while $zistene = 0 
    $pocetraz = $pocetraz + 1
    if $x = 4 Then 
        $povolenex = 0
    endif
    if $y = 3 Then
        $povoleney = 0
    endif
    
    if $x > 4 Then
        if $povolenex = 1 then
        $x = $x /2
        endif
    Endif   
    
    if $y > 3 Then
        if $povoleney = 1 then
        $y = $y /2
        endif
    Endif

    if ($x = 4 and $y = 3) or ($x = 3 and $y = 2)  then
    $zistene = 1
    $wide = 0
    endif
    if $pocetraz > 10 then
    $zistene = 1
    $wide = 1
    endif
wend
  
 if $zistene = 1 then
    $timer = 0
    $klikol = 1
    $sizee = WinGetPos("World of Warcraft")
    $sizee[3] = $sizee[1] + $sizee[3] / 2 *1.05
    $sizee[2] = $sizee[0] + $sizee[2] / 2 
    BlockInput(1)
    MouseMove($sizee[2], $sizee[3])
    MouseClick("main")
    sleep(100)
    $zaciatocnyget = ClipGet()
    ClipPut($accname)
    Send("{CTRLDOWN}" & "{V}" & "{CTRLUP}")
    ClipPut($zaciatocnyget)
    $sizee = WinGetPos("World of Warcraft")
    $sizee[3] = $sizee[1] + $sizee[3] / 2 *1.225
    $sizee[2] = $sizee[0] + $sizee[2] / 2 
    MouseMove($sizee[2], $sizee[3])
    MouseClick("main")
    sleep(100)
    $zaciatocnyget = ClipGet()
    ClipPut($accpass)
    Send("{CTRLDOWN}" & "{V}" & "{CTRLUP}")
    ClipPut($zaciatocnyget)
    
    $sizee = WinGetPos("World of Warcraft")
    $sizee[3] = $sizee[1] + $sizee[3] / 2 *1.5
    if $wide = 1 then
    $sizee[2] = $sizee[0] + $sizee[2] / 2 *0.88
else
    $sizee[2] = $sizee[0] + $sizee[2] / 2 *0.84
    endif
    MouseMove($sizee[2], $sizee[3])
    MouseClick("main")
    sleep(100)
    $sizee = WinGetPos("World of Warcraft")
    $sizee[3] = $sizee[1] + $sizee[3] / 2 *1.4225
    $sizee[2] = $sizee[0] + $sizee[2] / 2 
    MouseMove($sizee[2], $sizee[3])
    MouseClick("main")
    sleep(100)
    BlockInput(0)
    endif
EndFunc
 
Func Povol()
    Global $povolene
    Global $adw
    Global $sendkod
    Global $timer
    Global $timerbg
    Global $pismeno
    if $povolene = 0 Then 
    $povolene = 1 
    $stav = 'ON'
    $adw = 0 
    Beep(500, 500)
ElseIf $povolene = 1 Then
    $povolene = 0
    $stav = 'OFF'
    $adw = 1 
    $sendkod = "{" & $pismeno & " up}"
    ;Send($sendkod)
    $timer = 0
    $timerbg = 0
    Beep(500, 500)
   EndIf
EndFunc
Func TimeDraw()
    Global $stav, $prvy 
  Local $sString, $aSize
    if $prvy = 0 Then 
          $stav = 'OFF'
          $prvy = 1
          EndIf
    
  if ($aLast[0][0] = $aCurr[0][0]) and ($aLast[0][1] = $aCurr[0][1]) then Return
        
  $sString = StringFormat("%02d:%02d:%02d - PROGRAM IS TURNED %s", @HOUR, @MIN, @SEC, $stav)
  
  
  $aSize   = _GDIPlus_GraphicsMeasureString($aTime[$eGraphic], $sString, $aTime[$eFont], $aTime[$eLayout], $aTime[$eFormat])
  DllStructSetData($aTime[$eLayout], "X", $iRadius - (DllStructGetData($aSize[0], "Width") / 2))
  DllStructSetData($aTime[$eLayout], "Y", $iRadius / 3)
  _GDIPlus_GraphicsFillRect($aTime[$eGraphic], 0, 0, $iRadius * 2, $iRadius * 2)
  _GDIPlus_GraphicsDrawStringEx($aTime[$eGraphic], $sString, $aTime[$eFont], $aTime[$eLayout], $aTime[$eFormat], $aTime[$eBrush])
  ResourceSet($hTime, $aTime)
EndFunc



Func Terminate()
    Beep(500, 500)
    $povolene = 0
    $adw = 1 
    $sendkod = "{" & $pismeno & " up}"
    ;Send($sendkod)
    $timer = 0
    $timerbg = 0
    $skonci = 1
    Exit 0
EndFunc

Func ClockDone()
  TimeDone()
  _GDIPlus_Shutdown()
EndFunc

Func ClockInit()
  Local $iX, $iY

  $iX = -(_WinAPI_GetSystemMetrics($SM_CXFRAME))
  $iY = -(_WinAPI_GetSystemMetrics($SM_CYCAPTION) + _WinAPI_GetSystemMetrics($SM_CYFRAME))

 $hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, $WS_EX_TOPMOST)
  GUISetState()
  $hTime = GUICreate("Time" , 5000, 1800, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial)
  GUISetState()

  _GDIPlus_Startup()

  TimeInit()

  GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
EndFunc


Func ClockLoop()
    Global $povolene, $adw, $ad, $pismenoad, $prvykrat, $full, $mousepos, $meno, $heslo
    Global $size[4]
    Local $mocvelakratneskocil = 0
  do
    Draw() 
    if $povolene = 1 Then
        sleep(500)
    $adw = random(0,8,1)
    
    
if $mocvelakratneskocil < 20 Then
    if $adw = 0 Then
        send("{space}")
        $timerbg = $timerbg + 1
    Draw()
    Else 
        $mocvelakratneskocil = $mocvelakratneskocil + 1 
        $timerbg = $timerbg + 1
        Draw()
    EndIf
    Else
    $mocvelakratneskocil = 0
    send("{space}")
    $timerbg = $timerbg + 1
    Draw()
EndIf



 if $timerbg > 35 then
    $mousepos = mousegetpos()
    blockinput(1)
    Draw()
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.16
    $size[2] = $size[0] + $size[2] / 2 
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
$size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.95
    $size[2] = $size[0] + $size[2] / 2 *1.3
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.295
    $size[2] = $size[0] + $size[2] / 2 *0.15
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.24
    $size[2] = $size[0] + $size[2] / 2 *0.3
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.95
    $size[2] = $size[0] + $size[2] / 2 *1.3
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.4
    $size[2] = $size[0] + $size[2] / 2 *1.04
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *0.46
    $size[2] = $size[0] + $size[2] / 2 *0.85
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.02
    $size[2] = $size[0] + $size[2] / 2 *1.0
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("left")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.05
    $size[2] = $size[0] + $size[2] / 2 
    MouseMove($size[2], $size[3],3)
    Draw()
    ClipPut($meno)
    MouseClick("left")
    Send("{CTRLDOWN}" & "{A}" & "{CTRLUP}" & "{DELETE}")
    Sleep(200)
    Draw()
    Send("{CTRLDOWN}" & "{V}" & "{CTRLUP}")
    sleep(50)
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.225
    $size[2] = $size[0] + $size[2] / 2 
    MouseMove($size[2], $size[3],3)
    Draw()
    ClipPut($heslo)
    MouseClick("left")
    Send("{CTRLDOWN}" & "{A}" & "{CTRLUP}" & "{DELETE}")
    Sleep(200)
    Draw()
    Send("{CTRLDOWN}" & "{V}" & "{CTRLUP}")
    sleep(50)   
    $size = WinGetPos("World of Warcraft")
    $size[3] = $size[1] + $size[3] / 2 *1.5
    $size[2] = $size[0] + $size[2] / 2 
    MouseMove($size[2], $size[3],3)
    Draw()
    MouseClick("main")
    sleep(50)   
    Mousemove($mousepos[0],$mousepos[1])
    Draw()
    BlockInput(0)
    $timerbg = 0
endif
 $adw = 0
 $timer = 0
 
Else    
EndIf


  until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc

Func Draw()
  $aLast = $aCurr
  $aCurr[0][0] = $iCenter + Cos(TimeToRadians("sec" )) * $iSecRad
  TimeDraw()
EndFunc

Func ResourceDone(ByRef $aInfo)
  _GDIPlus_GraphicsDispose($aInfo[$eGraphic])
  _WinAPI_ReleaseDC   (0, $aInfo[$eScrDC])
  _WinAPI_DeleteObject($aInfo[$eBitmap])
  _WinAPI_DeleteDC    ($aInfo[$eMemDC ])
EndFunc

Func ResourceInit($iWidth, $iHeight)
  Local $aInfo[$eLast + 1]

  $aInfo[$eScrDC  ] = _WinAPI_GetDC(0)
  $aInfo[$eMemDC  ] = _WinAPI_CreateCompatibleDC($aInfo[$eScrDC])
  $aInfo[$eBitmap ] = _WinAPI_CreateCompatibleBitmap($aInfo[$eScrDC], $iWidth, $iHeight)
  _WinAPI_SelectObject($aInfo[$eMemDC], $aInfo[$eBitmap])
  $aInfo[$eWidth  ] = $iWidth
  $aInfo[$eHeight ] = $iHeight
  $aInfo[$eGraphic] = _GDIPlus_GraphicsCreateFromHDC($aInfo[$eMemDC])
  _GDIPlus_GraphicsFillRect($aInfo[$eGraphic], 0, 0, 0, 0)
  Return $aInfo
EndFunc
 
 Func ResourceSet($hGUI, ByRef $aInfo, $iAlpha=-1)
  Local $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

  if $iAlpha = -1 then $iAlpha = $iOpacity
  $tSize   = DllStructCreate($tagSIZE)
  $pSize   = DllStructGetPtr($tSize  )
  DllStructSetData($tSize, "X", $aInfo[$eWidth ])
  DllStructSetData($tSize, "Y", $aInfo[$eHeight])
  $tSource = DllStructCreate($tagPOINT)
  $pSource = DllStructGetPtr($tSource)
  $tBlend  = DllStructCreate($tagBLENDFUNCTION)
  $pBlend  = DllStructGetPtr($tBlend )
  DllStructSetData($tBlend, "Alpha" , $iAlpha      )
  DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
  _WinAPI_UpdateLayeredWindow($hGUI, $aInfo[$eScrDC], 0, $pSize, $aInfo[$eMemDC], $pSource, 0, $pBlend, $ULW_ALPHA)
EndFunc

Func TimeDone()
  _GDIPlus_FontDispose        ($aTime[$eFont  ])
  _GDIPlus_FontFamilyDispose  ($aTime[$eFamily])
  _GDIPlus_StringFormatDispose($aTime[$eFormat])
  _GDIPlus_BrushDispose       ($aTime[$eBrush ])
  ResourceDone($aTime)
EndFunc

Func TimeInit()
  $aTime = ResourceInit(1000, 1000)
  $aTime[$eBrush ] = _GDIPlus_BrushCreateSolid(0xFF000000)
  $aTime[$eFormat] = _GDIPlus_StringFormatCreate()
  $aTime[$eFamily] = _GDIPlus_FontFamilyCreate("Kalinga")
  $aTime[$eFont  ] = _GDIPlus_FontCreate($aTime[$eFamily], 16, 0)
  $aTime[$eLayout] = _GDIPlus_RectFCreate(0, 0, 0, 40)
EndFunc

Func TimeToRadians($sTimeType)
  Switch $sTimeType
    case "sec"
      Return ($nPI / 2) - (@SEC  * ($nPI / 30))
    case "min"
      Return ($nPI / 2) - (@MIN  * ($nPI / 30)) - (Int(@SEC / 10) * ($nPI / 180))
    case "hour"
      Return ($nPI / 2) - (@HOUR * ($nPI / 6 )) - (@MIN / 12) * ($nPI / 30)
  EndSwitch
EndFunc

When I change

$hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, $WS_EX_TOPMOST)

to

$hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))

the window is not visible, but i can still click on it... i want only the window with time and "PROGRAM IS TURNED OFF" to be visible.. pls help.. ;)

Ignore functions Terminate(), Povol() and Prihlas()

Edited by Max007
Link to comment
Share on other sites

  • Moderators

Max007,

From your code:

$sizee = WinGetPos("World of Warcraft")
$sizee[3] = $sizee[1] + $sizee[3] / 2 * 1.05
$sizee[2] = $sizee[0] + $sizee[2] / 2
BlockInput(1)
MouseMove($sizee[2], $sizee[3])
MouseClick("main")

Have you read this? We do not support game bots here. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Max007,

From your code:

$sizee = WinGetPos("World of Warcraft")
$sizee[3] = $sizee[1] + $sizee[3] / 2 * 1.05
$sizee[2] = $sizee[0] + $sizee[2] / 2
BlockInput(1)
MouseMove($sizee[2], $sizee[3])
MouseClick("main")

Have you read this? We do not support game bots here. ;)

M23

uh.. i am not asking for help with bot, i am asking for help with gui windows, i have this problem with all of my programs, not only bots :/
Link to comment
Share on other sites

  • Moderators

Max007,

have this problem with all of my programs

Then provide some code that is not from a bot and we might be able to help. :) A very simple script will do!

M23

P.S. When you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. ;)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Ok, here it is, sry for braking the rules with the bot thing.. some moderator pls delete that src code so no one can use it to automatize some things in wow.. ;)

#include <GDIPlus.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

HotKeySet("{F5}", "TurnOn")

Opt("MustDeclareVars", 1)

Global Const $iCenter           = 400
Global Const $iOpacity          = 180
Global Const $nPI               = 3.1415926535897932384626433832795
Global Const $iRadius           = 500
Global Const $iSecRad           = 200
Global Const $AC_SRC_ALPHA      = 1
Global Enum $eScrDC=0, $eMemDC, $eBitmap, $eWidth, $eHeight, $eGraphic, $ePen, $eCap, $eBrush, $eFormat, $eFamily, $eFont, $eLayout, $eLast
Global $hDial, $hTime, $hHour, $hMin, $hSec, $hDot, $aTime, $aHour, $aMin, $aSec, $aCurr[3][2], $aLast[3][2], $stav

ClockInit()
ClockLoop()
ClockDone()

 Func TimeDraw()
    Global $stav, $prvy 
  Local $sString, $aSize
    if $prvy = 0 Then 
          $stav = 'OFF'
          $prvy = 1
          EndIf
    
  if ($aLast[0][0] = $aCurr[0][0]) and ($aLast[0][1] = $aCurr[0][1]) then Return
        
  $sString = StringFormat("%02d:%02d:%02d - PROGRAM IS TURNED %s", @HOUR, @MIN, @SEC, $stav)
  
  
  $aSize   = _GDIPlus_GraphicsMeasureString($aTime[$eGraphic], $sString, $aTime[$eFont], $aTime[$eLayout], $aTime[$eFormat])
  DllStructSetData($aTime[$eLayout], "X", $iRadius - (DllStructGetData($aSize[0], "Width") / 2))
  DllStructSetData($aTime[$eLayout], "Y", $iRadius / 3)
  _GDIPlus_GraphicsFillRect($aTime[$eGraphic], 0, 0, $iRadius * 2, $iRadius * 2)
  _GDIPlus_GraphicsDrawStringEx($aTime[$eGraphic], $sString, $aTime[$eFont], $aTime[$eLayout], $aTime[$eFormat], $aTime[$eBrush])
  ResourceSet($hTime, $aTime)
EndFunc

Func ClockDone()
  TimeDone()
  _GDIPlus_Shutdown()
EndFunc

Func ClockInit()
  Local $iX, $iY

  $iX = -(_WinAPI_GetSystemMetrics($SM_CXFRAME))
  $iY = -(_WinAPI_GetSystemMetrics($SM_CYCAPTION) + _WinAPI_GetSystemMetrics($SM_CYFRAME))

 $hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
  GUISetState()
  $hTime = GUICreate("Time" , 5000, 1800, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial)
  GUISetState()

  _GDIPlus_Startup()

  TimeInit()

  GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
EndFunc

Func TurnOn()
  Global $stav
  if $stav = 'OFF' Then
  $stav = 'ON'
  Else
      $stav = 'OFF'
      EndiF
EndFunc


Func ClockLoop()
  do
    Draw() 
  until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc

Func Draw()
  $aLast = $aCurr
  $aCurr[0][0] = $iCenter + Cos(TimeToRadians("sec" )) * $iSecRad
  TimeDraw()
EndFunc

Func ResourceDone(ByRef $aInfo)
  _GDIPlus_GraphicsDispose($aInfo[$eGraphic])
  _WinAPI_ReleaseDC   (0, $aInfo[$eScrDC])
  _WinAPI_DeleteObject($aInfo[$eBitmap])
  _WinAPI_DeleteDC    ($aInfo[$eMemDC ])
EndFunc

Func ResourceInit($iWidth, $iHeight)
  Local $aInfo[$eLast + 1]

  $aInfo[$eScrDC  ] = _WinAPI_GetDC(0)
  $aInfo[$eMemDC  ] = _WinAPI_CreateCompatibleDC($aInfo[$eScrDC])
  $aInfo[$eBitmap ] = _WinAPI_CreateCompatibleBitmap($aInfo[$eScrDC], $iWidth, $iHeight)
  _WinAPI_SelectObject($aInfo[$eMemDC], $aInfo[$eBitmap])
  $aInfo[$eWidth  ] = $iWidth
  $aInfo[$eHeight ] = $iHeight
  $aInfo[$eGraphic] = _GDIPlus_GraphicsCreateFromHDC($aInfo[$eMemDC])
  _GDIPlus_GraphicsFillRect($aInfo[$eGraphic], 0, 0, 0, 0)
  Return $aInfo
EndFunc
 
 Func ResourceSet($hGUI, ByRef $aInfo, $iAlpha=-1)
  Local $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

  if $iAlpha = -1 then $iAlpha = $iOpacity
  $tSize   = DllStructCreate($tagSIZE)
  $pSize   = DllStructGetPtr($tSize  )
  DllStructSetData($tSize, "X", $aInfo[$eWidth ])
  DllStructSetData($tSize, "Y", $aInfo[$eHeight])
  $tSource = DllStructCreate($tagPOINT)
  $pSource = DllStructGetPtr($tSource)
  $tBlend  = DllStructCreate($tagBLENDFUNCTION)
  $pBlend  = DllStructGetPtr($tBlend )
  DllStructSetData($tBlend, "Alpha" , $iAlpha      )
  DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
  _WinAPI_UpdateLayeredWindow($hGUI, $aInfo[$eScrDC], 0, $pSize, $aInfo[$eMemDC], $pSource, 0, $pBlend, $ULW_ALPHA)
EndFunc

Func TimeDone()
  _GDIPlus_FontDispose        ($aTime[$eFont  ])
  _GDIPlus_FontFamilyDispose  ($aTime[$eFamily])
  _GDIPlus_StringFormatDispose($aTime[$eFormat])
  _GDIPlus_BrushDispose       ($aTime[$eBrush ])
  ResourceDone($aTime)
EndFunc

Func TimeInit()
  $aTime = ResourceInit(1000, 1000)
  $aTime[$eBrush ] = _GDIPlus_BrushCreateSolid(0xFF000000)
  $aTime[$eFormat] = _GDIPlus_StringFormatCreate()
  $aTime[$eFamily] = _GDIPlus_FontFamilyCreate("Kalinga")
  $aTime[$eFont  ] = _GDIPlus_FontCreate($aTime[$eFamily], 16, 0)
  $aTime[$eLayout] = _GDIPlus_RectFCreate(0, 0, 0, 40)
EndFunc

Func TimeToRadians($sTimeType)
  Switch $sTimeType
    case "sec"
      Return ($nPI / 2) - (@SEC  * ($nPI / 30))
    case "min"
      Return ($nPI / 2) - (@MIN  * ($nPI / 30)) - (Int(@SEC / 10) * ($nPI / 180))
    case "hour"
      Return ($nPI / 2) - (@HOUR * ($nPI / 6 )) - (@MIN / 12) * ($nPI / 30)
  EndSwitch
EndFunc

My problem is the same as before, the window is not visible but is clickable.

Edited by Max007
Link to comment
Share on other sites

  • Moderators

Max007,

What is it supposed to do? ;)

The only GUIs I can find are:

$hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
$hTime = GUICreate("Time" , 5000, 1800, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial)

What kind of sizes are those? :)

And what is supposed to happen - I get no reaction at all when I press F5. Even after I add the missing WM_NCHITTEST function. ;)

If you are having problems with multiple GUIs, might I suggest reading the Wiki tutorial "Managing Multiple GUIs" - it could be useful. :P

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Solved...

$hDial = GUICreate("Clock",0, -400,  -1,  -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
  GUISetState(@SW_DISABLE)
  $hTime = GUICreate("Time" , 5000, 1800, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial)
  GUISetState()

thx for help :)

;)

Edited by Max007
Link to comment
Share on other sites

  • Moderators

Max007,

Not sure I gave you any! ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...