Jump to content

CrewXp

Active Members
  • Posts

    302
  • Joined

  • Last visited

Everything posted by CrewXp

  1. I have a function that sits in the background calling _IETableGetCollection every 5 seconds. During that time (No matter if the Browser is hidden or I use an embedded IE Control), my mouse cursor changes from the normal cursor to a loading one. It's annoying the people who use my app a bit. Is there a way to disable that ability that IE uses? Thanks!
  2. Hi. I have tried using WS_DISABLED and even the peventing focus on guicreate, but I can't seem to get it to work. Is there a way to make a Gui always on top, but not focusable? I want to create an overlay or quick popup that doesn't take away focus from our applications we use. Can you still make it clickable (call a function when clicked, but still dont lose focus on the other application) if you do this?
  3. Thanks for the assist! Here is a 'working' copy of the code above. (includes and even test png). Your example uses gui get messages, I am using the gdiplus include, so I'm not sure how to make mine as yours functions. I tried using But it didn't do anything... Code: ;GUI Stuff #include <GDIPlus.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> HotKeySet('{esc}','_exit'); ALT+1 Show / Hode Gui to tray $toast_x=300 $toast_y=50 InetGet("http://dummyimage.com/300x50/000/fff",@ScriptDir&"\blank.png") Global $sFile = InetRead("http://dummyimage.com/300x50/000/fff"); @ProgramFilesDir & "\AutoIt3\Examples\GUI\Torus.png" Func Test() Msgbox(0,"","") EndFunc Func _exit() Exit EndFunc Func Loader($type,$x, $y) $loc=@ScriptDir&"\blank.png" _GDIPlus_Startup() $GUI = _GUICreate_Alpha("Look at the shiny", $loc, $x, $y) GuiSetOnEvent($GUI_EVENT_PRIMARYDOWN,"Test") $myGuiHandle = WinGetHandle("Look at the shiny") GLOBAL $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($myGuiHandle) GUISetState() $hwnd = GUICreate("ControlGUI", $toast_x,$toast_y, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $myGuiHandle) GUISetBkColor(0xABCDEF) ;Failed attempt to use dllcall to slide down and fade in as it slides. Shows a random weird blue box ;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 270, "long", 0x00040004) ; $SLIDE IN FROM TOP ;DOESNT WORK!!!! #define AW_HOR_POSITIVE 0x00000001 #define AW_HOR_NEGATIVE 0x00000002 #define AW_VER_POSITIVE 0x00000004 #define AW_VER_NEGATIVE 0x00000008 #define AW_CENTER 0x00000010 #define AW_HIDE 0x00010000 #define AW_ACTIVATE 0x00020000 #define AW_SLIDE 0x00040000 #define AW_BLEND 0x00080000 If $type=1 Then GLOBAL $obj_e1 = GUICtrlCreateLabel('Elevator 1: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf If $type=2 Then GLOBAL $obj_e2 = GUICtrlCreateLabel('Elevator 2: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf If $type=3 Then GLOBAL $obj_e3 = GUICtrlCreateLabel('Elevator 3: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf If $type=4 Then GLOBAL $obj_m1 = GUICtrlCreateLabel('Main Entrance: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, 255) ;Failed Attempt to manually slide the gui down from top. Moves, but doesnt move text with it. And Cant fade using this For $i=100 to 0 Step -1 WinMove($myGuiHandle, "", $x, $y-$i, $toast_x, $toast_y) If $i=100 Then GUISetState(@SW_SHOW,$myGuiHandle) Sleep(1) Next GUISetState(@SW_SHOW,$hwnd) EndFunc Func _GUICreate_Alpha($sTitle, $sPath, $iX=-1, $iY=-1, $iOpacity=255) Local $hGUI, $hImage, $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hImage = _GDIPlus_ImageLoadFromFile($sPath) $width = _GDIPlus_ImageGetWidth($hImage) $height = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate($sTitle, $width, $height, $iX, $iY, $WS_POPUP, $WS_EX_LAYERED) $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", $width) DllStructSetData($tSize, "Y", $height) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, 2) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hImage) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>_GUICreate_Alpha Loader(1,0,0) While 1 Sleep(1000) WEnd
  4. Lol... argh. Okay. Sorry, it was 4am yesterday when I was trying to figure it out. Code: Func Test() Msgbox(0,"","") EndFunc Func Loader($type,$x, $y) $loc="D:\Development\AutoIt\TestToast.png" _GDIPlus_Startup() $GUI = _GUICreate_Alpha("Look at the shiny", $loc, $x, $y) GuiSetOnEvent($GUI_EVENT_PRIMARYDOWN,"Test") $myGuiHandle = WinGetHandle("Look at the shiny") GLOBAL $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($myGuiHandle) GUISetState() $hwnd = GUICreate("ControlGUI", $toast_x,$toast_y, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $myGuiHandle) GUISetBkColor(0xABCDEF) ;Failed attempt to use dllcall to slide down and fade in as it slides. Shows a random weird blue box ;DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 270, "long", 0x00040004) ; $SLIDE IN FROM TOP ;DOESNT WORK!!!! #define AW_HOR_POSITIVE 0x00000001 #define AW_HOR_NEGATIVE 0x00000002 #define AW_VER_POSITIVE 0x00000004 #define AW_VER_NEGATIVE 0x00000008 #define AW_CENTER 0x00000010 #define AW_HIDE 0x00010000 #define AW_ACTIVATE 0x00020000 #define AW_SLIDE 0x00040000 #define AW_BLEND 0x00080000 If $type=1 Then GLOBAL $obj_e1 = GUICtrlCreateLabel('Elevator 1: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf If $type=2 Then GLOBAL $obj_e2 = GUICtrlCreateLabel('Elevator 2: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf If $type=3 Then GLOBAL $obj_e3 = GUICtrlCreateLabel('Elevator 3: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf If $type=4 Then GLOBAL $obj_m1 = GUICtrlCreateLabel('Main Entrance: Uninitialized', 35, 19, 150, 25) GUICtrlSetColor(-1, 0xFFFFFF) EndIf _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, 255) ;Failed Attempt to manually slide the gui down from top. Moves, but doesnt move text with it. And Cant fade using this For $i=100 to 0 Step -1 WinMove($myGuiHandle, "", $x, $y-$i, $toast_x, $toast_y) If $i=100 Then GUISetState(@SW_SHOW,$myGuiHandle) Sleep(1) Next GUISetState() EndFunc Func _GUICreate_Alpha($sTitle, $sPath, $iX=-1, $iY=-1, $iOpacity=255) Local $hGUI, $hImage, $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hImage = _GDIPlus_ImageLoadFromFile($sPath) $width = _GDIPlus_ImageGetWidth($hImage) $height = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate($sTitle, $width, $height, $iX, $iY, $WS_POPUP, $WS_EX_LAYERED) $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", $width) DllStructSetData($tSize, "Y", $height) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, 2) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteObject($hImage) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>_GUICreate_Alpha What I can't get: -Clicking on the GUI After it's setup make it call a function. -Having the gui/toast slide in from the top and fade in as it slides. Manually moving using WinMove only moves png, not text. Using the dllcall animates a random weird blue box.
  5. I used to know how to do this, but I took a 3 year break from autoit lol. Is it possible (without making an invisible ctrl overlaying my gui) to detect if my GUI is clicked on? I have it set that if I click it, my current application does not lose focus. It is just an overlay/toast. I made my gui using gdiplus and a transparent PNG. I tried using $GUI_EVENT_PRIMARYDOWN, but nothing happens when I press my mouse down on it.
  6. I'm not sure how to go about this. I'm trying to use Autoit to (in the background), click a button on a webpage. The webpage is coded poorly and uses tons of frames within frames. If I right click and view source, I can't find the section or button I am looking for. Even if I do that (right click, view source) on the actual content I want. I used Google's element inspector to try and find it and I found it.... But I do not know how to use (or if it is even possible) to use Autoit's automation to let me click the actual button. I can do it with simple IE items, but frames within frames within javascript within div tags, etc, is kind of hard. I got logging in working. Does anyone mind helping me out? A screenshot of Chrome's inspector over the element is attached. Code of the page, but dont think it will help (Because it doesnt show whats needed) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <!--begin S2--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript" src="/js/jquery/jquery-1.3.2.js"></script> <script type="text/javascript" src="/js/jquery/ui.core.js"></script> <script type="text/javascrupt" src="/js/jquery/jquery.mousewheel.js"></script> <script type="text/javascript" src="/js/jquery/ui.dialog.js"></script> <script type="text/javascript" src="/js/jquery/ui.datepicker.js"></script> <script type="text/javascript" src="/js/jquery/jquery.text-overflow.js"></script> <script type="text/javascript" src="/js/jquery/DD_roundies.uicornerfix.js"></script> <script type="text/javascript" src="/script/en/bootstrap.js"></script> <script type="text/javascript" src="/script/en/dialog.js"></script> <script type="text/javascript" src="/script/en/dateformat.js"></script> <script type="text/javascript" src="/script/en/s2.js"></script> <script type="text/javascript" src="/js/jquery/jQuery.bubbletip-1.0.5.js"></script> <script type="text/javascript" src="/js/jquery/jquery.ba-untils.js"></script> <script type="text/javascript" src="/js/jquery/jquery.simpleplaceholder.js"></script> <script type="text/javascript" src="/script/en/activityLog.js"></script> <link href="/js/jquery/bubbletip/bubbletip.css" rel="stylesheet" type="text/css" /> <!--[if IE]> <link href="/js/jquery/bubbletip/bubbletip-IE.css" rel="stylesheet" type="text/css" /> <![endif]--> <link rel="stylesheet" type="text/css" href="/themes/s2/ui.all.css" /> <script type="text/javascript"> if(top.eventManager) { var isTearoff = false; var boss = top; } else { var isTearoff = true; boss = opener.top; } windowManager = boss.windowManager; myInfo = boss.myInfo; if(isTearoff) { windowManager.loadTearoff(self); bootstrap.halt ( function() { windowManager.unloadTearoff(self); } ) } else { windowManager.load(self); bootstrap.halt ( function() { //windowManager.unload(self); } ) } function kill() { bootstrap.haltCallback = []; window.close(); } </script> <!--end S2--> <!--begin s2frame--> <script type="text/javascript" src="/script/en/s2frame.js"></script> <!--end s2frame--> <!--begin s2monitor--> <script type="text/javascript" src="/js/jquery/ui.draggable.js"></script> <script type="text/javascript" src="/js/jquery/ui.droppable.js"></script> <script type="text/javascript" src="/js/jquery/ui.resizable.js"></script> <script type="text/javascript" src="/js/jquery/effects.core.js"></script> <script type="text/javascript" src="/js/jquery/effects.clip.js"></script> <script type="text/javascript" src="/js/jquery/farbtastic.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/i18n/grid.locale-en.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.base.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.common.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.formedit.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.inlinedit.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.celledit.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.subgrid.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.treegrid.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.custom.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.postext.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.tbltogrid.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.setcolumns.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.import.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/jquery.fmatter.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/JsonXml.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/jquery.searchFilter.js"></script> <script type="text/javascript" src="/js/jquery/jqGrid/grid.jqueryui.js"></script> <script type="text/javascript" src="/js/jquery/jquery.dropshadow.js"></script> <script type="text/javascript" src="/js/jquery/jquery.rightClick.js"></script> <script type="text/javascript" src="/js/jquery/jquery.treeview.js"></script> <script type="text/javascript" src="/js/jquery/jquery.text-overflow.js"></script> <script type="text/javascript" src="/script/en/desktop/desktop.js"></script> <script type="text/javascript" src="/script/en/desktop/widgetPrototype.js"></script> <script type="text/javascript" src="/script/en/desktop/widgetDimensions.js"></script> <script type="text/javascript" src="/script/en/dialog.js"></script> <script type="text/javascript" src="/script/en/editForm.js"></script> <script type="text/javascript" src="/script/en/validator.js"></script> <script type="text/javascript" src="/script/en/controlPrototype.js"></script> <script type="text/javascript" src="/script/en/edit.js"></script> <script type="text/javascript" src="/script/en/desktop/colorPicker.js"></script> <script type="text/javascript" src="/script/en/desktop/sounds.js"></script> <script type="text/javascript" src="/script/en/dateformat.js"></script> <script type="text/javascript" src="/script/en/linkedList.js"></script> <script type="text/javascript" src="/js/jquery/jqDnR.js"></script> <script type="text/javascript" src="/js/jquery/jqModal.js"></script> <link rel="stylesheet" type="text/css" href="/style/farbtastic.css" /> <link rel="stylesheet" type="text/css" href="/style/jquery.treeview.css" /> <link rel="stylesheet" type="text/css" href="/style/s2edit.css" /> <link rel="stylesheet" type="text/css" href="/style/desktop.css" /> <script type="text/javascript"> bootstrap.boot ( function(index) { page = {} page.title = 'Portal Unlock' page.header = { breadcrumbs: [ { text: 'Main', url: '/menu/en/main/' }, { text: 'Monitor', url: '/menu/en/monitor/' }, { text: 'Portal Status' } ] } page.footer = { makeStartPage: true } page.desktop = { widget: { className: 'portalStatus' } } var dw = $(document).width(); var dh = $(document).height(); $('#desktopLoading').css( { top: ((dh - 48)/2) + "px", left: ((dw - 48)/2) + "px" } ); eventManager = boss.eventManager; activityLog = boss.activityLog; permissions = boss.permissions; license = boss.license; LOG = boss.LOG; dutyLogResponse = boss.dutyLogResponse; personSections = boss.personSections; regions = boss.regions; accessLevels = boss.accessLevels; stateValues = boss.stateValues; desktop.configuration = { taskBar: false, threatMonitor: false, background: false, fitToScreen: true }; desktop.preview = false; desktop.autoLoad = 'widget'; desktop.admin = false; desktop.defaultWidget = page.desktop.widget.className; desktop.defaultOptions = page.desktop.widget.options; bootstrap.done(index); } ) </script> <!--end s2monitor--> <!--begin s2frame--> <link rel="stylesheet" type="text/css" href="/styleSheet/s2frame.css" /> <script type="text/javascript"> bootstrap.ready ( function() { s2Frame.render(page.header, page.footer); } ) </script> <!--end s2frame--> <!--begin S2--> <link rel="stylesheet" type="text/css" href="/styleSheet/s2.css" /> <script type="text/javascript"> var datepickerOptions = getJSON('/utility/datepickerOptions', cacheAlways()) var page = {}; bootstrap.ready ( function() { if(typeof(page) != 'undefined' && page.title) document.title = page.title; } ) //$.uicornerfix('4px'); </script> <!--end S2--> </head> <body class="ui-widget" id="s2body"> <div id="frameHeader" > </div> <div id="frame"> <div id="desktopLoading" style="position: absolute; width: 48px; height: 48px;"> <img src="/graphics/ajax/layout.gif" /> </div> <div id="desktop" class="desktop" style="display: none; z-order: -9999;"> </div> </div> <div id="frameFooter"> </div> </body> <script type="text/javascript"> $(window).bind("unload", function () {windowManager.unload(self);}); </script> </html>
  7. Hmm, yeah. The first method suggested probably won't work. The application sits in the background (no gui or client window), and pulls a remote config file every 30 seconds using _Inetgetsrc. It still changes the cursor everytime it pulls. Would the IE experts here say there's no possible 'fix' for this? Would you suggest creating my own custom inetgetsrc function using TCP? I wonder if there's one already on these forums. I tried searching IE, but it's too short of a term to search for.
  8. When I use _InetGetSource to get the source of a webpage, my cursor changes to a loading symbol for a split second then switches back. My program calls _InetGetsource often, so it gets a little annoying after a while. Do any of you know of a work-around or a way to disable the cursor change?
  9. Edit: I THINK it has something to do with my Downloader sending the TCP info too fast. When I put in a sleep(1000) in the while loop of the downloader, it works FINE! Is there a work-around? Obviously I can't make a download program pause for a second. It'd take forever to download! And I know I can fix it by making TCPRecv($socket,THIS) to the EXACT number that the Downloader sends, so it knows to cut off when its supposed to, but it changes every while loop. Any suggestions?
  10. I'm not sure what's wrong. If I create 2 blank scripts, one a TCP Server and one a TCP Client, it sends just fine. But when I incorporate tcp methods into my program, my client only receives 'blocks' of tcp messages. Basically.. it works like this. (Pseudo Code.. not working code) TCP Server (Downloader)-Big Program ----------------------------------- TcpStartup() $webserver=Opens a TCP Connection to a website on port 80, asks for binary file (TCPConnect) $otherProgram=Opens a TCP Connection to my local TCP Server on port 127.0.0.1 $totalsize=File Size of webserver's binary file while tcp_connection_active=1 $recv=TcpRecv($webserver,2048) ;Gets 2048 bytes of binary code from website $totalbytesgot=$totalbytesgot+Bytesof(recv) write to file tcpSEND($otherProgram,$totalBytesGot&"\"&$totalsize) wend TCP Client (Received Downloader progress) (Exact Code. Used for debugging) ----------------- #include <TCP.au3> ;Uses Event Driven TCP UDF on these forums $hSocket=_TCP_Client_Create("127.0.0.1",41909) _TCP_RegisterEvent($hSocket, $TCP_RECEIVE, 'Received') Func Received($hSocket,$sReceived,$iError) ;Msgbox(0,"",$sReceived) msgbox(0,"",$sReceived) EndFunc While 1 Sleep(100) WEnd Well when I run this, it seems like my Downloader is sending big BLOCKS of info to my server instead of just the small line I want (file_size_downloaded/total_file_size). Does it have something to do with two TCP Connections active? Or maybe its because the Downloader is sending the data too fast, so it piles up on the client? When I tried doing the TCP Client's test code, I tried doing it manually instead of the TCP.au3, it seems like if I set TCPRecv($socket,THIS) smaller and smaller, it received smaller blocks of code. Anyways, Any suggestions. I know this sounds complicated. Maybe I can clean up my Downloader and post code later. Just wanted to see if you guys had any ideas. -------------------------------------------------------------------------------- Example of what shows up: Only need "10/100" to show up in a msgbox, not "10/10010/10010/10010/10010/10010/10010/10010/10010/10010/100"
  11. Awesome tool. Have to switch to something else though. Seems I can't send data as fast as I want. If it tries to send too fast, the queue system you put in place takes effect (awesome idea! but bad for fast script2script communication). Looking for alternatives.
  12. Ahh. gotcha. Makes more sense. I got the wrong idea from this thread: http://www.autoitscript.com/forum/index.php?showtopic=106018&st=0&p=748858&hl=_Singleton&fromsearch=1&#entry748858
  13. Yeah, I understand that. You're basically explaining how Singleton works, right? I was just curious about the Global part and ",2" parameter that's mentioned in the help. I have no clue what that means and am curious to learn more.
  14. yeah, ProcessList would only work if its assumed that I know the title or process name. But then again, I haven't seen _singleton's coding. Maybe singleton is just a roundabout simplified-way of using window titles? Anyways, yeah, WindowMessage sounds promising. I'll search around for that if you dont have any links already off-hand. Thanks.
  15. Hey, is there any way to get a program's handle without using Wingetprocess or looking for its title? I know _Singleton can check for an existing script running, but if it is running, is there any way to return the handle of what's running if it is instead of exiting? I may have overlooked this. Thanks!
  16. Hey, I'm just curious as to how exactly this works. What's _Singleton("Global\test",2) supposed to do? Can someone provide a quick example of how it can be used? Can another program read it's variables through this? If not, what does it do? Mainly found this looking for a way for my script to communicate 'easily' to another script without using tcp Thanks!
  17. dang. I posted a reply, but I guess it got deleted as it went in right when the forum went down. Argh, the command-line shortcut doesn't work for Google Chrome as far as i know, so the first method wont work. The second I looked at already, but decided not to do it as it required registry access, which seems like a bad way of doing this in my case. I want to mess with the system as least as possible. Argh!! So annoying. Is there any way to do this using DllCall or ObjCreate? Probably not right?
  18. Hey, I'm trying to use ShellExecute to open a web-link in a new window instead of adding it on to my current browser's list of tabs, but I think the ability isn't really there... I haven't gone into creating objects in autoit or calling libraries, but I think it might be necessary to get autoit to do what I'm trying to do. Does anyone have any ideas? Maybe somehow using objcreate to add an additional msdn parameter to get it to open in a new window? Or maybe using DllCall to create a new process of my browser, then using shellexecute (stupid theory). I know this works as a alternative to ShellExecute: But I don't know how to add additional parameters. Here's MSDN's reference page to ShellExecute: http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx I read using SW_SHOWNORMAL flag with ShellExecute works, but I have no clue on how to use ObjCreate to add that flag. Example: ShellExecute(NULL,"c:\\program files\\internet explorer\iexplore.exe", NULL, SW_SHOWNORMAL) Thanks, hopefully this can shed some light and teach me how to apply msdn references to ObjCreate in autoit.
  19. Hey, quick question. Is there any way to make a gui overlap anything but the taskbar? I'm trying to make a tray notify, but it gets stuck behind windows/apps. So I added the alwaysontop attribute to it, but now it overlaps even the taskbar. Is there any way around this? Possibilties I see 1.) Somehow make the taskbar always on top. (Ghetto way around it..) 2.) Apply some _ALMOST_Always_On_Top attribute to my GUI to get it to stay behind the gui. Example Code for Tray Popup #include <WindowsConstants.au3> #Include <WinAPI.au3> ; Create Toast window Global $hGUI = GUICreate("", 200, 100, @DesktopWidth - 210, @DesktopHeight - 130, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) Global $hLabel = GUICtrlCreateLabel("Click to close", 1, 1, 198, 198) ; Slide in Toast - but keep focus on current window _WinAnimate($hGUI, 0x00040008) $hCurrWnd = _WinAPI_GetForegroundWindow() GUISetState(@SW_SHOW, $hGUI) WinActivate($hCurrWnd, "") ; Wait for click from Toast While 1 Local $aMsg = GUIGetMsg(1) If $aMsg[1] = $hGUI And $aMsg[0] = $hLabel Then ExitLoop WEnd ; Slide out window _WinAnimate($hGUI, 0x00050004) Exit ; -------------- ; Gary Frost's WinAnimate function Func _WinAnimate($h_gui, $i_mode, $i_duration = 1000) If @OSVersion = "WIN_XP" OR @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $h_gui, "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then Return SetError(1, 0, 0) EndIf Return 1 Else Return SetError(2, 0, 0) EndIf EndFunc;==> _WinAnimate()
  20. Hey, I have a program that runs in the background that runs an Adlib every 5 minutes to check for an update on my server. When I lock my computer and then come back later to unlock it...Its like my autoit program has stacked up every Adlib ever called while my computer was Locked, because I can never access my program when I first unlock my pc. It takes about 10 minutes until I can start using my program again. (Program is based on EventMode if that helps u get an idea any). Any ideas? Its Adlib, right? Did I come to the right conclusion? Adlib doesn't run when the computer is locked? Is there any way around this? How would YOU do this? Maybe a way to check to see if the computer is locked, if not, run Adlib, it yes, then dont run the Adlib. ...thats assuming the reason I cant access my program after I unlock my PC is BECAUSE of adlib.
  21. sounds blackhat-ish to me :/ Use VNC, it already has what you're looking for.
  22. Im not sure about 'preventing' an application from starting, an expert would have to give a reply here. But you can of course ProcessClose() an existing process if it finds the name running.. And... you using the terms 'Shell/Kernel messages'.. can you elaborate on that? What kind of messages are you wanting to intercept?
  23. 2 Questions. 1.) How does the script 'continously' send the same key if there's no Send() Function even in it? 2.) And most important of all..how are you supposed to 'dabble' with it and get it to work if you don't even have the full script?
  24. *bump* If anyone knows if its just my computer that isn't returning the 64-91 $keycodes for lower-case, or if an update to autoit changed it, please let me know, so I can research and debug this to find out why. Otherwise, Ill consider the Example incorrect And will use another approach. Damn, wanted to learn more about low-level hooking.
  25. Yikes. Thats a big script. Going to bed, will look at it tomorrow.
×
×
  • Create New...