AutoHotkey Community

It is currently May 27th, 2012, 9:43 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: October 24th, 2006, 5:04 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
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?

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2006, 6:13 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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...

_________________
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: October 24th, 2006, 6:33 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
PhiLho wrote:
I found out how to get the hInstance value...


Thanks! :D

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2006, 7:06 pm 
Hey :D

That works! It does... make sure the path to your avi is right


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2006, 7:11 pm 
It works for me:

Image

SysAnimate32 cannot do sound, so I guess this is the max, but nice! 8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2006, 8:37 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
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

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2006, 10:49 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
Wonderful scripts here around :)

I wonder what will come next! (video-cut?).

:)

Thalon

_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2006, 11:16 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Animated GIF ?!!

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2006, 2:39 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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. :-D

_________________
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: October 25th, 2006, 3:04 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
n-l-i-d wrote:
It works for me:

Image



Why does the Clock looks cropped? Clock.avi runs @ full size in my Divx Player!

:?:

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2006, 3:08 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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.

_________________
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: October 25th, 2006, 3:09 pm 
@Goyyah: That is because I didn't adapt the size of the control before testing.

Ah, PhiLho just answered...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2006, 3:12 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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!

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 25th, 2006, 4:14 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
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.

_________________
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: October 25th, 2006, 10:10 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
That for all the information! :D

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? :roll:

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


Report this post
Top
 Profile  
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: Bing [Bot] and 20 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