Sign in to follow this  
Followers 0
Trystian

Context menu on Taskbar (Minimize,Maximize,Close, etc.)

4 posts in this topic

Greetings everyone.

I've got a problem with my compiled script not showing the normal context menu when you right-click on the programs' tab in the taskbar. My other compiled scripts give me the usual options (Restore, Move, Size, Minimize, Maximize, and Close), yet this one doesn't. I know it's an obvious solution, but I can't seem to find it.

Any help would be greatly appreciated.

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

Dim $SourceFile,$VLCEXEC,$sSourceFile,$sVCodec,$sVBitrate,$sACodec,$sAChannels,$sABitRate,$sSAPInput,$sURL

$VLCEXEC = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\VideoLAN\VLC","")
if @error <> 0 Then
    msgbox(1024,"Error","VideoLan (VLC) not installed")
EndIf

$Form1 = GUICreate("TrystianSoft - VideoLan Stream Launcher", 580, 300, -1, -1, $WS_MINIMIZEBOX, $WS_EX_ACCEPTFILES)
GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")

GUICtrlCreatePic(@ScriptDir & "\VideoLanHeader.jpg", 0, 0, 574, 22)
GUICtrlCreateLabel("Codec", 16, 64, 35, 17)
GUICtrlCreateLabel("BitRate", 120, 64, 39, 17)
GUICtrlCreateLabel("Codec", 296, 64, 35, 17)
GUICtrlCreateLabel("Channels", 488, 64, 48, 17)
GUICtrlCreateLabel("BitRate", 400, 64, 39, 17)

if $CmdLine[0] = 1 Then
    $sSourceFile = $CmdLine[1]
EndIf

    $SourceFile = GUICtrlCreateInput($sSourceFile, 8, 24, 441, 21)
    GUICtrlSetState($SourceFile,$GUI_DROPACCEPTED)
    $SourceBrowse = GUICtrlCreateButton("Browse...", 456, 24, 113, 25, 0)
    GUICtrlSetOnEvent(-1, "fcnSourceBrowse")

$Group1 = GUICtrlCreateGroup("Video Options", 8, 48, 281, 65)
    $VCodec = GUICtrlCreateCombo("", 16, 80, 97, 25)
    GUICtrlSetData ( $VCodec, " |WMV1|WMV2|DIV3|DIV2|DIV1|mp1v|mp2v|mp4v|H263|h264|MJPG|", " " )
    $VBitRate = GUICtrlCreateCombo("", 120, 80, 81, 25)
    GUICtrlSetData ( $VBitRate, "16|32|64|128|256|512|1024|2048|3072|4096", "2048" )

$Group2 = GUICtrlCreateGroup("Audio Options", 288, 48, 281, 65)
    $ACodec = GUICtrlCreateCombo("", 296, 80, 97, 25)
    GUICtrlSetData ( $ACodec, " |mpga|mp2a|mp3|mp4a|a52|vorb|flac|spx|fl32", "mp3" )
    $ABitRate = GUICtrlCreateCombo("", 400, 80, 81, 25)
    GUICtrlSetData ( $ABitRate, "16|32|64|96|128|192|256|512", "192" )
    $AChannels = GUICtrlCreateCombo("", 488, 80, 65, 25)
    GUICtrlSetData ( $AChannels, "1|2|4|6", "2" )

$Group3 = GUICtrlCreateGroup("SAP Announce", 8, 120, 561, 49)
    $SAPInput = GUICtrlCreateInput("LanTV (" & @ComputerName & ")", 16, 136, 545, 21)

$Group4 = GUICtrlCreateGroup("URL", 8, 175, 561, 49)
    $URL = GUICtrlCreateInput("239.255.1.1:1234", 16, 191, 545, 21)

$LaunchVLCClient = GUICtrlCreateButton("Launch Client", 100, 230, 153, 25, 0)
GUICtrlSetOnEvent(-1, "fcnLaunchClient")

$LaunchVLCServer = GUICtrlCreateButton("Launch Server", 320, 230, 153, 25, 0)
GUICtrlSetOnEvent(-1, "fcnLaunchServer")

GUISetState(@SW_SHOW)

While 1
    Sleep(100)
WEnd

Func fcnSourceBrowse()

    $strFilename = FileOpenDialog("Select File","","Videos (*.avi;*.mp?g;*.r?m;*.rmvb)", 1+2)
    GUICTRLSetData($SourceFile, $strFilename)

EndFunc

Func fcnReadControls()
    $sSourceFile = GUICtrlRead($SourceFile)
    $sVCodec = GUICtrlRead($VCodec)
    $sVBitRate = GUICtrlRead($VBitRate)
    $sACodec = GUICtrlRead($ACodec)
    $sABitRate = GUICtrlRead($ABitRate)
    $sAChannels = GUICtrlRead($AChannels)
    $sSAPInput = GUICtrlRead($SAPInput)
    $sURL = GUICtrlRead($URL)

EndFunc

Func fcnLaunchClient()

    fcnReadControls()

    Run($VLCEXEC & " -vvv udp:@" & $sURL)

EndFunc

Func fcnLaunchServer()

    fcnReadControls()

    Dim $sVid

    If StringStripWS($sVCodec,7) <> "" Then
        $sVid = "transcode{vcodec=" & $sVCodec & ",vb=" & $sVBitRate & ",scale=1,acodec=" & $sACodec & ",ab=" & $sABitRate & ",channels=" & $sAChannels & "}:"
    EndIf

    $sL = "-vvv """ & $sSourceFile & """ --sout ""#" & $sVid & "duplicate{dst=std{access=udp,mux=ts,dst=" & $sURL & ",sap,name='" & $sSAPInput & "'}}"" --ttl 1"

    Run($VLCEXEC & " " & $sL)

EndFunc

Func AForm1Close()
    Exit 0
EndFunc

Func AForm1Minimize()

EndFunc

Func AForm1Restore()

EndFunc

This code is still under heavy construction. All it currently does is launch VideoLan in Client or Server mode using a UDP stream (with server options). It won't work unless VideoLan (VLC) is installed.

Share this post


Link to post
Share on other sites



Hi,

I think it depends on this line

$Form1 = GUICreate("TrystianSoft - VideoLan Stream Launcher", 580, 300, -1, -1)

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Just as I thought, right in front of my eyes. I'm still a bit new at creating AutoIT Gui's.

This is the solution:

$Form1 = GUICreate("TrystianSoft - VideoLan Stream Launcher", 580, 300, -1, -1, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_SYSMENU), $WS_EX_ACCEPTFILES)

Vielen Dank th.meger! :)

-Trystian

Edited by TrystianSky

Share this post


Link to post
Share on other sites

Hi,

no problem!

Gern geschehen! :)

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0