 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Nov 14, 2006 1:32 pm Post subject: |
|
|
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. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
Stefan16 Guest
|
Posted: Tue Nov 14, 2006 1:51 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5721
|
Posted: Thu Nov 23, 2006 3:24 pm Post subject: |
|
|
| 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
} |
_________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
Homer
Joined: 12 Jan 2006 Posts: 62 Location: Dallas, Texas
|
Posted: Wed Jan 03, 2007 11:13 pm Post subject: |
|
|
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] |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1149 Location: USA
|
Posted: Wed Jan 03, 2007 11:27 pm Post subject: |
|
|
| 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).. |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 13, 2008 6:25 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
sauerbraten Guest
|
Posted: Tue May 13, 2008 11:54 am Post subject: |
|
|
| 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... |
|
| Back to top |
|
 |
n-l-i-d Guest
|
Posted: Tue May 13, 2008 1:12 pm Post subject: |
|
|
| 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 |
|
| 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
|