Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/05/2015 in all areas

  1. This is a very simple sample about checking printer status and set its online/offline status.may help those who in need of this issue. $StrComputer="." $obj=ObjGet("winmgmts:\\"&$StrComputer&"\root\CIMV2") $colitems=$obj.ExecQuery("Select * from Win32_Printer") For $objitem In $colitems If $objitem.Caption=="SHARP AR-1808S" Then $a=Int($objitem.Attributes / 1024) If Mod($a, 2)=0 Then MsgBox(0,0,"Printer is online",8) ElseIf Mod($a, 2)=1 Then MsgBox(0,0,"Printer is offline,press 'OK'button To make the printer online ",8) ;core code $objitem.WorkOffline = False $objitem.Put_ ;~~~~~~~~~~~~~~~~~~~~~~ MsgBox(0,'','Printer is online now.') Else MsgBox(0,0,"unknown status",8) EndIf EndIf next
    1 point
  2. Ah OK. As i said..it´s no problem. It´s just a bug. And i fix it in the next update.
    1 point
  3. The name more or less explains it: It is a wrapper for AutoIt. In other words it will run AutoIt3 or Aut2exe for you and will perform all kind of tasks before or after through the #Autoit3Wrapper directives to make you whole compile or run process easier. Jos
    1 point
  4. Understood but already told you that you NEED AutoIt3Wrapper for the auto increment options! So when you question is that you want to do a commandline compile instead of using SciITE then simply run AutoIt3Wrapper in your batch file. When you press F7 in SciTE you will see the full commndline which is performed. Jos
    1 point
  5. Oh ok kcvinu i think i found the bug. Please check in your example (in For $s = 0 To 4) if ther is a tabulator space after the last char (after 4). Remove it and the indent should work. But of course i will fix this in the next update.
    1 point
  6. The explanations are much more complicated than the code. Here's the code: #include <GUIConstants.au3> #include <WinAPIShellEx.au3> #include <GuiEdit.au3> Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $hGui = GUICreate( "Input (numbers only)", 300, 118 ) Local $idInput = GUICtrlCreateInput( "", 50, 50, 200, 18, $GUI_SS_DEFAULT_INPUT+$ES_NUMBER ) Local $hInput = GUICtrlGetHandle( $idInput ) GUICtrlCreateLabel( "No context menu, no paste, no balloontip", 50, 70, 200, 18 ) ; Register callback function to subclass Input control Local $pInputProc = DllCallbackGetPtr( DllCallbackRegister( "InputProc", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr" ) ) _WinAPI_SetWindowSubclass( $hInput, $pInputProc, 9999, 0 ) ; SubclassId = 9999, $pData = 0 GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup _WinAPI_RemoveWindowSubclass( $hInput, $pInputProc, 9999 ) GUIDelete( $hGui ) Exit EndFunc ; InputProc callback function Func InputProc( $hWnd, $iMsg, $wParam, $lParam, $iSubclassId, $pData ) Switch $iMsg Case $WM_CONTEXTMENU, $WM_PASTE, $EM_SHOWBALLOONTIP Return 0 EndSwitch ; Call next function in subclass chain Return DllCall( "comctl32.dll", "lresult", "DefSubclassProc", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam )[0] ; _WinAPI_DefSubclassProc EndFunc
    1 point
  7. When you want to make use of the #Autoit3Wrapper directives, you will have to run AutoIt3Wrapper to compile a script with aut2exe or else these directives are ignored. Jos
    1 point
  8. wakillon

    Looking for a timer proces

    Try this... Dim $_TimerInit = TimerInit ( ) While 1 If _EachXseconds ( 15*60 ) Then ConsoleWrite ( '15 Min are finished ' & @Crlf ) Sleep ( 50 ) WEnd Func _EachXseconds ( $_Interval ) $_TimerDiff = Round ( TimerDiff ( $_TimerInit )/ 1000 ) If $_TimerDiff >= $_Interval Then $_TimerInit = TimerInit ( ) Return 1 Else Return 0 EndIf EndFunc ;==> _EachXseconds ( ) or like that #Include <Date.au3> Global $iTimer1 = _NowCalc ( ) Global $iTimer2 = _NowCalc ( ) While 1 $_NowCalc = _NowCalc ( ) If _DateDiff ( "n", $iTimer1, $_NowCalc ) >= 15 Then ; 15 min ConsoleWrite ( "+>---- 1 $_NowCalc : " & $_NowCalc & @Crlf ) $iTimer1 = $_NowCalc EndIf If _DateDiff ( "h", $iTimer2, $_NowCalc ) >= 4 Then ; 4 hour ConsoleWrite ( "!>---- 2 $_NowCalc : " & $_NowCalc & @Crlf ) $iTimer2 = $_NowCalc EndIf Sleep ( 100 ) WEnd
    1 point
×
×
  • Create New...