AutoHotkey Community

It is currently May 27th, 2012, 8:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject:
PostPosted: November 14th, 2006, 1:32 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
If you remove ACS_TRANSPARENT from the window' styles, or just change its value to 0, the color set as 'transparent', the usual magenta, will just show in.
Eg., try putting hAVI := GuiAddAVI(guiID, 100, 50, 300, 130, 1006, "WIADefUI.dll") in place of the G.avi line, with the above change, you will see.
I can be wrong, but I guess that Windows just replace this particular color with the default GUI color, without real transparency.
...
OK, here is what MSDN says:
Quote:
ACS_TRANSPARENT
Allows you to match an animation's background color to that of the underlying window, creating a "transparent" background. The parent of the animation control must not have the WS_CLIPCHILDREN style (see Window Styles). The control sends a WM_CTLCOLORSTATIC message to its parent. Use SetBkColor to set the background color for the device context to an appropriate value. The control interprets the upper-left pixel of the first frame as the animation's default background color. It will remap all pixels with that color to the value you supplied in response to WM_CTLCOLORSTATIC.
What I understand: the background color is unique (no gradient/pattern/etc.) and the parent window have to manage this color (to handle the WM_CTLCOLORSTATIC message).
So currently, we can't change this color, because AutoHotkey already manages this message. Well, you can try to use OnMessage, if you want. Search the message name on the forum, I already experimented with it, it can be a starting point. I won't try this.

_________________
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, 1:51 pm 
truth, if i use hAVI := GuiAddAVI(guiID, 100, 50, 300, 130, 1006, "WIADefUI.dll") you get only magenta.

thats means we cant change it even if we wish :-)
thanks PhiLho again for the nice advice and the time you take.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2006, 3:24 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
http://www.autohotkey.com/forum/viewtopic.php?p=85913#85913 PhiLho wrote:
I don't know if there is a simple way to ask an AVI which size it is.

Here: AviFileInfo() .. :)

Edit:
The following is simpler .. Above post contains an elaborate version.
Code:
AviFileInfo(AviFile) {
VarSetCapacity( av, 108, 0 )                           ; av = AVIFILEINFO structure
DllCall( "avifil32.dll\AVIFileInit" )
DllCall( "avifil32.dll\AVIFileOpenA", Intp,hFile, Str,AVIFile , Int,0, Int,0 )
DllCall( "avifil32.dll\AVIFileInfoA", Int,hFile, Int,&av, Int,108 )
DllCall( "avifil32.dll\AVIFileRelease", Int,hFile )
wi := (*(&av+20))+(*(&av+21)<<8)+(*(&av+22)<<16)+(*(&av+23)<<32) ; dwWidth
he := (*(&av+24))+(*(&av+25)<<8)+(*(&av+26)<<16)+(*(&av+27)<<32) ; dwHeight
Return wi "x" he ; only the video size
}

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2007, 11:13 pm 
Offline

Joined: January 12th, 2006, 7:01 am
Posts: 69
Location: Dallas, Texas
I'm attempting to get this sample and CreateWindow_AVI.ahk script to work but I keep getting an error of: Call to nonexistant function on line 19. Here is the code sample that I'm trying to launch:
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) Line 19
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


The CreateWindow_AVI.ahk file is in the same subdirectory as this sample script. I thought I was following the example pretty well but obviously I'm missing something.

Any ideas?

Homer[/b]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2007, 11:27 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Your code works for me....You may want to check the contents of your include to make sure the function is there(and spelled the same)..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2008, 6:25 am 
i just don't get how it works and how to use it
i mean PhiLho's EASY version

Code:
Gui, Show, Center w320 h240
guiid := WinExist()
Result := AVI_CreateControl(guiid, 0, 0, 320, 240, "test.avi")
msgbox % Result

Result wrote:
Creation of 'test.avi' AVI failed: Cannot create AVI control (0/1406)


can anyone tell me what's wrong?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2008, 11:54 am 
Anonymous wrote:
i just don't get how it works and how to use it
i mean PhiLho's EASY version

Code:
Gui, Show, Center w320 h240
guiid := WinExist()
Result := AVI_CreateControl(guiid, 0, 0, 320, 240, "test.avi")
msgbox % Result

Result wrote:
Creation of 'test.avi' AVI failed: Cannot create AVI control (0/1406)


can anyone tell me what's wrong?

same here... I have tried to show a video.. but with the same result. Maby not all Formats in the avi Container are supportet...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 13th, 2008, 1:12 pm 
Code:
#Include Control_AVI.ahk
OnExit, CleanUpAndExit
Gui +LastFound
guiID := WinExist()
hAVIControl := AVI_CreateControl(guiID, 0, 0, 320, 240, A_ScriptDir . "\test.avi") ; needs full path to avi file
Gui, Show, Center w320 h240
Return

; Exit routine hotkeys (optional)
ESC::
; Exit routine
GuiClose:
CleanUpAndExit:
   AVI_DestroyControl(hAVIControl) ; optional, but better be safe than sorry
   ExitApp


Control_AVI.ahk


Report this post
Top
  
Reply with quote  
PostPosted: February 14th, 2010, 7:38 am 
daonlyfreez wrote:
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?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 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