Jump to content

UQOII

Active Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by UQOII

  1. its a really good script THANK YOU! maybe optinal things: Not only black but different colors?
  2. #include <WinAPI.au3> #include <WindowsConstants.au3> Global Const $WH_CALLWNDPROC = 4 Global Const $WH_CALLWNDPROCRET = 12 Global Const $WH_CBT = 5 Global Const $WH_DEBUG = 9 Global Const $WH_FOREGROUNDIDLE = 11 Global Const $WH_GETMESSAGE = 3 Global Const $WH_JOURNALPLAYBACK = 1 Global Const $WH_JOURNALRECORD = 0 Global Const $WH_KEYBOARD = 2 Global Const $WH_KEYBOARD_LL = 13 Global Const $WH_MOUSE = 7 Global Const $WH_MOUSE_LL = 14 Global Const $WH_MSGFILTER = -1 Global Const $WH_SHELL = 10 Global Const $WH_SYSMSGFILTER = 6 Global Const $KF_EXTENDED = 0x100 Global Const $KF_ALTDOWN = 0x2000 Global Const $KF_UP = 0x8000 Global Const $LLKHF_EXTENDED = BitShift($KF_EXTENDED, 8) Global Const $LLKHF_INJECTED = 0x10 Global Const $LLKHF_ALTDOWN = BitShift($KF_ALTDOWN, 8) Global Const $LLKHF_UP = BitShift($KF_UP, 8) ; #STRUCTURE# ==================================================================================================== ;=============== ; Name...........: $tagKBDLLHOOKSTRUCT ; Description ...: Contains information about a low-level keyboard input event ; Fields ........: vkCode - Specifies a virtual-key code. The code must be a value in the range 1 to 254 ; scanCode - Specifies a hardware scan code for the key ; flags - Specifies the extended-key flag, event-injected flag, context code, and transition-state flag. This member is specified as follows. ; + An application can use the following values to test the keystroke flags: ; |$LLKHF_EXTENDED - Test the extended-key flag ; |$LLKHF_INJECTED - Test the event-injected flag ; |$LLKHF_ALTDOWN - Test the context code ; |$LLKHF_UP - Test the transition-state flag ; | 0 - Specifies whether the key is an extended key, such as a function key or a key on the numeric keypad ; | The value is 1 if the key is an extended key; otherwise, it is 0 ; | 1 to 3 - Reserved ; | 4 - Specifies whether the event was injected. The value is 1 if the event was injected; otherwise, it is 0 ; | 5 - Specifies the context code. The value is 1 if the ALT key is pressed; otherwise, it is 0 ; | 6 - Reserved ; | 7 - Specifies the transition state. The value is 0 if the key is pressed and 1 if it is being released ; time - Specifies the time stamp for this message, equivalent to what GetMessageTime would return for this message ; dwExtraInfo - Specifies extra information associated with the message ; Author ........: Gary Frost (gafrost) ; Remarks .......: ; ==================================================================================================== ;=========================== Global Const $tagKBDLLHOOKSTRUCT = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo" Global $hHook Global $hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam") Global $hmod = _WinAPI_GetModuleHandle(0) Global $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod) Global $buffer = "" MsgBox(4096, "", "Click OK, then open notepad and type..." & _ @LF & @LF & "Jon" & @LF & "AutoIt") While 1 Sleep(10) WEnd Func EvaluateKey($keycode) If (($keycode > 64) And ($keycode < 91)) _; A - Z Or (($keycode > 47) And ($keycode < 58)) Then; 0 - 9 $buffer &= Chr($keycode) Switch $buffer Case "Jon" ToolTip("What can you say?") Case "AUTOIT" ToolTip("AutoIt Rocks") EndSwitch ElseIf ($keycode > 159) And ($keycode < 164) Then Return ElseIf ($keycode = 27) Then; esc key Exit Else $buffer = "" EndIf EndFunc ;==>EvaluateKey ;=========================================================== ; callback function ;=========================================================== Func _KeyProc($nCode, $wParam, $lParam) Local $tKEYHOOKS $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndIf If $wParam = $WM_KEYDOWN Then EvaluateKey(DllStructGetData($tKEYHOOKS, "vkCode")) Else Local $flags = DllStructGetData($tKEYHOOKS, "flags") Switch $flags Case $LLKHF_ALTDOWN ConsoleWrite("$LLKHF_ALTDOWN" & @LF) Case $LLKHF_EXTENDED ConsoleWrite("$LLKHF_EXTENDED" & @LF) Case $LLKHF_INJECTED ConsoleWrite("$LLKHF_INJECTED" & @LF) Case $LLKHF_UP ConsoleWrite("$LLKHF_UP: scanCode - " & DllStructGetData($tKEYHOOKS, "scanCode") & @TAB & "vkCode - " & DllStructGetData($tKEYHOOKS, "vkCode") & @LF) EndSwitch EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>_KeyProc Func OnAutoItExit() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hStub_KeyProc) EndFunc ;==>OnAutoItExit ; #FUNCTION# ==================================================================================================== ;================ ; Name...........: _WinAPI_UnhookWindowsHookEx ; Description ...: Removes a hook procedure installed in a hook chain by the _WinAPI_SetWindowsHookEx function ; Syntax.........: _WinAPI_UnhookWindowsHookEx($hhk) ; Parameters ....: $hhk - Handle to the hook to be removed ; Return values .: Success - True ; Failure - False ; Author ........: Gary Frost ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; @@MsdnLink@@ UnhookWindowsHookEx ; Example .......; ; ==================================================================================================== ;=========================== Func _WinAPI_UnhookWindowsHookEx($hhk) Local $iResult = DllCall("user32.dll", "int", "UnhookWindowsHookEx", "hwnd", $hhk) If @error Then Return SetError(@error, @extended, 0) Return $iResult[0] <> 0 EndFunc ;==>_WinAPI_UnhookWindowsHookEx ; #FUNCTION# ==================================================================================================== ;================ ; Name...........: _WinAPI_CallNextHookEx ; Description ...: Passes the hook information to the next hook procedure in the current hook chain ; Syntax.........: _WinAPI_CallNextHookEx($hhk, $iCode, $wParam, $lParam) ; Parameters ....: $hhk - Windows 95/98/ME: Handle to the current hook. An application receives this handle as a result of a previous call to the _WinAPI_SetWindowsHookEx function. ; |Windows NT/XP/2003: Ignored ; $iCode - Specifies the hook code passed to the current hook procedure. The next hook procedure uses this code to determine how to process the hook information ; $wParam - Specifies the wParam value passed to the current hook procedure. ; |The meaning of this parameter depends on the type of hook associated with the current hook chain ; $lParam - Specifies the lParam value passed to the current hook procedure. ; |The meaning of this parameter depends on the type of hook associated with the current hook chain ; Return values .: Success - This value is returned by the next hook procedure in the chain ; Failure - -1 and @error is set ; Author ........: Gary Frost ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; @@MsdnLink@@ CallNextHookEx ; Example .......; ; ==================================================================================================== ;=========================== Func _WinAPI_CallNextHookEx($hhk, $iCode, $wParam, $lParam) Local $iResult = DllCall("user32.dll", "long", "CallNextHookEx", "hwnd", $hhk, "int", $iCode, "wparam", $wParam, "lparam", $lParam) If @error Then Return SetError(@error, @extended, -1) Return $iResult[0] EndFunc ;==>_WinAPI_CallNextHookEx ; #FUNCTION# ==================================================================================================== ;================ ; Name...........: _WinAPI_SetWindowsHookEx ; Description ...: Installs an application-defined hook procedure into a hook chain ; Syntax.........: _WinAPI_SetWindowsHookEx($idHook, $lpfn, $hmod[, $dwThreadId = 0]) ; Parameters ....: $idHook - Specifies the type of hook procedure to be installed. This parameter can be one of the following values: ; |$WH_CALLWNDPROC - Installs a hook procedure that monitors messages before the system sends them to the destination window procedure ; |$WH_CALLWNDPROCRET - Installs a hook procedure that monitors messages after they have been processed by the destination window procedure ; |$WH_CBT - Installs a hook procedure that receives notifications useful to a computer-based training (CBT) application ; |$WH_DEBUG - Installs a hook procedure useful for debugging other hook procedures ; |$WH_FOREGROUNDIDLE - Installs a hook procedure that will be called when the application's foreground thread is about to become idle ; |$WH_GETMESSAGE - Installs a hook procedure that monitors messages posted to a message queue ; |$WH_JOURNALPLAYBACK - Installs a hook procedure that posts messages previously recorded by a $WH_JOURNALRECORD hook procedure ; |$WH_JOURNALRECORD - Installs a hook procedure that records input messages posted to the system message queue ; |$WH_KEYBOARD - Installs a hook procedure that monitors keystroke messages ; |$WH_KEYBOARD_LL - Windows NT/2000/XP: Installs a hook procedure that monitors low-level mouse input events ; |$WH_MOUSE - Installs a hook procedure that monitors mouse messages ; |$WH_MOUSE_LL - Windows NT/2000/XP: Installs a hook procedure that monitors low-level mouse input events ; |$WH_MSGFILTER - Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar ; |$WH_SHELL - Installs a hook procedure that receives notifications useful to shell applications ; |$WH_SYSMSGFILTER - Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar ; $lpfn - Pointer to the hook procedure. If the $dwThreadId parameter is zero or specifies the identifier of a thread created by a different process, ; + the $lpfn parameter must point to a hook procedure in a DLL. ; |Otherwise, $lpfn can point to a hook procedure in the code associated with the current process ; $hmod - Handle to the DLL containing the hook procedure pointed to by the $lpfn parameter. ; |The $hMod parameter must be set to NULL if the $dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the ; + code associated with the current process ; $dwThreadId - Specifies the identifier of the thread with which the hook procedure is to be associated. ; |If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread ; Return values .: Success - Handle to the hook procedure ; Failure - 0 and @error is set ; Author ........: Gary Frost ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........; @@MsdnLink@@ SetWindowsHookEx ; Example .......; ; ==================================================================================================== ;=========================== Func _WinAPI_SetWindowsHookEx($idHook, $lpfn, $hmod, $dwThreadId = 0) Local $hwndHook = DllCall("user32.dll", "hwnd", "SetWindowsHookEx", "int", $idHook, "ptr", $lpfn, "hwnd", $hmod, "dword", $dwThreadId) If @error Then Return SetError(@error, @extended, 0) Return $hwndHook[0] EndFunc ;==>_WinAPI_SetWindowsHookEx So this is the code. The problem is that it only for keyboard. How do i set this for the mouse? ive tried this but i dont get it worked
  3. i found on internet the support from microsoft this program recognize the mousewheel up and down scrolling i hope it helps, i cant figure it out
  4. #include <GUIConstants.au3> $GUI = GUICreate("GUI", 200, 50, 187, 118) $Value = GUICtrlCreateInput("48", 16, 16, 40, 21) GuiCtrlCreateUpDown(-1) GUISetState(@SW_SHOW) While 1 $Number = GUICtrlRead($Value) if $Number <1 Or $Number > 48 Then GUICtrlSetData($Value,"48") EndIf Sleep (1000);Idle around WEnd
  5. in my script stands While _ispressed(02) ;Right mousebutton but i need something to recive the mouse wheel action. so if i scroll up $i = $i + 1 and if i scroll down $i = $i - 1
  6. thanx this is very usefull for me @bigdog this is only Internet Explore
  7. edit in 1st post the buttons are also change. - if the gui backgroundcolor = 28000 then is the button 22000 (see consolewrite)
  8. Thank you
  9. #include <GUIConstants.au3> $Form1 = GUICreate("Form1", 633, 454, 193, 115) $Button = GUICtrlCreateLabel("Button2", 64, 96, 65, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button msgbox(0,"Test","This is a button") EndSwitch WEnd you mean like this?
  10. If i want to set a color for pen ( _GDIPlus_PenSetColor($hPen, $iARGB) ) i need a ARGB (Alpha, Red, Green and Blue) with _choosecolor i can get only RGB how do i get A ?
  11. you say it, it easy question StringMid("Open 2008-05-01 12:28 by Hans Zettberg/AVDL/RITTS",6,16)
  12. i dont know what you want with the text, the easy way is_StringEncrypt (see help file) if you want the diffcult way then you can use what torels says
  13. #include <Date.au3> $date1 = "300408" ; 300508 - 30 April 2008 ; 1 Sat and 1 Sun between - inclu. 8 days excl. 6 days $date2 = @MDAY & @MON & StringRight(@YEAR,2); 070508 - 7 May 2008 (Today) $time = StringMid($date2,3,2) - StringMid($date1,3,2) If $time = 1 Then $dayn = _calcdate(StringLeft($date1,2),StringMid($date1,3,2)) $totaldays = $dayn + StringLeft($date2,2) EndIf If $totaldays > 7 And $totaldays < 13 Then $days = $totaldays - 2 ConsoleWrite("Total days: " & $days&@LF) EndIf Func _calcdate($day,$mon) $new = _DateDaysInMonth(@year,$mon)-$day+1 Return $new EndFunc I think this will help too
  14. This little script change the background of GUI automatic Not very useful but it is funny #include <GUIConstants.au3> $COLOR = 22000 $colorbtn = 28000 $n = 0 $count = 500 GUICreate("My GUI") $btn = GUICtrlCreateButton("Start",10,10,50) $btn2 = GUICtrlCreateButton("Stop",60,10,50) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $btn Then AdlibEnable("CHANGECOLOR",200) If $msg = $btn2 Then AdlibDisable() Wend Func CHANGECOLOR() If $color = 28000 Then $n = 1 ElseIf $color = 22000 Then $n = 0 EndIf If $n = 0 Then $color = $color + $count $colorbtn = $colorbtn - $count GUICtrlSetBkColor($btn,$colorbtn) GUICtrlSetBkColor($btn2,$colorbtn) GUISetBkColor($color) ConsoleWrite("gui " & $color & " - button " & $colorbtn& @LF) ElseIf $n = 1 Then $color = $color - $count $colorbtn = $colorbtn + $count GUICtrlSetBkColor($btn,$colorbtn) GUICtrlSetBkColor($btn2,$colorbtn) GUISetBkColor($color) ConsoleWrite("gui " & $color & " - button " & $colorbtn& @LF) EndIf EndFunc
  15. >"I:\Programma's\AutoIt\install\SciTe\..\autoit3.exe" /ErrorStdOut "I:\Test map\test.au3" I:\Programma's\AutoIt\install\Include\GDIPlus.au3 (2688) : ==> Subscript used with non-Array variable.: Return $aResult[0] <> 0 Return $aResult^ ERROR >Exit code: 1 Time: 11.900 Is this because im using windows 2000 ? (I cant remember but with my vista or XP i had the same error)
  16. yupsz i was already so far to change that. i must create _GetImagePixel() to get the width and height but i dont know how. and that is why i need help, to create that func
  17. I was searching and i saw this topic. This is what i want: Open a picture and if i press Zoom in 2x then must the pic be twice as big. ( like old 100*100 then new 200*200) This is my script #include <GUIConstants.au3> Global $file GUICreate("My GUI",250,200,100,100,$WS_POPUP) $filemenu = GUICtrlCreateMenu ("&File") $openitem = GUICtrlCreateMenuitem ("Open",$filemenu) $exititem = GUICtrlCreateMenuitem ("Exit",$filemenu) $pic = GUICtrlCreatePic("",0,20,0,0) $zoom = GUICtrlCreateButton("Zoom in 2x",0,0,150,20) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $exititem Then ExitLoop If $msg = $zoom Then _zoomin() If $msg = $openitem Then _pic() Wend Func _zoomin() $oldwidth = _GetImagePixel($file, "Width") $oldHeight = _GetImagePixel($file, "Height") $oldwidth = $newwidth * 2 $oldHeight = $newHeight * 2 GUICtrlSetPos($pic,0,0,$newwidth,$newHeight) EndFunc Func _pic() $file = FileOpenDialog("Picture",@ScriptDir,"All Pictures(*.jpg;*.bmp;*.gif)|JPG file (*.jpg)|BMP file (*.bmp)|GIF file (*.gif)|All files (*.*)") If @error Then Sleep(10) Else GUICtrlSetImage($pic,$file) EndIf EndFunc Edit: i tried the script in this topic but don't work, _GDIPlus_ImageGetHeight works also not, then i get a msgbox with: Fatal Error AVector: []: out of bounds
  18. Does someone else know a good solution?
  19. Have someone tried to make a graphic equalizer like Windows media player or like this pic?
  20. Your script is good but you can still see the gui in the taskbar.....
  21. I want a GUI that is Topmost, not visable in the menu and no Borders. The 2nd gui in the test script is perfect but it have's a border around the gui and that is what i don't want. if you test the script below you know what i mean. #include <GUIConstants.au3> $gui = GUICreate("This is what i want~~~~~~",220,70,100,100,BitOR ($WS_POPUP,$WS_EX_MDICHILD)) GUICtrlCreateLabel("This is what i want."&@CRLF&"But i want this gui also:"&@CRLF&"- Topmost"&@CRLF&"not visable in the menu balk under",10,10) $exit = GUICtrlCreateButton("X",200,0,20,20) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $exit Then ExitLoop Wend GUICreate("This is what i have**********",220,70,350,100,$WS_POPUP,$WS_EX_MDICHILD&$WS_EX_TOPMOST) GUICtrlCreateLabel("This is what i have."&@CRLF&""&@CRLF&"But now i have a ugly border on the GUI"&@CRLF&"It is Topmost and is not visable in the menu",10,10) $exit = GUICtrlCreateButton("X",200,0,20,20) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $exit Then ExitLoop Wend
  22. Thanx it works! but there where some error's this is it: If not WinActive($gui) and not BitAnd(GuiSetState($gui),@SW_HIDE) then GuiSetState(@SW_HIDE,$gui) EndIf
  23. you dont get it if my gui is active and i click somewhere else then the gui must hide with this code: GUISetState(@SW_HIDE,$gui) this is the same effect as the start menu in your left corner i hope you get it now
  24. Hi, Is it possible like the start menu in left corner that if its activate en you click some where else the start menu is hide? thanx
×
×
  • Create New...