Jump to content
Sign in to follow this  

Warning Box with image

Recommended Posts

I need to create a "warning" window that displays a message, only has the OK button and also has an image at the top of the warning box. Does anyone have any examples of this or point me in the right direction??


Share this post

Link to post
Share on other sites

What sort of image? Or do you need a msgbox w/ image?

MsgBox(BitOR(262144,48),"Warning..Warning..",  "Danger Will Robinson")

Share this post

Link to post
Share on other sites

It is a gif image. It can be either a MsgBox or a GUI message box. I just cant figure out how to create an image embedded in a message box.

Share this post

Link to post
Share on other sites

an example using an icon

#include <GuiConstants.au3>
GUICreate("Warning", 200, 230, -1, -1, $WS_DLGFRAME, $WS_EX_TOPMOST)
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)
While 1
    $MSG = GUIGetMsg()
        Case $MSG = $CANC
        Case $MSG = $YES
Edited by pecloe

Share this post

Link to post
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.



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

Edited by Coffee

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...