Leaderboard
Popular Content
Showing content with the highest reputation on 06/19/2014 in all areas
-
I bet doing this will fix it: Func bet(Byref $bet) ;... EndFunc2 points
-
Skype UDF v1.2 Introduction :Skype4COM represents the Skype API as objects, with :methodspropertieseventscollectionscachingSkype4COM provides an ActiveX interface to the Skype API. Develop for Skype in a familiar programming environment, such as Visual Studio or Delphi, using preferred scripting languages such as VBScript, PHP, or Javascript. Requirements : Skype 3.0+ must be installedWindows 2000, XP+ Update : Version 1.2 Fixed _Skype_ProfileGetHandle function Version 1.1 Fixed _Skype_ChatGetBookmarked function Added missing _Skype_ChatGetTopic function Version 1.0 Fixed _Skype_ChatGetAll function Version 0.9 Fixed Mute value returned by the _Skype_OnEventMute callback function Version 0.8 Error ObjEvent is set if none already set Version 0.7 Changed _Skype_GetChatActive to _Skype_GetChatAllActive Version 0.6 Added _Skype_GetCache Added _Skype_SetCache Changed Skype_Error function Minor bugs fixed Version 0.5 Fixed _Skype_ChatCreate Version 0.4 Fixed _Skype_ChatGetMessages Fixed "Skype - SciTE.au3" script Version 0.3 Minor changes Updated Skype in AutoIt example Version 0.2 Fixed _Skype_ChatAddMembers Various bugs fixed _Functions list : (346) Example GUI : Notes : Skype's access control must be accepted manually :After running the example script, click on the "Allow access" button of SkypeThis version is NOT complete If you are running on a 64 bits OS, add this line to your script : #AutoIt3Wrapper_UseX64=n Attachments :Pack (UDF + ExampleGUI)Version 1.2 : Skype-UDF_1.0.0.2.zip Examples : (put them into the "Example folder")-Answers to incomming calls even if you are already in a call : Auto Answer.au3-Shows how to use the OnMute event : Mute Event.au3 Happy coding1 point
-
MsgBox_CountDown() - MsgBox with visual countdown
mesale0077 reacted to GreenCan for a topic
Edit 2: Complete rewrite of the function, simplified version using a single function and without use of GUICtrlSetOnEvent or AutoItSetOption. Correct centering of message. Edit 1: Updated function to correct possible misbehaving AutoItSetOption. MsgBox with Visual CountDown Self-explanatory I guess... GreenCan MsgBox_CountDown.au3 (Previous downloads: 53)1 point -
In fact there is a big UIAutomation UDF project in example scripts which might be greatly useful to you. It can access all kinds of window controls which general win32 programming cannot. Worth a look like. Sticky at the top.1 point
-
GUI dynamics
kkelley reacted to JLogan3o13 for a topic
You could revert, something like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Test", 300, 200) $lbl1 = GUICtrlCreateLabel("Input 1", 10, 10, 100, 20) $lbl2 = GUICtrlCreateLabel("Input 2", 10, 70, 100, 20) $input1 = GUICtrlCreateInput("", 10, 30, 280, 30) $input2 = GUICtrlCreateInput("", 10, 90, 280, 30) GUICtrlSetState($lbl1, $GUI_HIDE) GUICtrlSetState($lbl2, $GUI_HIDE) GUICtrlSetState($input1, $GUI_HIDE) GUICtrlSetState($input2, $GUI_HIDE) $gobtn = GUICtrlCreateButton("Go", 10, 150, 40, 30) $revert = GUICtrlCreateButton("Revert", 100, 150, 40, 30) $exit = GUICtrlCreateButton("Exit", 200, 150, 40, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $exit ExitLoop Case $gobtn GUICtrlSetState($lbl1, $GUI_SHOW) GUICtrlSetState($lbl2, $GUI_SHOW) GUICtrlSetState($input1, $GUI_SHOW) GUICtrlSetState($input2, $GUI_SHOW) ConsoleWrite("User pressed Go" & @CRLF) Case $revert GUICtrlSetState($lbl1, $GUI_HIDE) GUICtrlSetState($lbl2, $GUI_HIDE) GUICtrlSetState($input1, $GUI_HIDE) GUICtrlSetState($input2, $GUI_HIDE) ConsoleWrite("User pressed Revert" & @CRLF) EndSwitch WEnd GUIDelete() But if you just want, say, nothing to happen when they hit $revert, you just code whatever notification you want and leave the controls hidden: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Test", 300, 200) $lbl1 = GUICtrlCreateLabel("Input 1", 10, 10, 100, 20) $lbl2 = GUICtrlCreateLabel("Input 2", 10, 70, 100, 20) $input1 = GUICtrlCreateInput("", 10, 30, 280, 30) $input2 = GUICtrlCreateInput("", 10, 90, 280, 30) GUICtrlSetState($lbl1, $GUI_HIDE) GUICtrlSetState($lbl2, $GUI_HIDE) GUICtrlSetState($input1, $GUI_HIDE) GUICtrlSetState($input2, $GUI_HIDE) $gobtn = GUICtrlCreateButton("Go", 10, 150, 40, 30) $revert = GUICtrlCreateButton("Revert", 100, 150, 40, 30) $exit = GUICtrlCreateButton("Exit", 200, 150, 40, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $exit ExitLoop Case $gobtn GUICtrlSetState($lbl1, $GUI_SHOW) GUICtrlSetState($lbl2, $GUI_SHOW) GUICtrlSetState($input1, $GUI_SHOW) GUICtrlSetState($input2, $GUI_SHOW) ConsoleWrite("User pressed Go" & @CRLF) Case $revert ConsoleWrite("User pressed Revert but I didn't do 'nuthin." & @CRLF) EndSwitch WEnd GUIDelete()1 point -
kkelley, Or look at my GUIExtender UDF (look in my sig for the link) which lets you expand/contract sections of the GUI so that only the parts you want are visible. M231 point
-
GUI dynamics
kkelley reacted to JLogan3o13 for a topic
Hi, kkelley. Check out GuiCtrlSetState in the help file. Perhaps something like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Test", 300, 200) $lbl1 = GUICtrlCreateLabel("Input 1", 10, 10, 100, 20) $lbl2 = GUICtrlCreateLabel("Input 2", 10, 70, 100, 20) $input1 = GUICtrlCreateInput("", 10, 30, 280, 30) $input2 = GUICtrlCreateInput("", 10, 90, 280, 30) GUICtrlSetState($lbl1, $GUI_HIDE) GUICtrlSetState($lbl2, $GUI_HIDE) GUICtrlSetState($input1, $GUI_HIDE) GUICtrlSetState($input2, $GUI_HIDE) $gobtn = GUICtrlCreateButton("Go", 10, 150, 40, 30) $exit = GUICtrlCreateButton("Exit", 200, 150, 40, 30) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $exit ExitLoop Case $gobtn GUICtrlSetState($lbl1, $GUI_SHOW) GUICtrlSetState($lbl2, $GUI_SHOW) GUICtrlSetState($input1, $GUI_SHOW) GUICtrlSetState($input2, $GUI_SHOW) EndSwitch WEnd GUIDelete()1 point -
Global $bet = 350000 Global $maxbet = 255000000 Global $onetime = True Global $flag = True Global $remember $bet = bet($bet) ConsoleWrite($bet & @CRLF) $bet = bet($bet) ConsoleWrite($bet & @CRLF) $bet = bet($bet) ConsoleWrite($bet & @CRLF) Func bet($bet) If $onetime = True Then $remember = $bet $onetime = False $bet = $bet + $bet Else If $flag = True Then $bet = $remember + $bet $flag = False Else $bet = $bet + $bet EndIf EndIf Return $bet EndFunc ;==>bet1 point
-
CUI Automation: Documentation Roadmap Overview Windows Automation APIUI AutomationUI Automation Fundamentals General conceptsUI Automation Client Programmer's Guide To automate applications, this is for usUI Automation Provider Programmer's Guide To create applications, this is not for usUI Automation FundamentalsUI Automation Tree OverviewUI Automation Control Types OverviewUI Automation Properties Overview To get informationUI Automation Control Patterns Overview To perform actionsUI Automation Events Overview To handle eventsUI Automation Client Programmer's GuideObtaining UI Automation ElementsRetrieving Properties from UI Automation ElementsHow-To Topics for UI Automation Clients C++ code examplesMain interfaces (objects)IUIAutomation interfaceIUIAutomationElement interfaceIUIAutomationElementArray interfaceIUIAutomationTreeWalker interfaceOther topicsAutomating the listview in Windows Explorer1 point
-
It works for me on Windows 7. Try the full code: #include "CUIAutomation2.au3" Opt( "MustDeclareVars", 1 ) Global $oUIAutomation MainFunc() Func MainFunc() ; Be sure to use the right class if you are on Vista or Windows 8 Local $hWindow = WinGetHandle( "[CLASS:CabinetWClass]", "" ) ; Windows Explorer, Windows 7 ;Local $hWindow = WinGetHandle( "[CLASS:ExploreWClass]", "" ) ; Windows Explorer, Windows XP If Not $hWindow Then Return $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return Local $pWindow $oUIAutomation.ElementFromHandle( $hWindow, $pWindow ) If Not $pWindow Then Return Local $oWindow = ObjCreateInterface( $pWindow, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oWindow ) Then Return ListAllItems( $oWindow, 50007 ) ; 50007 = List view element ; Run the code in post #71 to get this value EndFunc Func ListAllItems( $oWindow, $iCtrlType ) Local $pCondition $oUIAutomation.CreatePropertyCondition( $UIA_ControlTypePropertyId, $iCtrlType, $pCondition ) If Not $pCondition Then Return Local $pUIElementArray, $oUIElementArray, $iElements $oWindow.FindAll( $TreeScope_Descendants, $pCondition, $pUIElementArray ) $oUIElementArray = ObjCreateInterface( $pUIElementArray, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray ) $oUIElementArray.Length( $iElements ) If Not $iElements Then Return Local $pUIElement, $oUIElement, $name, $sel For $i = 0 To $iElements - 1 $oUIElementArray.GetElement( $i, $pUIElement ) $oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) $oUIElement.GetCurrentPropertyValue( $UIA_NamePropertyId, $name ) $oUIElement.GetCurrentPropertyValue( $UIA_SelectionItemIsSelectedPropertyId, $sel ) ConsoleWrite( $name & " " & $sel & @CRLF ) ListChildren( $oUIElement ) Next EndFunc Func ListChildren( $oParent ) Local $pCondition $oUIAutomation.CreateTrueCondition( $pCondition ) If Not $pCondition Then Return Local $pUIElementArray, $oUIElementArray, $iElements $oParent.FindAll( $TreeScope_Children, $pCondition, $pUIElementArray ) $oUIElementArray = ObjCreateInterface( $pUIElementArray, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray ) $oUIElementArray.Length( $iElements ) If Not $iElements Then Return Local $pUIElement, $oUIElement, $name, $value For $i = 0 To $iElements - 1 $oUIElementArray.GetElement( $i, $pUIElement ) $oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) $oUIElement.GetCurrentPropertyValue( $UIA_NamePropertyId, $name ) $oUIElement.GetCurrentPropertyValue( $UIA_ValueValuePropertyId, $value ) If $name <> "" Then ConsoleWrite( " " & $name & ": " & $value & @CRLF ) Next EndFunc1 point
-
Socket To IP and port
SlowCoder74 reacted to funkey for a topic
I wrote this function a few years ago: Func _Ws2_GetLocalPort($iSocket) ;funkey Local $hDLL = DllOpen("Ws2_32.dll") Local $tagIN_ADDR = "ulong S_addr;" Local $tagSOCKADDR_IN = "short sin_family;ushort sin_port;ptr sin_addr;char sin_zero[8];" Local $tIn_Addr = DllStructCreate($tagIN_ADDR) Local $tName = DllStructCreate($tagSOCKADDR_IN) DllStructSetData($tName, "sin_addr", DllStructGetPtr($tIn_Addr)) Local $aRes = DllCall($hDLL, "int", "getsockname", "uint", $iSocket, "struct*", $tName, "int*", 512) Local $aRes2 = DllCall($hDLL, "ushort", "ntohs", "ushort", DllStructGetData($tName, 2)) DllClose($hDLL) Return $aRes2[0] EndFunc Hope this is what you want.1 point -
Is there any way to rotate a circle? I tried this way: #include <GUIConstantsEx.au3> #include '..\include\S3d.au3' Local $GUI = GUICreate("S3d Example", 650, 550) _GDIPlus_Startup() Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI) Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics(650, 550, $hGraphics) Local $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) _S3d_SelectGraphic($hGraphic, 650, 550) Global $hPenB = _GDIPlus_PenCreate(0xAA0044FF, 2) Global $hPenR = _GDIPlus_PenCreate(0xAAFF6633, 3) Local $nBgColor = 0xFFFFFFFF Local $i = 0 Local $frame = 0 Local $t = TimerInit() GUISetState() Do _S3d_Clear($nBgColor) Draw($i) _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0) $i += 1 $frame += 1 If TimerDiff($t) > 1000 Then $t = TimerInit() WinSetTitle($GUI, '', ' ' & $frame & ' FPS') $frame = 0 EndIf Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE End() _GDIPlus_Shutdown() GUIDelete($GUI) Func Draw($i) _S3d_SetCamera(350 * Cos($i * 0.01), 350 * Sin($i * 0.01), 150, 0, 0, 0) _S3d_SelectPen($hPenB) _S3d_Box(-100, -100, -100, 100, 100, 100) _S3d_SelectPen($hPenR) _S3d_LocalRotateX($i, True) _S3d_LocalRotateZ(-120, True) $tmp = 60 _S3d_Box(-$tmp, -$tmp, -$tmp, $tmp, $tmp, $tmp) _S3d_LocalRotateX($i*2, True) _S3d_SelectPen($hPenB) $tmp = 30 _S3d_Circle(0, 0, 0, 30) EndFunc ;==>Draw Func End() _GDIPlus_PenDispose($hPenB) _GDIPlus_PenDispose($hPenR) EndFunc ;==>End and boxes rotate, but circle doesn't :/ EDIT: why does black square in my script sometimes shows as triangle? o.O #include <GUIConstantsEx.au3> #include <Misc.au3> #include '..\include\S3d.au3' Global $dll = DllOpen('user32.dll') Local $GUI = GUICreate('', 650, 550) _GDIPlus_Startup() Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI) Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics(650, 550, $hGraphics) Local $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) _S3d_SelectGraphic($hGraphic, 650, 550) Global $hPenB = _GDIPlus_PenCreate(0xAA0044FF, 2) Global $hPenR = _GDIPlus_PenCreate(0xAAFF6633, 3) Global $hBrushBlack = _GDIPlus_BrushCreateSolid(0xFF000000) Global $camA = 305 Global $camH = 1 Local $nBgColor = 0xFFAAFFAA Local $i = 0 Local $frame = 0 Local $t = TimerInit() GUISetState() ;~ $folderName = 'circle3' ;~ DirCreate('H:\autoit\GDI\3d\' & $folderName) Do _S3d_Clear($nBgColor) Draw($i) _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0) ;~ _GDIPlus_ImageSaveToFile($hBitmap, 'H:\autoit\GDI\3d\' & $folderName & '\' & $i & '.png') keys() $i += 1 $frame += 1 If TimerDiff($t) > 1000 Then $t = TimerInit() WinSetTitle($GUI, '', ' ' & $frame & ' FPS $camA = ' & $camA & ' $camH = ' & $camH) $frame = 0 EndIf Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE End() _GDIPlus_Shutdown() GUIDelete($GUI) Func Draw($i) _S3d_SetCamera(350 * Cos($camA * 0.01), 350 * Sin($camA * 0.01), 150+3.60*$camH, 0, 0, 0) $tmp = 500 $floor_H = 100 _S3d_SelectBrush($hBrushBlack) _S3d_Square( -$tmp, -$tmp, -$floor_H, _ -$tmp, $tmp, -$floor_H, _ $tmp, $tmp, -$floor_H, _ $tmp, -$tmp, -$floor_H, True) _S3d_SelectPen($hPenB) _S3d_Box(-100, -100, -100, 100, 100, 100) _S3d_SelectPen($hPenR) _S3d_LocalRotateX($i, True) _S3d_LocalRotateZ(-120, True) $tmp = 60 _S3d_Box(-$tmp, -$tmp, -$tmp, $tmp, $tmp, $tmp) _S3d_LocalRotateX($i*2, True) _S3d_SelectPen($hPenB) _S3d_Circle(0, 0, 0, 30) Return 350 * Cos($i * 0.01) EndFunc ;==>Draw Func End() _GDIPlus_PenDispose($hPenB) _GDIPlus_PenDispose($hPenR) DllClose($dll) EndFunc ;==>End Func keys() If _IsPressed('25', $dll) Then $camA -= 1 EndIf If _IsPressed('27', $dll) Then $camA += 1 EndIf If _IsPressed('26', $dll) Then $camH *= 1.05 If $camH > 1000 Then $camH = 1000 EndIf If _IsPressed('28', $dll) Then $camH /= 1.05 If $camH < 1 Then $camH = 1 EndIf EndFunc1 point