AutoHotkey Community

It is currently May 27th, 2012, 9:52 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: November 10th, 2006, 11:55 pm 
i still do not know how to get my avi movie "intro.avi" to get it working all times on the gui... :-(

please help....


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2006, 12:11 am 
sorry, forgot to provide my script... :oops:

this is my script that i want to make all automatic on the push of a button (i would like to add more buttons for firefox etc.). example opera. i have now only a pic in the gui as you see "gui.jpg. i would like to put a small animated movie on the gui & remove this gui picture "gui.jpg" but how can this be done???

my script:

Gui, Add, Picture, x-4 y10 w770 h490, C:\gui.jpg
Gui, Add, Button, x526 y420 w200 h30, START_OPERA
Gui, Show, x15 y21 h494 w759,

START_OPERA:
Run, C:\Programme\Opera\Opera.exe
Return

ButtonEXIT:
GuiClose:
ExitApp


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2006, 5:16 pm 
No one seems to know about :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2006, 9:46 pm 
Just for curiosity I would like to know it also. Thanks Steve.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 4:35 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
I have isolated the functionality in three functions. You have now just to #Include CreateWindow_AVI.ahk in your script, follow the example given at the end (you can remove it!) and you are done.
One test use the G.avi file, one I made out of some test PNG images...

Of course, you have to make some work yourself: find the size of the AVI and create the control to this size (or greater). Unlike other controls, the GUI won't resize itself to accommodate this new control...

I must admit it wasn't so obvious to wrap this up, I fall in various traps.
I wanted to pass the options in one string, parsing it with regex, but I think I found a bug. At least, it didn't worked.

Quote:
// File/Project history:
1.02.000 -- 2007/05/25 (PL) -- Improved encapsulation.
1.01.000 -- 2007/05/16 (PL) -- Changed API for consistency with CreateWindow_AniGif.
1.00.000 -- 2006/11/13 (PL) -- Creation.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Last edited by PhiLho on May 28th, 2007, 11:01 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 5:59 pm 
WOW PhiLho :o a great demo!!! thanks for your time!!!! your script work here...

ok, so now i have put it in my script like that and downloaded your small avi, just testing if i see the avi..but i think there is something wrong.. :roll:

Code:
Gui, Add, Picture, x-4 y10 w770 h490, C:\gui.jpg
Gui, Add, Button, x526 y420 w200 h30, START_OPERA
Gui, Show, x15 y21 h494 w759,

START_OPERA:
Run, C:\Programme\Opera\Opera.exe
Return

Gui +LastFound
guiID := WinExist()

width := 300

h1 := GuiAddAVI(guiID, 10, 10, width, 130, 165)
If h1 is not integer
   MsgBox %h1%
Gui Add, Button, x10 y150 w50 v11 gCreateWindow_AVI_Control, Start
Gui Add, Button, x70 y150 w50 v01 gCreateWindow_AVI_Control, Stop

h2 := GuiAddAVI(guiID, 350, 10, width, 130, 1006, "WIADefUI.dll")
If h2 is not integer
   MsgBox %h2%
Gui Add, Button, x350 y150 w50 v12 gCreateWindow_AVI_Control, Start
Gui Add, Button, x420 y150 w50 v02 gCreateWindow_AVI_Control, Stop

;~ h3 := GuiAddAVI(guiID, 650, 10, width, 130, A_WinDir . "\Clock.avi")
;~ h3 := GuiAddAVI(guiID, 650, 10, width, 130, A_ScriptDir . "\CtrlAltDel.avi")
h3 := GuiAddAVI(guiID, 650, 10, width, 130, A_ScriptDir . "\G.avi")
If h3 is not integer
   MsgBox %h3%
Gui Add, Button, x650 y150 w50 v13 gCreateWindow_AVI_Control, Start
Gui Add, Button, x720 y150 w50 v03 gCreateWindow_AVI_Control, Stop

Gui Add, Button, x10 y200 w50 gCreateWindow_AVI_Exit, End

Gui Show, w960, AVI Demo
Return

CreateWindow_AVI_Control:
   StringLeft action, A_GuiControl, 1
   StringRight control, A_GuiControl, 1
   If (action = 1)
      GuiControlStartAVI(h%control%)
   Else If (action = 0)
      GuiControlStopAVI(h%control%)
Return

CreateWindow_AVI_Exit:
   ExitApp

}


ButtonEXIT:
GuiClose:
ExitApp


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 6:32 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
If that's all your code:
1) Remove the trailing closing brace.
2) Remember to #Include my file! At start of your code, to be sure the global vars are set.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 7:10 pm 
OK... I give up. :? anthing i do, i get only error.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 7:19 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Actually, I didn't noticed, but it couldn't work at all, indeed... Wrong order of instructions, among other problems.
Code:
#Include CreateWindow_AVI.ahk

Gui +LastFound
guiID := WinExist()

Gui, Add, Picture, x-4 y10 w770 h490, Dots.bmp

hAVI := GuiAddAVI(guiID, 100, 50, 100, 100, A_ScriptDir . "\G.avi")
If hAVI is not integer
   MsgBox %h1%

Gui, Add, Button, x526 y420 w200 h30 gSTART_OPERA, Start Opera
Gui, Show, x15 y21 h494 w759
Return

START_OPERA:
Run, C:\Programme\Opera\Opera.exe
Return

ButtonEXIT:
GuiClose:
ExitApp
BTW, you can have Dots.bmp, it shows how to make a nice gradient background with only two pixels...

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 7:34 pm 
:oops: PhiLho it WORKS!!!!

now i have understand it...the "CreateWindow_AVI.ahk" must be presented in the same directory, am i right????

and with your script, it works PERFEKT!!!!

THANK YOU SO MUCH!!! THANK YOU!

:) :) :)

is this code only for winxp??? and why must the "CreateWindow_AVI.ahk" be presented??..is it like a dll??


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2006, 10:47 pm 
Offline

Joined: May 19th, 2006, 4:56 am
Posts: 166
How can I add this functionality to an existing script? I have a script that searches a folder for a PDF file. The user inputs a filename, and it searches predefined folders for all versions of that file. I have a simple text box that pops up that says "Searching". It would be nice ot have the flashlight AVI popup.

How can I do this?

_________________
Zak M.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2006, 4:54 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Dear PhiLho, :) : Many thanks for the easy to use wrapper. :D

Zak. M wrote:
How can I add this functionality to an existing script?


Maybe you can use this as an example:

Code:
#Include CreateWindow_AVI.ahk

Gui +LastFound
guiID := WinExist()
Gui, Font, S10, Verdana
Gui, Add, Edit, x10 y10 Limit30 w300 h20 vSearchFileName, Readme.txt
Gui, Add, Button, x+5 y10 w75 h20 gSearch vB1 , Search
Gui, Add, Button, x+5 y10 w75 h20 +Disabled gCancel vB2 , Cancel
Gui, Add, StatusBar,,
Gui, Show, h75,File Search
Return

Search:
StopSearch=0
Gui, Submit, NoHide
GuiControl, Hide, B1
GuiControl, -Disabled, B2
FileDelete, FL.txt
hAVI := GuiAddAVI(guiID, 310, 5, 80, 40, 150)
Loop, C:\%SearchFileName%, 0, 1
 {
IfEqual, StopSearch,1, Break
SplitPath, A_LoopFileLongPath, OutFileName, OutDir
SB_SetText(A_Space OutDir)
IfEqual, A_LoopFileName, %SearchFileName%
    FileAppend, %A_LoopFileLongPath%`n, FL.txt
 }
GuiControlDestroyAVI(hAVI)
GuiControl, Show, B1
IfExist, FL.txt, Run, FL.txt
GuiControl, +Disabled, B2
SB_SetText("Done!")
Return

Cancel:
StopSearch=1
Return

GuiClose:
 ExitApp


:)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2006, 11:07 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
Excellent example!
And you even found an use for my GuiControlDestroyAVI function...
On my system, the search loop ran "too" fast, the animation was slow to show up and to move...

Stefan16, I haven't tested it yet on Win98, but basically it should work there too, and on Win2k too (Goyyah's default system).
The list of DLLs and AVIs in them can change from one system to the other, of course.

CreateWindow_AVI.ahk is not "like a dll", but it is a wrapper around system's DLLs, that's why it is needed. It hides the gory details of the WinAPI...

Chris wrote:
if anyone would like to package this up into something more succinct and easy-to-use (assuming that's feasible), I could include it as an example on the GuiControls page.
Feel free to do so. I routinely put a zlib/libpng licence in the header of the major scripts I write, but you can drop it (probably making it more or less public domain) if you want to include it in the doc.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2006, 11:36 am 
PhiLho, first thank you for all this again. allone i would not get anything to work.
only one question, where can i cahnge the bakround for the avi. i would like to make it black. how to change the position i have found :-) but not the backround cocolr for the avi.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2006, 12:06 pm 
i menas the avi backround is now transparent and i would like to get it black. so if i look in CreateWindow_AVI.ahk i found:

; WinAPI constants
WS_CHILD := 0x40000000
WS_VISIBLE := 0x10000000
GWL_HINSTANCE := -6
WM_USER := 0x400

ACS_AUTOPLAY := 0x0004
ACS_TRANSPARENT := 0x0002
ACS_CENTER := 0x0001
ACM_OPEN := WM_USER + 100
ACM_PLAY := WM_USER + 101
ACM_STOP := WM_USER + 102

so i think i need to change ACS_TRANSPARENT := 0x0002 to something else?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: sks, Yahoo [Bot] and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group