Jump to content

GUI Problem


Recommended Posts

I am making a clock and want to make custom hands for the clock, but how do I set a Graphic over top of this script properly.

I tried making another child over the first child but that didn't work.

The Graphic is made of GUICtrlCreateGraphic

#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Width = 545
$Height = 610
$Image = @ScriptDir & "\Clock.bmp"
_Singleton(@ScriptName , 0)
If Not FileExists($Image) Then
    MsgBox(16 , "Error" , "Clock.bmp is missing.")
    Exit
EndIf
    
$Parent = GUICreate("Background", $Width , $Height)
$Clock = GUICreate("Clock", $Width , $Height , Default , Default , $WS_POPUP , $WS_EX_LAYERED + $WS_EX_MDICHILD , $Parent)
$ClockPic = GUICtrlCreatePic($Image, 0, 0, $Width, $Height , Default , $GUI_WS_EX_PARENTDRAG)
;GUICtrlSetState($ClockPic, $GUI_DISABLE)
GUISetState(@SW_SHOW)

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            ExitLoop

    EndSwitch
WEnd
Edited by JellyFish666
Link to comment
Share on other sites

Search Examples forum for "clock" in titles only:

http://www.autoitscript.com/forum/index.ph...ghlite=%2Bclock

Thanks already did that, didn't find what I was looking for, my problem is i got a GUI with a child that has a picture and I need find a way to have a graphic over the child but have the picture of the child still draggable.

Link to comment
Share on other sites

Thanks already did that, didn't find what I was looking for, my problem is i got a GUI with a child that has a picture and I need find a way to have a graphic over the child but have the picture of the child still draggable.

Then use drawing API - GDI,GDI+

probably also GUIReigsterMsg() with WM_PAINT

Edited by Zedna
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...