Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/09/2013 in all areas

  1. Werty

    Au3Irrlicht 2.0

    Here's a work-around for getting the IrrLicht render window inside Autoit GUI. #include "./Bin/au3Irrlicht2.au3" #include "WinAPI.au3" #include <Misc.au3> $Gui = GUICreate("AutoIt Window", 1280, 785, -1, -1) HotKeySet("{ESC}", "_exit") ;Embed Irrlicht RenderWindow--------------------------------------------------------------------------------------- _IrrStart($IRR_EDT_opengl, 1024, 768, $IRR_BITS_PER_PIXEL_32, $IRR_windowed, $IRR_SHADOWS, $IRR_capture_EVENTS, $IRR_VERTICAL_SYNC_Off) _IrrSetWindowCaption( "IrrLicht Window") _WinAPI_SetWindowRgn(WinGetHandle("IrrLicht Window", ""), _WinAPI_CreateRectRgn(3, 22, 1024, 768)) ; Cut off IrrLicht Window Border WinMove("IrrLicht Window", "", -3, -22) ; It wants to be moved before set as child for some reason, not vice versa. _WinAPI_Setparent(WinGetHandle("IrrLicht Window", ""), $Gui); Set as child for autoit window WinActivate("AutoIt Window") GUISetState() ;-------------------------------------------------------------------------------------------------------------------- ;add your IrrLicht stuff here..... WHILE _IrrRunning() ;Click and Hold right mouse button in Irrlicht window to move or whatever, control Autoit Window without holding button, ; you can refine this with adding coords, so it only moves when mouse is inside the window If _IsPressed("02") AND WinActive($Renderwindow) Then ;_Movement() ; your movement or whatever goes here EndIf _IrrBeginScene(128,128,128) ;.......and here _IrrDrawScene() _IrrEndScene() Sleep(5) WEND Func _exit() _IrrStop() Exit EndFunc ; _exit
    1 point
  2. Could it not be as simple as Execute? #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> #include <EditConstants.au3> #include <WinAPI.au3> #include <Debug.au3> #include <String.au3> #include <NetShare.au3> #include <Array.au3> #include <EditConstants.au3> #Include <Misc.au3> #include <array.au3> #include <GuiStatusBar.au3> #include <GuiButton.au3> #include <File.au3> #include <Array.au3> #include <Inet.au3> #include <GuiStatusBar.au3> #include <Timers.au3> #include <ProgressConstants.au3> #include <GuiMenu.au3> Opt("GUIOnEventMode",1) ;OnEvent Modus für GUIs' , die dem User als Tool dienen. Opt("TrayIconHide", 0) ;0 Zeigt TrayIcon des Programms, 1 versteck TrayIcon Opt("GUICloseOnESC",1) ;Schließt das Programm beim Drücken der ESC Taste ;~ Opt("SendCapslockMode", 0) ;******************SOLUTION MENÜ************************************* $main_gui = GUICreate("EDV",281, 300, 500,200) ;***************S T E U E R E L E M E N T E******** GUISetOnEvent($GUI_EVENT_CLOSE, "close_main_gui") ;$text = 'Guictrlcreatebutton("Test",10,90,50,50)' $text = FileRead(@ScriptDir & "\code.txt") Execute($text) WinSetTrans($main_gui,"",220) GUISetBkColor(0xFFFFFF) GUISwitch($main_gui) GUISetState(@SW_SHOW) While 1 Sleep(0) WEnd Func close_main_gui() Exit EndFunc
    1 point
  3. AndroidZero, You cannot do what you want directly. You will have to do one of 2 things: - 1. Create a new file and run it: ; Define initial lines $sStart_Lines = '#include <GUIConstantsEx.au3>' & @CRLF & _ 'Opt("GUIOnEventMode", 1)' & @CRLF & _ '$main_gui = GUICreate("EDV", 281, 300, 500, 200)' & @CRLF & _ 'GUISetOnEvent($GUI_EVENT_CLOSE, "close_main_gui")' & @CRLF ; Read in new lines $sAdded_lines = FileRead(@ScriptDir & "\code.txt") & @CRLF ; Define ending lines $sEnding_Lines = 'WinSetTrans($main_gui, "", 220)' & @CRLF & _ 'GUISetBkColor(0xFFFFFF)' & @CRLF & _ 'GUISwitch($main_gui)' & @CRLF & _ 'GUISetState(@SW_SHOW)' & @CRLF & _ 'While 1' & @CRLF & _ @TAB & 'Sleep(10)' & @CRLF & _ 'WEnd' & @CRLF & _ 'Func close_main_gui()' & @CRLF & _ @TAB & 'Exit' & @CRLF & _ 'EndFunc ;==>close_main_gui' ; Create file to run Global $sRun_File = @ScriptDir & "\Runit.au3" If FileExists($sRun_File) Then FileDelete($sRun_File) EndIf FileWrite($sRun_File, $sStart_Lines & $sAdded_lines & $sEnding_Lines) ; And then run it Run('AutoIt3.exe /AutoIt3ExecuteScript "' & $sRun_File & '"') - 2. Write code to parse the line you read in and write the code directly: #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $main_gui = GUICreate("EDV", 281, 300, 500, 200) GUISetOnEvent($GUI_EVENT_CLOSE, "close_main_gui") ; Read in new line $sAdded_lines = FileRead(@ScriptDir & "\code.txt") ; Parse the line $aSplit_1 = StringSplit($sAdded_lines, "(") ; Confirm type of command If $aSplit_1[1] = "GUICtrlCreateButton" Then ; Parse the parameters $aSplit_2 = StringSplit($aSplit_1[2], ",") ; Create the control GUICtrlCreateButton($aSplit_2[1], Number($aSplit_2[2]), Number($aSplit_2[3]), Number($aSplit_2[4]), Number($aSplit_2[5])) EndIf WinSetTrans($main_gui, "", 220) GUISetBkColor(0xFFFFFF) GUISwitch($main_gui) GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func close_main_gui() Exit EndFunc I would strongly recommend using the first of those techniques as the parsing of commands will rapidly become a unmanageable task - imagine having to do it for each AutoIt command listed in the Help file! Please ask if anything is unclear. M23
    1 point
  4. jmon, Take a look at my Scrollbars UDF (the link is in my sig). GUI_Scrollbars_Size Example 2 shows how to do what you require. M23
    1 point
  5. using latest Bass-UDF and lastest AutoIt Beta (v3.3.9.22): #AutoIt3Wrapper_Autoit3Dir=c:\Program Files (x86)\AutoIt3\Beta #AutoIt3Wrapper_UseX64=n #include "Bass.au3" #include "BassExt.au3" #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $sFile = FileOpenDialog("Open...", "..\audiofiles", "playable formats (*.MP3;*.MP2;*.MP1;*.OGG;*.WAV;*.AIFF;*.AIF)") If @error Or Not FileExists($sFile) Then Exit Global $iWidth = 522 Global $iHeight = 170 Global $hGui = GUICreate("FFT", $iWidth, $iHeight, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP)) GUISetOnEvent($GUI_EVENT_CLOSE, "_EXIT") _GDIPlus_Startup() Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) Global $hBmp_Buffer = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Global $hGfx_Buffer = _GDIPlus_ImageGetGraphicsContext($hBmp_Buffer) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Buffer, 2) Global $hBrush = _CreateFFTBrush(5, 5, $iWidth - 10, $iHeight - 10) GUIRegisterMsg($WM_PAINT, "WM_PAINT") GUISetState() _BASS_Startup() _BASS_EXT_Startup() _BASS_Init(0, -1, 44100, 0, "") Global $hStream = _BASS_StreamCreateFile(False, $sFile, 0, 0, $BASS_SAMPLE_FLOAT) Global $aFFT = _BASS_EXT_CreateFFT(128, 5, 5, $iWidth - 10, $iHeight - 10, 1, True) _BASS_ChannelPlay($hStream, True) Global $iTimer = TimerInit() While _BASS_ChannelIsActive($hStream) If TimerDiff($iTimer) > 20 Then $iTimer = TimerInit() _GDIPlus_GraphicsClear($hGfx_Buffer, 0xFF110022) _BASS_EXT_ChannelGetFFT($hStream, $aFFT, 2) If Not @error Then DllCall($ghGDIPDll, "int", "GdipFillPolygon", "handle", $hGfx_Buffer, "handle", $hBrush, "ptr", $aFFT[0], "int", $aFFT[1], "int", "FillModeAlternate") _GDIPlus_GraphicsDrawImage($hGraphics, $hBmp_Buffer, 0, 0) EndIf WEnd _Exit() Func _CreateFFTBrush($iX, $iY, $iWidth, $iHeight) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $hBrush_FFT = _GDIPlus_LineBrushCreate(0, 0, 0, $iHeight, 0, 0, 3) Local $aColors[5][2] = [[4]] $aColors[1][0] = 0xFFFF0000 $aColors[1][1] = 0 $aColors[2][0] = 0xFFFFAA00 $aColors[2][1] = 0.25 $aColors[3][0] = 0xFF00AAFF $aColors[3][1] = 0.5 $aColors[4][0] = 0xFF00AAFF $aColors[4][1] = 1 _GDIPlus_LineBrushSetPresetBlend($hBrush_FFT, $aColors) Local $hBrush_LED = _GDIPlus_LineBrushCreate(0, 0, 0, 4, 0xAA000000, 0x00000000, 0) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush_FFT) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush_LED) _GDIPlus_BrushDispose($hBrush_LED) _GDIPlus_BrushDispose($hBrush_FFT) _GDIPlus_GraphicsDispose($hContext) Local $hBrush = _GDIPlus_TextureCreate($hBitmap) _GDIPlus_BitmapDispose($hBitmap) DllCall($ghGDIPDll, "uint", "GdipTranslateTextureTransform", "hwnd", $hBrush, "float", $iX, "float", $iY, "int", 0) Return $hBrush EndFunc ;==>_CreateFFTBrush Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmp_Buffer, 0, 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_PAINT Func _Exit() _BASS_StreamFree($hStream) _BASS_Free() _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx_Buffer) _GDIPlus_BitmapDispose($hBmp_Buffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() Exit EndFunc ;==>_Exit
    1 point
  6. guinness

    SciLexer UDF

    It's because the ANSI version of SendMessage is being used not SendMessageW.
    1 point
  7. UEZ

    RDP Session In AutoIT Gui

    Try this uncomplete version: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $host = "" ;<<<<<<< enter here the host name or ip address ;Remote Desktop ActiveX Control Interfaces -> http://msdn.microsoft.com/en-us/library/aa383022(v=VS.85).aspx $hGUI = GUICreate("RDP Embedded Sessions", 952, 675, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $oRDP = ObjCreate("MsTscAx.MsTscAx.2") ;http://msdn.microsoft.com/en-us/library/aa381344(v=VS.85).aspx $oRDP_Ctrl = GUICtrlCreateObj($oRDP, 64, 44, 800, 600) GUICtrlSetResizing(-1, $GUI_DOCKALL) GUICtrlSetStyle($oRDP_Ctrl , $WS_VISIBLE) $oRDP.DesktopWidth = 800 $oRDP.DesktopHeight = 600 $oRDP.Fullscreen = False $oRDP.ColorDepth = 16 $oRDP.AdvancedSettings3.SmartSizing = True $oRDP.Server = $host $oRDP.UserName = "" ;<<<<<<< enter here the user name $oRDP.Domain = "" $oRDP.AdvancedSettings2.ClearTextPassword = "" $oRDP.ConnectingText = "Connecting to " & $host $oRDP.DisconnectedText = "Disconnected from " & $host $oRDP.StartConnected = True $oRDP.Connect() GUISetState(@SW_SHOW, $hGUI) ;~ ConsoleWrite($oRDP.GetErrorDescription() & @CRLF) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE $oRDP.Disconnect() Exit EndSwitch WEnd It will open a RDP session embedded in the GUI. Br, UEZ
    1 point
×
×
  • Create New...