SHARE
TWEET

Untitled

Cerberus_tm Feb 25th, 2020 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Barnacle.ahk
  2. ; Add toolbars to your favorite programs
  3. ;Skrommel @ 2008
  4.  
  5. FileInstall,Barnacle.rtf,Barnacle.rtf
  6. FileCreateDir,Toolbars
  7. FileInstall,Toolbars\Calc.ini,Toolbars\Calc.ini
  8. FileInstall,Toolbars\Notepad.ini,Toolbars\Notepad.ini
  9. FileCreateDir,Images
  10. FileInstall,Images\EditCut.ico,Images\EditCut.ico
  11.  
  12. #SingleInstance,Force
  13. #NoEnv
  14. SetBatchLines,-1
  15. SetWinDelay,0
  16. Gui -DPIScale
  17.  
  18. applicationname=Barnacle
  19.  
  20. SysGet,menuh,15 ;SM_CYMENU
  21.  
  22. Gosub,INIREAD
  23. Gosub,TRAYMENU
  24. Gosub,START
  25. OnExit,EXIT
  26.  
  27. ids=
  28. Loop
  29. {
  30.     Sleep,100
  31.     WinGet,activeid,ID,A
  32.     WinGetClass,class,ahk_id %activeid%
  33.     MouseGetPos,mx,my,mid,mctrl
  34.     WinGetClass,mclass,ahk_id %mid%
  35.  
  36.     active=0
  37.     Loop,% toolbars
  38.     {
  39.         currentclass:=%A_Index%class
  40.         If (class=currentclass)
  41.         {
  42.             hWnd:=activeid
  43.             active:=A_Index
  44.             IfNotInString,ids,%hWnd%`,
  45.             {
  46.                 ids=%ids%%hWnd%,
  47.                 %hWnd%new:=MENU(hWnd)
  48.             }
  49.             Gosub,PAINT
  50.         }
  51.         If (mclass=currentclass)
  52.         {
  53.             hWnd:=mid
  54.             active:=A_Index
  55.             IfNotInString,ids,%hWnd%`,
  56.             {
  57.                 ids=%ids%%hWnd%,
  58.                 %hWnd%new:=MENU(hWnd)
  59.             }
  60.             Gosub,PAINT
  61.         }
  62.     }
  63.  
  64.     If (active>0 And mclass=class And mx>=toolbarx And mx<toolbarx+toolbarw And my>=toolbary And my<=toolbary+toolbarh)
  65.     {
  66.         If hotkeys<>On
  67.         {
  68.             Hotkey,$~LButton,LEFT,On
  69.             Hotkey,$~RButton,RIGHT,On
  70.             Hotkey,$~MButton,MIDDLE,On
  71.         }
  72.         oldbutton:=button
  73.         button:=Ceil((mx-cxWindowBorders+1)/buttonw)
  74.         If (button<>oldbutton)
  75.         {
  76.             tooltip:=%active%tip%button%
  77.             ToolTip,%tooltip%,% toolbarx+button*buttonw,% toolbary+buttonh+10
  78.         }
  79.         hotkeys=On
  80.     }
  81.     Else
  82.     If hotkeys=On
  83.     {
  84.         Hotkey,$LButton Up,LEFTUP,Off
  85.         Hotkey,$RButton Up,RIGHTUP,Off
  86.         Hotkey,$MButton Up,MIDDLEUP,Off
  87.         Hotkey,$~LButton,LEFT,Off
  88.         Hotkey,$~RButton,RIGHT,Off
  89.         Hotkey,$~MButton,MIDDLE,Off
  90.         button=
  91.         ToolTip,
  92.         Hotkeys=Off
  93.     }
  94.  
  95.     If showinfo=1
  96.     {
  97.         PixelGetColor,mcolor,%mx%,%my%,RGB
  98.         StringTrimLeft,mcolor,mcolor,2
  99.         TrayTip,%applicationname%,X: %mx% Y:%my%`nClass: %mclass%`nControl: %mctrl%`nColor: %mcolor%
  100.     }
  101. }
  102. Return
  103.  
  104.  
  105. LEFT:
  106. RIGHT:
  107. MIDDLE:
  108. Hotkey,$LButton Up,LEFTUP,On
  109. Hotkey,$RButton Up,RIGHTUP,On
  110. Hotkey,$MButton Up,MIDDLEUP,On
  111. Hotkey,$~LButton,LEFT,Off
  112. Hotkey,$~RButton,RIGHT,Off
  113. Hotkey,$~MButton,MIDDLE,Off
  114. ToolTip,%tooltip%,% toolbarx+button*buttonw,% toolbary+buttonh
  115. Return
  116.  
  117. LEFTUP:
  118. action:=%active%leftaction%button%
  119. ToolTip,%action%,% toolbarx+button*buttonw,% toolbary+buttonh ;Left %active% %button%:
  120. Gosub,ACTION
  121. Return
  122.  
  123. RIGHTUP:
  124. action:=%active%rightaction%button%
  125. ToolTip,%action%,% toolbarx+button*buttonw,% toolbary+buttonh ;Right %active% %button%:
  126. Gosub,ACTION
  127. Return
  128.  
  129. MIDDLEUP:
  130. action:=%active%middleaction%button%
  131. ToolTip,%action%,% toolbarx+button*buttonw,% toolbary+buttonh ;Middle %active% %button%:
  132. Gosub,ACTION
  133. Return
  134.  
  135.  
  136. ACTION:
  137. IfInString,action,Send`,
  138. {
  139.     StringTrimLeft,action,action,5
  140.     Send,%action%
  141. }
  142. IfInString,action,Run`,
  143. {
  144.     StringTrimLeft,action,action,4
  145.     StringSplit,action_,action,`,
  146.     Run,%action_1%,%action_2%,%action_3%
  147. }
  148. IfInString,action,Control`,
  149. {
  150.     StringTrimLeft,action,action,8
  151.     StringSplit,action_,action,`,
  152.     ControlClick,%action_1%,ahk_id %hWnd%,,%action_2%,%action_3%,%action_4%
  153. }
  154. IfInString,action,Menu`,
  155. {
  156.     StringTrimLeft,action,action,5
  157.     StringSplit,action_,action,`,
  158.     If action_1=0&
  159.     {
  160.         StringTrimRight,item_2,action_2,1
  161.         hSysMenu:=DllCall("GetSystemMenu", "Uint", hWnd, "int", False)
  162.         If action_0=2
  163.         {
  164.             nID         :=DllCall("GetMenuItemID", "Uint", hSysMenu, "int", item_2-1) ; produce -1 for a SubMenu item
  165.             PostMessage, 0x112, nID, 0, , ahk_id %hWnd%     ; WM_SYSCOMMAND
  166.         }
  167.         Else
  168.         {
  169.             StringTrimRight,item_2,action_2,1
  170.             StringTrimRight,item_3,action_3,1
  171.             hSysMenu:=DllCall("GetSubMenu", "Uint", hSysMenu, "int", item_2-1)
  172.             nID         :=DllCall("GetMenuItemID", "Uint", hSysMenu, "int", item_3-1)
  173.             PostMessage, 0x112, nID, 0, , ahk_id %hWnd%     ; WM_SYSCOMMAND
  174.         }
  175.     }
  176.     Else
  177.         WinMenuSelectItem,ahk_id %hWnd%,,%action_1%,%action_2%,%action_3%,%action_4%,%action_5%,%action_6%
  178. }
  179. IfInString,action,Mouse`,
  180. {
  181.     StringTrimLeft,action,action,6
  182.     StringSplit,action_,action,`,
  183.     If action_5=Screen
  184.         CoordMode,Mouse,Screen
  185.     MouseClick,%action_1%,%action_2%,%action_3%,%action_4%,%action_5%
  186.     If action_5=Screen
  187.         CoordMode,Mouse,Relative
  188. }
  189. IfInString,action,Window`,
  190. {
  191.     StringTrimLeft,action,action,7
  192.     StringSplit,action_,action,`,
  193.     If action_1=Move
  194.         WinMove,ahk_id %hWnd%,,%action_2%,%action_3%,%action_4%,%action_5%
  195.     If action_1=AlwaysOnTop
  196.         WinSet,AlwaysOnTop,Toggle,ahk_id %hWnd%,,
  197.     If action_1=Bottom
  198.         WinSet,Bottom,,ahk_id %hWnd%,,
  199. }
  200. Return
  201.  
  202.  
  203. MENU(hWnd)
  204. {
  205.     hMenu :=DllCall("GetMenu","UInt",hWnd)
  206.     If hMenu=0
  207.     {
  208.         hMenu :=DllCall("CreateMenu")
  209.         DllCall("SetMenu","UInt",hWnd,"UInt",hMenu)
  210.         uFlags:=0x1 | 0x4000 ;MF_BITMAP:=0x0004 MF_MENUBREAK:=0x40 MF_GRAYED:=0x1 MF_RIGHTJUSTIFY:=0x4000 MF_OWNERDRAW:=0x0100
  211.         new=1
  212.     }
  213.     Else
  214.     {
  215.         uFlags:=0x40 | 0x1 | 0x4000 ;MF_BITMAP:=0x0004 MF_MENUBREAK:=0x40 MF_GRAYED:=0x1 MF_RIGHTJUSTIFY:=0x4000 MF_OWNERDRAW:=0x0100
  216.         new=0
  217.     }
  218.     lpNewItem:=applicationname
  219.     VarSetCapacity(uIDNewItem,4,1)
  220.     DllCall("AppendMenu",UInt,hMenu,UInt,uFlags,UInt,&uIDNewItem,STR,lpNewItem)
  221.     DllCall("DrawMenuBar",UInt,hWnd)
  222.     Return,%new%
  223. }
  224.  
  225.  
  226. START:
  227.    Gui,+ToolWindow +AlwaysOnTop
  228.     Gui,1:Add,Text,,Loading images...
  229.     Gui,1:Show,w200 h200, Barnacle
  230.  
  231.     SysGet,iconw,11 ;SM_CXICON
  232.     SysGet,iconh,12 ;SM_CYICON
  233.  
  234.     ScreenDC    :=DllCall("GetWindowDC",UInt,0)
  235.     MemDC         :=DllCall("CreateCompatibleDC",UInt,ScreenDC)
  236.     MemBmp        :=DllCall("CreateCompatibleBitmap",UInt,ScreenDC,UInt,A_ScreenWidth,UInt,toolbars*buttonh)
  237.     oldMemBmp :=DllCall("SelectObject",UInt,MemDC,UInt,MemBmp)
  238.  
  239.     hBrush:=DllCall("GetStockObject",UInt,18)    ;DC_BRUSH
  240.                     DllCall("SelectObject",UInt,MemDC,UInt,hBrush)
  241.    
  242.     buttony:=-buttonh
  243.     Loop,%toolbars%
  244.     {
  245.         toolbar:=A_Index
  246.         buttony+=%buttonh%
  247.         buttons:=%toolbar%buttons
  248.         buttonx:=-buttonw
  249.  
  250.         color:=%toolbar%color
  251.         StringLeft,left,color,2
  252.         StringTrimLeft,color,color,2
  253.         hColor:="0x00" . color . left    ;0x00bbggrr
  254.         DllCall("SetDCBrushColor",UInt,MemDC,UInt,hColor)
  255.         VarsetCapacity(rect,16,0)
  256.         InsertInteger(0,rect,0)
  257.         InsertInteger((toolbar-1)*buttonh,rect,4)
  258.         InsertInteger(A_ScreenWidth,rect,8)
  259.         InsertInteger(toolbar*buttonh,rect,12)
  260.         DllCall("FillRect",UInt,MemDC,"Ptr",&rect,UInt,hBrush)
  261.         InsertInteger(0,rect,0)
  262.         InsertInteger(0,rect,4)
  263.         InsertInteger(iconw,rect,8)
  264.         InsertInteger(iconh,rect,12)
  265.    
  266.         DllCall("SetStretchBltMode",UInt,MemDC,Int,4)    ; Halftone better quality
  267.  
  268.         Loop,%buttons%
  269.         {
  270.             button:=A_Index
  271.             image:=%toolbar%image%button%
  272.             buttonx+=%buttonw%
  273.  
  274.             guiw=  ;1000
  275.             width=  ;1000
  276.             Loop
  277.             {
  278.                 Gui,2:-Caption -Border +ToolWindow +AlwaysOnTop
  279.                 ; Gui,2:+AlwaysOnTop
  280.                 Gui,2:Margin,0,0
  281.                 color:=%toolbar%color
  282.                 Gui,2:Color,%color%
  283.                 StringSplit,image_,image,`,
  284.                 If image_2<>
  285.                     image_2=Icon%image_2%
  286.                 If guiw and guiw != 0
  287.                     width := W%guiw%
  288.                 ; Gui,2:Add,Picture,W%guiw% H-1 %image_2%,%image_1%
  289.                 Gui,2:Add,Picture,%width% H-1 %image_2%,%image_1%
  290.                 Gui,2:Show,NoActivate,Barnacle Icon Loader
  291.                 ; Gui,2:Show,,Barnacle Icon Loader
  292.                 WinGet,guiid,Id,Barnacle Icon Loader
  293.                 WinGetPos,guix,guiy,guiw,guih,ahk_id %guiid%
  294.                 ; If A_Index = 1
  295.                 ;     Msgbox % guiw
  296.                 If (guiw<=A_ScreenWidth And guiw<=A_ScreenHeight)
  297.                     Break
  298.                 Gui,2:Destroy
  299.                 guiw/=10
  300.             }
  301.             LoadDC:=DllCall("GetWindowDC",UInt,guiid)
  302.             DllCall("StretchBlt",UInt
  303.                             ,MemDC,Int,buttonx+(buttonw-imagew)/2,Int,buttony+(buttonh-imageh)/2,Int,imagew,Int,imageh,UInt
  304.                             ,LoadDC,Int,0,Int,0,Int,guiw,Int,guih,UInt,0x00CC0020)
  305.             Gui,2:Destroy
  306.         }
  307.     }
  308.     Gui,1:Destroy
  309.  
  310.     VarSetCapacity(pwi,64,0)    ;windowinfo
  311.     InsertInteger(64,pwi,0)     ;cbSize
  312.     VarSetCapacity(pbmi,32,0) ;menubarinfo
  313.     InsertInteger(32,pbmi,0)    ;cbSize
  314. Return
  315.  
  316.  
  317. PAINT:
  318. DllCall("GetWindowInfo",UInt,hwnd,"Ptr",&pwi)
  319.    
  320.     rcWindow_left    :=ExtractInteger(pwi,4,True)
  321.     rcWindow_top     :=ExtractInteger(pwi,8,True)
  322.     rcWindow_right :=ExtractInteger(pwi,12,True)
  323.     rcWindow_bottom:=ExtractInteger(pwi,16,True)
  324.     rcClient_left    :=ExtractInteger(pwi,20,True)
  325.     rcClient_top     :=ExtractInteger(pwi,24,True)
  326. ; rcClient_right :=ExtractInteger(pwi,28,True)
  327.     rcClient_bottom:=ExtractInteger(pwi,32,True)
  328. ; dwStyle                :=ExtractInteger(pwi,36,True)
  329. ; dwExstyle            :=ExtractInteger(pwi,40,True)
  330. ; dwWindowStatus :=ExtractInteger(pwi,44,True)
  331.     cxWindowBorders:=ExtractInteger(pwi,48,True)
  332.     cyWindowBorders:=ExtractInteger(pwi,52,True)
  333. ; atomWindowType :=ExtractInteger(pwi,56,True)
  334. ; wCreatorVersion:=ExtractInteger(pwi,60,True)
  335.    
  336.     toolbarx:=rcClient_left-rcWindow_left
  337.     toolbary:=rcClient_top-buttonh-rcWindow_top
  338. ;    toolbarw:=rcClient_right-rcClient_left
  339.     toolbarh:=buttonh
  340.     toolbartest:=rcClient_bottom-rcClient_top
  341.     If (toolbartest=0)
  342.         toolbarh:=0
  343.  
  344. DllCall("GetMenuBarInfo",Int,hWnd,Int,0xFFFFFFFD,Int,0,"Ptr",&pbmi)        ;idObject=OBJID_MENU    ;idItem
  345.  
  346. ; rcBar_left    :=ExtractInteger(pbmi,4,False)
  347. ; rcBar_top     :=ExtractInteger(pbmi,8,False)
  348.     rcBar_right :=ExtractInteger(pbmi,12,False)
  349. ; rcBar_bottom:=ExtractInteger(pbmi,16,False)
  350.  
  351.     toolbarw:=rcBar_right
  352.  
  353.     ScreenDC:=DllCall("GetWindowDC",UInt,hWnd)
  354.                         DllCall("StretchBlt",UInt
  355.                                         ,ScreenDC,Int,toolbarx,Int,toolbary,Int,toolbarw,Int,toolbarh,UInt
  356.                                         ,MemDC,Int,0,Int,(active-1)*buttonh,Int,toolbarw,Int,toolbarh,UInt,0x00CC0020 )
  357. Return
  358.  
  359.  
  360. STOP:  
  361.     DllCall("DeleteObject",UInt,MemBmp)
  362.     DllCall("DeleteDC"        ,UInt,MemDC )
  363.  
  364.     Loop,Parse,ids,`,
  365.     {
  366.         hWnd:=A_LoopField
  367.         hMenu:=DllCall("GetMenu",UInt,hWnd)
  368.         IfWinExist,ahk_id %hWnd%
  369.         {
  370.             nPos:=DllCall("GetMenuItemCount",UInt,hMenu)-1
  371.             If nPos>0
  372.             {
  373.                 menuid:=DllCall("GetMenuItemID",UInt,hMenu,Int,nPos)
  374.                
  375.                 uFlags:=0x0 ;MF_BYCOMMAND:=0x0 MF_BYPOSITION:=0x40
  376.                 DllCall("RemoveMenu",UInt,hMenu,UInt,menuid,UInt,uFlags)
  377.                 DllCall("DeleteMenu",UInt,hMenu,UInt,menuid,UInt,uFlags)
  378.                 DllCall("DrawMenuBar",UInt,hWnd)
  379.             }
  380.         }
  381.         If (%hWnd%new=1)
  382.         {
  383.             DllCall("DestroyMenu",UInt,hMenu)
  384.             DllCall("SetMenu",UInt,hWnd,UInt,0)
  385.         }
  386.     }
  387. Return
  388.  
  389.  
  390. ExtractInteger(ByRef pSource, pOffset = 0, pIsSigned = false, pSize = 4)
  391. ; pSource is a string (buffer) whose memory area contains a raw/binary integer at pOffset.
  392. ; The caller should pass true for pSigned to interpret the result as signed vs. unsigned.
  393. ; pSize is the size of PSource's integer in bytes (e.g. 4 bytes for a DWORD or Int).
  394. ; pSource must be ByRef to avoid corruption during the formal-to-actual copying process
  395. ; (since pSource might contain valid data beyond its first binary zero).
  396. {
  397.         Loop %pSize%    ; Build the integer by adding up its bytes.
  398.                 result += *(&pSource + pOffset + A_Index-1) << 8*(A_Index-1)
  399.         if (!pIsSigned OR pSize > 4 OR result < 0x80000000)
  400.                 return result    ; Signed vs. unsigned doesn't matter in these cases.
  401.         ; Otherwise, convert the value (now known to be 32-bit) to its signed counterpart:
  402.         return -(0xFFFFFFFF - result + 1)
  403. }
  404.  
  405. InsertInteger(pInteger, ByRef pDest, pOffset = 0, pSize = 4)
  406. ; The caller must ensure that pDest has sufficient capacity.    To preserve any existing contents in pDest,
  407. ; only pSize number of bytes starting at pOffset are altered in it.
  408. {
  409.         Loop %pSize%    ; Copy each byte in the integer into the structure as raw binary data.
  410.                 DllCall("RtlFillMemory", "UInt", &pDest + pOffset + A_Index-1, "UInt", 1, "UChar", pInteger >> 8*(A_Index-1) & 0xFF)
  411. }
  412.  
  413.  
  414. INIREAD:
  415. IfNotExist,%applicationname%.ini
  416. {
  417. ini=
  418. (
  419. [Settings]
  420. buttonh=
  421. buttonw=
  422. imagew=16
  423. imageh=16
  424. )
  425. FileAppend,%ini%,%applicationname%.ini
  426. Gosub,HELP
  427. }
  428.  
  429. IniRead,buttonw,%applicationname%.ini,Settings,buttonw
  430. If (buttonw="" Or buttonw="Error")
  431.     buttonw:=menuh
  432. IniRead,buttonh,%applicationname%.ini,Settings,buttonh
  433. If (buttonh="" Or buttonh="Error")
  434.     buttonh:=menuh
  435. IniRead,imagew,%applicationname%.ini,Settings,imagew
  436. If (imagew="" Or imagew="Error")
  437.     imagew:=16
  438. IniRead,imageh,%applicationname%.ini,Settings,imageh
  439. If (imageh="" Or imageh="Error")
  440.     imageh:=16
  441.  
  442. Loop,Toolbars\*.ini
  443. {
  444.     toolbar:=A_Index
  445.     filename=Toolbars\%A_LoopFileName%
  446.     IniRead,%toolbar%class,%filename%,Settings,class
  447.     IniRead,%toolbar%color,%filename%,Settings,color
  448.     Loop
  449.     {
  450.         button:=A_Index
  451.         IniRead,%toolbar%image%button%,%filename%,%button%,image
  452.         If %toolbar%image%button%=Error
  453.             Break
  454.         IniRead,%toolbar%leftaction%button%,%filename%,%button%,leftaction
  455.         IniRead,%toolbar%rightaction%button%,%filename%,%button%,rightaction
  456.         IniRead,%toolbar%middleaction%button%,%filename%,%button%,middleaction
  457.         IniRead,%toolbar%tip%button%,%filename%,%button%,tip
  458.     }
  459.     %toolbar%buttons:=button-1
  460. }
  461. toolbars:=toolbar
  462. Return
  463.  
  464.  
  465. TRAYMENU:
  466.    Menu,Tray,NoStandard
  467.     Menu,Tray,DeleteAll
  468.     Menu,Tray,Add,%applicationname%,ABOUT
  469.     Menu,Tray,Add,
  470.     Menu,Tray,Default,%applicationname%
  471.     Menu,Tray,Add,Show &Info...,SHOWINFO
  472.     Menu,Tray,Add,&Settings...,SETTINGS
  473.     Menu,Tray,Add,&About...,ABOUT
  474.     Menu,Tray,Add,&Help...,HELP
  475.     Menu,Tray,Add,E&xit,EXIT
  476.     Menu,Tray,Tip,%applicationname%
  477. Return
  478.  
  479.  
  480. SHOWINFO:
  481.    If showinfo=1
  482.         showinfo=0
  483.     Else
  484.         showinfo=1
  485. Return
  486.  
  487.  
  488. SETTINGS:
  489.    Run,%A_ScriptDir%
  490. Return
  491.  
  492.  
  493. HELP:
  494.    Run,Barnacle.rtf
  495. Return
  496.  
  497.  
  498. ABOUT:
  499.    Gui,Destroy
  500.     Gui,Margin,20,20
  501.     Gui,Add,Picture,xm Icon1,%applicationname%.exe
  502.     Gui,Font,Bold
  503.     Gui,Add,Text,x+10 yp+10,%applicationname% v0.992
  504.     Gui,Font
  505.     Gui,Add,Text,y+10,Add toolbars to your favorite programs.
  506.     Gui,Add,Text,y+10,- To find out more, choose Help in the tray menu.
  507.  
  508.     Gui,Add,Picture,xm y+20 Icon2,%applicationname%.exe
  509.     Gui,Font,Bold
  510.     Gui,Add,Text,x+10 yp+10,1 Hour Software by Skrommel
  511.     Gui,Font
  512.     Gui,Add,Text,y+10,For more tools, information and donations, please visit
  513.     Gui,Font,CBlue Underline
  514.     Gui,Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com
  515.     Gui,Font
  516.  
  517.     Gui,Add,Picture,xm y+20 Icon7,%applicationname%.exe
  518.     Gui,Font,Bold
  519.     Gui,Add,Text,x+10 yp+10,DonationCoder
  520.     Gui,Font
  521.     Gui,Add,Text,y+10,Please support the contributors at
  522.     Gui,Font,CBlue Underline
  523.     Gui,Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com
  524.     Gui,Font
  525.  
  526.     Gui,Add,Picture,xm y+20 Icon6,%applicationname%.exe
  527.     Gui,Font,Bold
  528.     Gui,Add,Text,x+10 yp+10,AutoHotkey
  529.     Gui,Font
  530.     Gui,Add,Text,y+10,This tool was made using the powerful
  531.     Gui,Font,CBlue Underline
  532.     Gui,Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com
  533.     Gui,Font
  534.  
  535.     Gui,Show,,%applicationname% About
  536.    
  537.     hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
  538.     OnMessage(0x200,"WM_MOUSEMOVE")
  539. Return
  540.  
  541. 1HOURSOFTWARE:
  542.    Run,http://www.1hoursoftware.com,,UseErrorLevel
  543. Return
  544.  
  545. DONATIONCODER:
  546.    Run,http://www.donationcoder.com,,UseErrorLevel
  547. Return
  548.  
  549. AUTOHOTKEY:
  550.    Run,http://www.autohotkey.com,,UseErrorLevel
  551. Return
  552.  
  553. ABOUTOK:
  554.    Gui,Destroy
  555.     OnMessage(0x200,"")
  556.     DllCall("DestroyCursor","Uint",hCur)
  557. Return
  558.  
  559. WM_MOUSEMOVE(wParam,lParam)
  560. {
  561.     Global hCurs
  562.     MouseGetPos,,,,ctrl
  563.     If ctrl in Static8,Static12,Static16
  564.         DllCall("SetCursor","UInt",hCurs)
  565.     Return
  566. }
  567.  
  568. ~Escape::
  569. EXIT:
  570. Gosub,STOP
  571. ExitApp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top