Sign in to follow this  
Followers 0
lordicast

Problem with Controls

1 post in this topic

Im having a problem pressing a button and having a simple msgbox popup, easy enough but im making a program that lets me use cmd to telnet and watch movies at the same time i think the problem is in the handling of controls somthing is intercepting the box heres some code its ripped from everywhere works perfect for me except when i go to the IPs tab and click Set IP 1 it doesnt do anything no pop nothing check out the messy code

#include <GUIConstants.au3>
#include <wmp.au3>
#Include <GuiComboBoxEx.au3>
Opt("GUIOnEventMode", 1)
HotKeySet("{f1}","pop1")


$destination = @ScriptDir & "\gui.jpg"

SplashImageOn("Splash Screen", $destination,500,400,-1,-1,1)
Sleep(3000)
SplashOff()
Global $Init_Dir = "C:\"
#Region ### START Koda GUI section ### Form=
$Main_GUI = GUICreate("Telnet Commands", @DesktopWidth, @DesktopHeight)
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")
GUIRegisterMsg(0xF, "WM_PAINT")

$movie = ""
$wmp = ""
$iCmd_PID = Run(@ComSpec & " /k CD " & $Init_Dir, "", @SW_HIDE)
ProcessWait($iCmd_PID)



$Embed_hWnd = _GetHWndByPID($iCmd_PID)
WinMove($Embed_hWnd, "", 16, -23, 666, 420)
WinSetState($Embed_hWnd, "", @SW_SHOWMINIMIZED)

$goto = ""
$togo = _GUICtrlComboBoxEx_Create($Main_GUI,$goto,700,380,200,300)
$goto = _GUICtrlComboBoxEx_AddDir ($togo,"C:\tvtv\" & "\*.avi")
$sendmedia = GUICtrlCreateButton("Watch",920,380,80,20)
$togo1 = "C:\tvtv\"&GUICtrlRead($togo)
$wmp = _wmpcreate(1, 700, 8, 575 ,425);creates object
_wmpvalue( $wmp, "controls" );hides controls
_wmploadmedia( $wmp,$togo1)
;loads media
;_wmpsetvalue( $wmp, "controls" );shows controls


$PageControl1 = GUICtrlCreateTab(16, 400, @DesktopWidth -36, 350)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

$TabSheet1 = GUICtrlCreateTabItem("COMMANDs")



$TabSheet2 = GUICtrlCreateTabItem("PINGs")
$inip1 = ""
$buttonip1 = GUICtrlCreateButton("IP1",20,440,80,20)
$ip1set = GUICtrlCreateButton("Set IP 1",20,466,80,20) 
$listip1 = GUICtrlCreateLabel($inip1, 106, 440, 70, 17)

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW)

DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $Embed_hWnd, "hwnd", $Main_GUI)
WinSetState($Main_GUI, '', @SW_SHOW)

#EndRegion ### END Koda GUI section ###
While _wmpvalue($wmp,"getduration") = 0
    Sleep(1)
WEnd


While 1
    $Msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $ip1set
            pop1()
        Case $msg = $sendmedia
            MsgBox(0,"dddd","ddd")
            _wmploadmedia( $wmp,$togo1)
EndSelect
WEnd
Func pop1()
            $inip1 = InputBox("Set Ip","Which Ip to What?")
            GUICtrlSetData($listip1,$inip1)
        endfunc
Func Quit()
    ProcessClose($iCmd_PID)
    Exit
EndFunc

Func _GetHWndByPID($iPID)
    Local $aWinList = WinList()
    
    For $i = 1 To UBound($aWinList)-1
        If WinGetProcess($aWinList[$i][1]) = $iPID Then Return $aWinList[$i][1]
    Next
    
    Return 0
EndFunc

Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0)
EndFunc

Func change()
    _wmpvalue($wmp,"setposition",GUICtrlRead($slider))
EndFunc

[Cheeky]Comment[/Cheeky]

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