Jump to content

Warning Box with image


Recommended Posts

an example using an icon

#include <GuiConstants.au3>
GUICreate("Warning", 200, 230, -1, -1, $WS_DLGFRAME, $WS_EX_TOPMOST)
GUISetBkColor(0xffff00)
GUISetFont(11, 690)
GUICtrlCreateIcon("C:\WINDOWS\system32\DSKQUOUI.DLL", 4, 10, 10)
$LABEL_1 = GUICtrlCreateLabel(" Remove", 10, 55, 180, 20)
GUICtrlSetBkColor(-1, 0xffffff)
$LABEL_2 = GUICtrlCreateLabel(" Example", 10, 85, 180, 20)
GUICtrlSetBkColor(-1, 0xffffff)
GUICtrlCreateLabel("Are you sure ?", 50, 120, 105, 20)
$YES = GUICtrlCreateButton("Yes", 10, 160, 80, 25)
$CANC = GUICtrlCreateButton("Cancel", 110, 160, 80, 25)
GUISetState()
While 1
    $MSG = GUIGetMsg()
    Select
        Case $MSG = $CANC
            Exit
        Case $MSG = $YES
            Exit
    EndSelect
WEnd
Edited by pecloe
Link to comment
Share on other sites

Unfortunatly none of the pic commands work with Animated .gifs.

However there are workarounds. Your msgbox will have to be made in a gui, and your .gif converted to .avi (in this example)

.Ani cursors will animate but I have had little luck with converting animated .gif to .Ani (AniTuner seems to do nothing but crash for animated .gif's I have used. Instead I use Avi4Bmp along with IrfanView to get the height and width information for use in Avi4Bmp.

1. get height and width of your animated .gif from the Image>information menu in Irfanview or similar program.

2. start Avi4Bmp and select your animated .gif and choose "save image", then choose .bmp(default)

3.In Avi4Bmp choose "convert back" and set the height and width to the info you got in irfranview or other program.

4.Set the number of frames, I usually skip the last frame as it is a black blank frame, in this case I used 3 out of 4 possible frames.

5.set your fps (frames per second), in this example for this 3 frame animation I chose 5fps but it is a little on the fast side(season to taste)

6.choose "convert back to .Avi" and choose a file name. It will prompt you if you have cut any frames (in this case 3 out of 4) that this image contains less frames than image can contain, Press yes to proceed anyway.

7. choose "Full Frames (uncompressed)" -this is the default

now use this .Avi in place of any .gif animation

see attached zip for demo code.

http://www.autoitscript.com/fileman/index.php?act=list&op=get&target=MsgDemo.zip

http://www.autoitscript.com/fileman/users/Coffee/screenshot.jpg

Edit: forgot to add extended @0x00000008 ($WS_EX_TOPMOST) MsgDemo.zip updated.

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