Jump to content

cryton2707

Active Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by cryton2707

  1. Just for fun I've made a text scroller.. This is my fist attempt at making a text scroller.. Thought I'd share with the forum.. http://dornochplace.com/Autoit/MyScroller.zip Enjoy
  2. O' Wow.. Thanks guys.. This is fantastic.. Just what I need.. Im trying to create a sin wave scroller.. and having never done one before.. This will really help me. (way cool) Thanks
  3. Im wanting to create a sin wave the width of the screen.. I did find some C code my maths aint up to the job of properly understanding the code.. can any one help me convert it .. Thanks CODE void draw_sine () { int length = 50; fixed x, y; fixed angle = 0; fixed angle_stepsize = itofix (5); while (fixtoi(angle) < 256) { // the angle is plotted along the x-axis x = angle; // the sine function is plotted along the y-axis y = length * fsin (angle); putpixel (screen, fixtoi (x), fixtoi (y) + SCREEN_H / 2, makecol (255, 255, 255)); angle += angle_stepsize; } } whats this fixtoi above and itofix used for above.. Thanks Chris
  4. Looks intresting.. I need to play with the code a little to A. completely understand it.. and B. see if I can make it do what I want Thanks for a pointer though
  5. Hi quick question.. Is it possible to say load a picture in one gui. then copy a section (x,y and x,y) of the picture to another gui? Ta
  6. Based on what Lod3n said for the second graphic I used.. CODE $minon=guicreate("minon", 38,28,532,-19,$WS_POPUP,BitOR($WS_EX_LAYERED,$WS_EX_MDICHILD),$Gui) GUICtrlCreatePic(@ScriptDir &"\minon.jpg",0, 0, 38,28) GUISetState() This creates a very small gui the size of my new graphic at the coords that I wanted my second graphic to appear at (overlayed on the first gui) then created a pic at 0,0 of this second gui So basically you create your fisrt background gui.. then create a new gui the size and shape of the graphic you want to create and then finally put a picture into the new gui. hope this sorta makes sence.
  7. Lod3n.. thanks very much that worked great for me Its a very nice include you've got. And no doupt I'll be using it a lot in the future Thanks again
  8. Thanks thanks for the pointer. Ive started looking at the stuff from PaulIA and Lod3n for making transparent gui's and xskin.
  9. Ive been playing with the A3LGDIPlus.au3 to create a vista type looking interface. My problem is that now I have a png for a background I'm unable to create a picture item above that without either having the script quit.. not showing the new picture or killing the transparency mask on the $controlGui. CODE#NoTrayIcon #include <A3LGDIPlus.au3> ; this is where the magic happens, people #include <GUIConstants.au3> Opt("MustDeclareVars", 0) Global Const $AC_SRC_ALPHA = 1 Global Const $ULW_ALPHA = 2 Global $old_string = "", $runthis = "" Global $launchDir = @DesktopDir global Const $title="WhoAmi" ; Load PNG file as GDI bitmap global $tempdir= @tempdir & "\test1" DirCreate ($tempdir) fileinstall("backdrop.png",$tempdir & "\backdrop.png",1) _GDIP_Startup() $pngSrc = $tempdir & "\backdrop.png" $hImage = _GDIP_ImageLoadFromFile($pngSrc) ; Extract image width and height from PNG $width = _GDIP_ImageGetWidth ($hImage) $height = _GDIP_ImageGetHeight($hImage) ; Create layered window $GUI = GUICreate($title, $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED) SetBitMap($GUI, $hImage, 0) ; Register notification messages GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") WinSetOnTop($gui,"",1) ;fade in png background for $i = 0 to 255 step 20 SetBitMap($GUI, $hImage, $i) next SetBitMap($GUI, $hImage, 255) GUISetState() $controlGui = GUICreate("ControlGUI", $width, $height, 0,0,$WS_POPUP,BitOR($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui) ; child window transparency is required to accomplish the full effect, so $WS_EX_LAYERED above, and ; I think the way this works is the transparent window color is based on the image you set here: GUICtrlCreatePic(@ScriptDir & "\grey.gif",0,0,$width,$height) GuiCtrlSetState(-1,$GUI_DISABLE) GUISetState() CREATEGUI() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd #ce ;fade gui then png background DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $controlGui, "int", 1000, "long", 0x00090000);fade-out for $i = 255 to 0 step -10 SetBitMap($GUI, $hImage, $i) next ; Release resources _API_DeleteObject($hImage) _GDIP_Shutdown() Exit Func CREATEGUI() ; Error HERE !!! ! $minon= GUICtrlCreatePic(@ScriptDir &"\minon.jpg", 200, 100, 38,28) $Group_2 = GUICtrlCreateGroup("Machine Details", 10, 30, 260, 170) GUISetBkColor($Group_2,) EndFunc ;==>CREATEGUI ; ==================================================================================================== =========================== ; Handle the WM_NCHITTEST for the layered window so it can be dragged by clicking anywhere on the image. ; ==================================================================================================== =========================== Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) if ($hWnd = $GUI) and ($iMsg = $WM_NCHITTEST) then Return $HTCAPTION EndFunc ; ==================================================================================================== =========================== ; SetBitMap ; ==================================================================================================== =========================== Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _API_GetDC(0) $hMemDC = _API_CreateCompatibleDC($hScrDC) $hBitmap = _GDIP_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _API_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize ) DllStructSetData($tSize, "X", _GDIP_ImageGetWidth ($hImage)) DllStructSetData($tSize, "Y", _GDIP_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha" , $iOpacity ) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _API_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _API_ReleaseDC (0, $hScrDC) _API_SelectObject($hMemDC, $hOld) _API_DeleteObject($hBitmap) _API_DeleteDC ($hMemDC) EndFunc ; I don't like AutoIt's built in ShellExec. I'd rather do the DLL call myself. Func _ShellExecute($sCmd, $sArg="", $sFolder = "", $rState = @SW_SHOWNORMAL) $aRet = DllCall("shell32.dll", "long", "ShellExecute", _ "hwnd", 0, _ "string", "", _ "string", $sCmd, _ "string", $sArg, _ "string", $sFolder, _ "int", $rState) If @error Then Return 0 $RetVal = $aRet[0] If $RetVal > 32 Then Return 1 else Return 0 EndIf EndFunc Any help would be greatly appreciated. Ta logo_ps.zip
  10. I'd do this more like CODE$path = "C:\windows\temp" RunWait(chr(34) & $path & "\WindowsXP-KB921398-x86-ENU.exe" &chr(34) &" /quiet /norestart", $path, @SW_ENABLE) the chr(34) will put " " around your execute. and using $path as a working dir makes you use the same workingdir as the executable.
  11. Hi, I'm wanting to completely remove a border from an executed program.. eg say Ive opened calc I'm wanting to get rid of the blue window border, the max, min, close buttons. I've looked at the user32.dll call to disable these.. But its two slow for my use and simply disables the buttons and doesn't remove them. My reason for this is that Ive been looking at the A3LGDIPlus.au3 and want to basically skin an existing application that Ive launched. Thanks for any help Chris
  12. Hi, I wonder if you can help me plz Ive got 2 transparent gifs and Im wanting to do a fade from one to the other. Now my problems are comming from. If I use WinSetTrans. then this a breaks the transparency of the gif and sets the transparency of the object, also it flickers badly. Also I want to fade just a component of the gui (not the whole gui) which I cant get to work with the dll call . CODEDllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 2000, "long", 0x00080000); fade-in gui as this wants to animate the whole window. Ideally I want to a. create a gui. b create a picture (transparent gif) and fade from gif A to gif B which is also a transparent gif. But I'd settle for a gui with an element that I can fade one gif out and fade another gif in. can any one help Thanks is advance
  13. take a look at devcon from Microsoft. Its a program to allow you to control your hardware devices.. i.e disable a nic / modem or some other devices. You can automate its calling from autoit with the device paramters you want to use. http://support.microsoft.com/kb/311272/ Will do what your wanting.
  14. Try this.. While 1 $pos = MouseGetPos() If $pos[0] = 1011 & $pos[1] = 10 Then Run("rundll32.exe user32.dll, LockWorkStation") endif sleep(100) WEnd You were only collecting the mouse coords out with your loop. So for it to have work you would have to had the mouse at the coords 1011x10 for the start of the program. Also rember that this is pixel perfect.. so you need to be at the coords exactly. (you could add a little + or - 5 pixels..) L8r
  15. Was there an update to this thread? Im intrsted in doing some multicasting also.. Cheers
  16. Hi all, Im woundering if anyone has done this.. but basically I want to capture the out put to a console.. and pull it into an auto it script. simple example would be if you Run(@systemdir &"\cmd.exe /k dir c:\ /w") this basically calls dir in a window. I could redicret the out put fro mthe command to a file and then read the file from autoit but would much rather prefer to grab the output directly from the window. Anyone know how to do this? Any help most appreciated..
  17. Hi, Anyone know if a compiled AutoIT script works under DOS.. (Thats not a dos window but actual DOS. I'm not wanting to run any GUI commands but just file type commands.. (basically use autoit to edit the contents of an existing text file) Cheers
  18. Hello all, Basically I have a script that modifies a graphic then copies it to the clip board and then uses paint to then save this as a new bmp. My problem is that on some machines the spoolsrv.exe can pop up a dialogue for some error reading memory locations. This dialogue popping up though takes focus from the window the script is running it.. and the script stops dead until you close the dialogue and re focus the window. Anyone know how I can event trap this. Iits not happening on all machines I run the script on and its not at a specified time.. So Ideally I'd like to event trap it so that I can then close the dialogue and continue my script.. Can any one please please please help me with this Thanks
  19. Im new to autoit and espcially the gui functions.. Can anyone please tell me the code to create a Gui with no border (no minimise icons or maximize icon or close icon) or with as little border as possible.. thanks
  20. thanks guys the paste screen cap and save seams to be probably the most easy to implement So I'll try that then post any code Ive got.. Thanks again
  21. I need a function to basically read some text from the registry and then modify an existing bitmap to put the text in the bitmap. anyone know how to do this?? Thanks
×
×
  • Create New...