Jump to content
Sign in to follow this  
JellyFish666

GUI Problem

Recommended Posts

JellyFish666

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

Share this post


Link to post
Share on other sites
JellyFish666

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.

Share this post


Link to post
Share on other sites
Zedna

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

Share this post


Link to post
Share on other sites
JellyFish666

Then use drawing API - GDI,GDI+

probably also GUIReigsterMsg() with WM_PAINT

I appreciate you trying to help and I know about GDI, but the problem is setting a control over top not sure how to do that!

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.