 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
daonlyfreez
Joined: 16 Mar 2005 Posts: 745 Location: Berlin
|
Posted: Tue Oct 24, 2006 5:04 pm Post subject: |
|
|
Thanks again PhiLho, updated code.
Edit: | Quote: | | Pointer to a buffer that contains the path of the AVI file |
Could you show me how to do this? Load an AVI file instead? _________________ (sorry, homesite offline atm) |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Oct 24, 2006 6:13 pm Post subject: |
|
|
| daonlyfreez wrote: | | Could you show me how to do this? Load an AVI file instead? | I try, but I can't get it work. I don't know if it is because I don't have right AVI file format, right system or right code...
Googling for ACM_OPEN SysAnimate32 gives a surprisingly low number of hits. I saw some implementations for various Basics, but I can't get them to work.
I added 000 - File to the list, and changed the code as follow:
| Code: | GuiAddResAni(mainGuiHandle, aniInstance, aniNr, posx, posy, posw, posh)
{
global aniCtlHandle, ACM_PLAY, ACM_STOP
WS_CHILD = 0x40000000
WS_VISIBLE = 0x10000000
ACS_AUTOPLAY = 0x0004
ACS_TRANSPARENT = 0x0002
ACS_CENTER = 0x0001
ACM_OPEN := 0x400 + 100
ACM_PLAY := 0x400 + 101
ACM_STOP := 0x400 + 102
GWL_HINSTANCE := -6
hInstance := DllCall("GetWindowLong"
, "UInt", mainGuiHandle
, "Int", GWL_HINSTANCE)
aniCtlHandle := DLLCall("CreateWindowEx"
, uint, 0 ; Style
, str, "SysAnimate32" ; Class Name
, uint, 0 ; Window name
, uint, WS_CHILD|WS_VISIBLE|ACS_TRANSPARENT|ACS_CENTER|ACS_AUTOPLAY ; window style
, int, posx ; Left
, int, posy ; Top
, int, posw ; Right
, int, posh ; Bottom
, uint, mainGuiHandle ; Handle of parent
, int, 0 ; Menu
, uint, hInstance ; hInstance
, uint, 0) ; User defined style
; http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/animation/messages/acm_open.asp
; wParam: Instance handle to the module from which the resource should be loaded.
; Note that if the window is created by a DLL, the default value for hinst is the HINSTANCE value of the DLL, not of the application that calls the DLL.
; lParam: Pointer to a buffer that contains the path of the AVI file or the name of an AVI resource.
; Alternatively, this parameter can consist of the AVI resource identifier in the low-order word and zero in the high-order word.
If (aniNr != 0)
{
PostMessage, %ACM_OPEN%, %aniInstance%, %aniNr%, , ahk_id %aniCtlHandle%
}
Else
{
avi := A_WinDir . "\clock.avi"
avi := A_ScriptDir . "\torch.avi"
r := DllCall("SendMessageA"
, "UInt", aniCtlHandle
, "UInt", ACM_OPEN
, "UInt", 0
, "UInt", &avi)
MsgBox (%ErrorLevel%) %r% %avi%
}
}
| but r is always 0. Also tried SendMessageW, of course, hence the DllCall.
If you can get something out of that...
Oh, BTW, I found out how to get the hInstance value... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Tue Oct 24, 2006 6:33 pm Post subject: |
|
|
| PhiLho wrote: | | I found out how to get the hInstance value... |
Thanks!  _________________
 |
|
| Back to top |
|
 |
not-logged-in-youknowwho Guest
|
Posted: Tue Oct 24, 2006 7:06 pm Post subject: |
|
|
Hey
That works! It does... make sure the path to your avi is right |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Tue Oct 24, 2006 7:11 pm Post subject: |
|
|
It works for me:
SysAnimate32 cannot do sound, so I guess this is the max, but nice!  |
|
| Back to top |
|
 |
daonlyfreez
Joined: 16 Mar 2005 Posts: 745 Location: Berlin
|
Posted: Tue Oct 24, 2006 8:37 pm Post subject: |
|
|
I found some more AVI resources (on my XP SP2, you might have them too)
msgina.dll
2413 - Control + Alt + Delete
syncui.dll
133 - Sync
134 - Compare
wiadefui.dll
1000 - Camera connect
1001 - Scanner connect
1002 - Camcorder connect
1003 - Camcorder copy
1004 - Scanner copy
1005 - Camera copy
1006 - Camera and scanner connect
xpsp2.dll
140 - Search flashlight
160 - Network connect _________________ (sorry, homesite offline atm) |
|
| Back to top |
|
 |
Thalon
Joined: 12 Jul 2005 Posts: 640
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Wed Oct 25, 2006 11:16 am Post subject: |
|
|
Animated GIF ?!! _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Oct 25, 2006 2:39 pm Post subject: |
|
|
Hey, it works with clock.avi!
At some point, it didn't worked, I probably hacked more the code and tested with other AVI files, but didn't tested the latest version with clock.avi...
I guess that the other test files have some sound in it, since the control rejects them.
Curiously, two of them was made by a trial shareware that transforms animated Gifs to AVI. But perhaps it creates an AVI with a silent sound track... It isn't a very good program anyway.
Do you know where we can find some other AVI files that would work with this component? Or how to generate them properly? When searching for AVI on Google, I find mostly methods to rip DVDs...
Anyway, I am happy I gave my work in progress, I knew it was useful.  _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Wed Oct 25, 2006 3:04 pm Post subject: |
|
|
| n-l-i-d wrote: | It works for me:
|
Why does the Clock looks cropped? Clock.avi runs @ full size in my Divx Player!
 _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Oct 25, 2006 3:08 pm Post subject: |
|
|
| Code: | ; Add control
posx = 220
posy = 60
posw = 300
posh = 80
| Should be adjusted to real size. I suppose daonlyfreez used the max of the sizes he found in shell32.dll. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
not-logged-in-daonlyfreez Guest
|
Posted: Wed Oct 25, 2006 3:09 pm Post subject: |
|
|
@Goyyah: That is because I didn't adapt the size of the control before testing.
Ah, PhiLho just answered... |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Wed Oct 25, 2006 3:12 pm Post subject: |
|
|
Thanks for the clarification PhiLho / daonlyfreez!
I was under wrong impression that the control would act like a picture!
Edit: A picture control resizes the image to fit instead of cropping! _________________
 |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Oct 25, 2006 4:14 pm Post subject: |
|
|
Goyyah, controls managed by AutoHotkey auto-size (and auto-place) because Chris coded them like that... He wrote wrappers around crude WinAPI functions, to help their use and avoid lot of sweat.
He did a fine job, he has a very good GUI system, that I like to use.
Now, here we are dealing with these crude WinAPI calls, no wrapper, so we must sweat to get them fine...
I don't know if there is a simple way to ask an AVI which size it is. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Wed Oct 25, 2006 10:10 pm Post subject: |
|
|
That for all the information!
| PhiLho wrote: | | I don't know if there is a simple way to ask an AVI which size it is. |
What would be the hard way? Read the file header with Binary routines?  _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|