Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/22/2012 in all areas

  1. Remember when you were a kid (if you are as ancient as I) and there were these cheap plastic puzzles of sliding squares that you were suppose to get in the right order? Well this is that Enjoy Version 1.01 Cosmetic and Platform changes Plastic Sliding Puzzle.au3
    2 points
  2. Finally I am getting familiar with assembly. I got it working with 64bit and 32bit: #include <windowsconstants.au3> #include <WinAPI.au3> #include <Memory.au3> Global Const $WM_TRAYNOTIFY = $WM_USER + 1 Global Const $NIN_BALLOONSHOW = $WM_USER + 2 Global Const $NIN_BALLOONHIDE = $WM_USER + 3 Global Const $NIN_BALLOONUSERCLICK = $WM_USER + 5 Global Const $NIN_BALLOONTIMEOUT = $WM_USER + 4 Global Const $__gpTrayNotifySubclassProc = __TrayNotify_CreateSubclassProc() Func __TrayNotify_CreateSubclassProc() ; ASM by ProgAndy Local $aCall = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", _WinAPI_GetModuleHandle("user32.dll"), "str", "PostMessageW") Local $pPostMessageW = $aCall[0] $aCall = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", _WinAPI_GetModuleHandle("Comctl32.dll"), "str", "DefSubclassProc") Local $pDefSubclassProc = $aCall[0] ; dwRefData (parameter #6) will be target window If @AutoItX64 Then; x64 #cs use64 push rbp mov rbp, rsp sub rsp, 32 ; shadow space for api calls CMP RDX, 401h ; WM_TRAYNOTIFY jnz after_notify notify: mov [rbp+10h], RCX ; save registers to own shadow space mov [rbp+18h], RDX mov [rbp+20h], R8 mov [rbp+28h], R9 mov rcx, [rbp+38h] ; hWndRedirect mov rax, 22FF22FF22FF22FFh ; DUMMY 2 call rax ; call PostMessageW mov R9, qword[ebp+28h] ; lparam ; restore registers for next call mov R8, qword[ebp+20h] ; wparam mov RDX, qword[ebp+18h] ; uMsg mov RCX, qword[ebp+10h] ; hWnd after_notify: mov rax, 33FF33FF33FF33FFh ; DUMMY 3 call rax ; call DefSubclassProc add rsp, 32 pop rbp ret ; x64 MS-FASTCALL #ce Local $b = Binary("0x554889e54883ec204881fa01040000753448894d10488955184c8945204c894d28488b4d3848b8")&Binary($pPostMessageW)&Binary("0xffd0674c8b4d28674c8b452067488b551867488b4d1048b8")&Binary($pDefSubclassProc)&Binary("0xffd04883c4205dc3") Else; x86 #cs use32 push ebp mov ebp, esp CMP dword[ebp+12], 401h ; WM_TRAYNOTIFY jnz after_notify notify: push dword[ebp+20] ; lparam push dword[ebp+16] ; wparam push dword[ebp+12] ; uMsg push dword[ebp+28] ; hWndRedirect mov eax, 22FF22FFh ; DUMMY 2 call eax ; call PostMessageW after_notify: push dword[ebp+20] ; lparam push dword[ebp+16] ; wparam push dword[ebp+12] ; uMsg push dword[ebp+8] ; hWnd mov eax, 33FF33FFh ; DUMMY 3 call eax ; call DefSubclassProc pop ebp ret 24 ; 6 parameters stdcall #ce Local $b = Binary("0x5589e5817d0c010400007513ff7514ff7510ff750cff751cb8")&Binary($pPostMessageW)&Binary("0xffd0ff7514ff7510ff750cff7508b8")&Binary($pDefSubclassProc)&Binary("0xffd05dc21800") EndIf Local $pMem = _MemVirtualAlloc(0, BinaryLen($b), $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) Local $t = DllStructCreate("byte[" & BinaryLen($b) & "]", $pMem) DllStructSetData($t, 1, $b) Return $pMem EndFunc Func _TrayNotify_Redirect($hWndRedirect) DllCall("comctl32.dll", "bool", "SetWindowSubclass", "hwnd", __TrayNotify_AutoItWinGetHandle(), "ptr", $__gpTrayNotifySubclassProc, "uint_ptr", $hWndRedirect, "dword_ptr", $hWndRedirect) EndFunc Func _TrayNotify_RemoveRedirect($hWndRedirect) DllCall("comctl32.dll", "bool", "RemoveWindowSubclass", "hwnd", __TrayNotify_AutoItWinGetHandle(), "ptr", $__gpTrayNotifySubclassProc, "uint_ptr", $hWndRedirect) EndFunc Func __TrayNotify_AutoItWinGetHandle() Local Static $h If IsHWnd($h) Then Return $h Local $t = AutoItWinGetTitle() AutoItWinSetTitle("096c7d2e-4d24-4103-9503-66748fa96cc7#" & @AutoItPID) $h = WinGetHandle("096c7d2e-4d24-4103-9503-66748fa96cc7#" & @AutoItPID) AutoItWinSetTitle($t) Return $h EndFunc Opt('TrayAutoPause', 0) Opt('WinTitleMatchMode', 3) Opt('WinWaitDelay', 0) Opt('TrayMenuMode', 3) Global $iTip = 2 Global $hForm = GUICreate('') DllOpen("comctrl32.dll") _TrayNotify_Redirect($hForm) GUIRegisterMsg($WM_TRAYNOTIFY, 'WM_TRAYNOTIFY') Global $iShow = TrayCreateItem("Show New Tip") TrayCreateItem("") Global $iExit = TrayCreateItem("Exit") TrayTip('Tip', 'This is a tray tip, click here.', 10, 1) While 1 Switch TrayGetMsg() Case $iShow TrayTip('Tip', 'This is a tray tip, click here. [ ' & $iTip & ' ]', 10, 1) $iTip += 1 Case $iExit ExitLoop EndSwitch WEnd _TrayNotify_RemoveRedirect($hForm) Func WM_TRAYNOTIFY($hWnd, $iMsg, $wParam, $lParam) Switch $hWnd Case $hForm Switch $lParam Case $NIN_BALLOONSHOW ConsoleWrite('Balloon tip show.' & @CR) Case $NIN_BALLOONHIDE ConsoleWrite('Balloon tip hide.' & @CR) Case $NIN_BALLOONUSERCLICK ConsoleWrite('Balloon tip click.' & @CR) Case $NIN_BALLOONTIMEOUT ConsoleWrite('Balloon tip close.' & @CR) EndSwitch EndSwitch EndFunc ;==>WM_TRAYNOTIFY
    2 points
  3. PhoenixXL

    MathsEx UDF

    I use Fractions Always In My Script But I never Found a UDF for That I made a UDF for Using So here I want to Share it I Named it MathsEx UDF but I Guess Fraction UDF would be Better It Requires Three Funtions Of Array.au3 Currently Supported Functions ; #INDEX# ======================================================================================================================= ; Title .........: MathsEx ; AutoIt Version : 3.2.10++ ; Language ......: English ; Description ...: Functions for Carrying Out More Advanced Mathematical Calculations. ; Author(s) .....: Phoenix XL ; Included.......: Three Functions of Array.au3 i.e. _ArraySort and _ArrayReverse and __ArrayQuickSort1D Requires Array.au3 ; =============================================================================================================================== ; 0xDead=57005...............I just Like The Number :) ; #CURRENT# ===================================================================================================================== ; _Find_GCF ; _Find_LCM ; _Subtract_Fraction ; _Add_Fraction ; _Multiply_Fraction ; _Divide_Fraction ; _Reciprocal ; _Compare_Fraction ; _Quotient ; _Simplify ; _IntegerisNegative ; _IntegerisPositive ; _Get_Denominator ; _Get_Numerator ; _To_Fraction ; _To_Mixed_Fraction ; _Is_Fraction_Improper ; _Is_Fraction_Proper ; _Is_Fraction ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ; _CheckArray ; _Greatest_Common_Factor ; _Operate_Fraction ; _Set_Sequence ; =============================================================================================================================== I havent Included Any Examples Yet The Documentation is Enough and Is Very Easy To Implement the Funtions Though If any Bug or Problem With The UDF Please Share It The UDF is Attached in the Post V1.1 = Fixed A Bug Regards Phoenix XL MathsEx V1.1.au3
    1 point
  4. jdelaney, I think Damein is looking at searching a drive(s) for a particular file. With 350+ posts I would hope he knows about FileExists.
    1 point
  5. spudw2k

    get tree path/value

    This seems to work. Had to modify _TreePath slightly. #include <GuiTreeView.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Global $txt, $item EBTAM() Func EBTAM() Global $treeview, $mapB, $ass, $app, $shp GUICreate("EB TAM", 600, 400) $treeview = GUICtrlCreateTreeView(20, 15, 560, 325, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $ass = GUICtrlCreateTreeViewItem("Test Assigned", $treeview) $app = GUICtrlCreateTreeViewItem("Testing Approved", $treeview) $shp = GUICtrlCreateTreeViewItem("Shipped", $treeview) $120 = GUICtrlCreateTreeViewItem("12.0", $ass) GUICtrlCreateTreeViewItem("US", $120) GUICtrlCreateTreeViewItem("CA", $120) GUICtrlCreateTreeViewItem("UK", $120) $mapB = GUICtrlCreateButton("&Map", 20, 350, 120, 40) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $mapB MsgBox(0, "node selected", "Node: " & _TreePath($treeview, $item)) EndSwitch WEnd EndFunc Func _TreePath($treeview, $item) ;Determine full path of selected item in TreeView $item = _GUICtrlTreeView_GetSelection($treeview) $txt = _GUICtrlTreeView_GetText($treeview, $item) Do $parent = _GUICtrlTreeView_GetParentHandle($treeview, $item) $txt = _GUICtrlTreeView_GetText($treeview, $parent) & "" & $txt $item = $parent Until $parent = 0 Return StringTrimLeft($txt,StringInstr($txt,"")) EndFunc ;==>;_TreePath
    1 point
  6. 1 point
  7. Using _IEFormElementRadioSelect() #include <IE.au3> $oIE = _IECreate("[url="http://www.ncbi.nlm.nih.gov/pubmed/22561075"]http://www.ncbi.nlm.nih.gov/pubmed/22561075[/url]") $oForm = _IEFormGetObjByName($oIE, "EntrezForm") $sRadioGroupName = "EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_DisplayBar.sPresentation" $sButtonName = "EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_DisplayBar.SetDisplay" _IELinkClickByText ($oIE, "Display Settings:") _IEFormElementRadioSelect($oForm, "xml", $sRadioGroupName, 1, "byValue") $oApply = _IEGetObjByName ($oIE, $sButtonName) _IEAction ( $oApply, 'click' ) Dale
    1 point
  8. Valik

    Latest Beta

    Special Note: This is an alpha release. No installer is provided for this release, only the stand-alone SFX archive. This alpha release contains a couple major changes to the language which can radically change the way scripts are written. The highlights are: The $ in variables is now optional. If you want to continue using $ to prefix your variables that is fine and will continue to be supported. If you'd rather drop the $ that is fine, too, though be aware you cannot have variables with the same name as functions unless you prefix the variable with $.Functions are now first class objects. That means you can assign a function to a variable an invoke that function through the variable. It is similar in behavior to function pointers. This is very useful for callbacks as well as writing interfaces that are decoupled from their implementation.3.3.9.5 (17th April, 2012) (Alpha) The following changes are script breaking changes: NOTE: WinAPIEx is included in this release. The files exist but there are no documentation or examples. Filenames and functions are subject to change or removal. Functions will be moved out to other files before the final release and the file WinAPIEx.au3 will likely not exist when that happens. Report issues here. Download here.
    1 point
×
×
  • Create New...