Jump to content

MaestroDW

Members
  • Posts

    12
  • Joined

  • Last visited

MaestroDW's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. BTW When will the polyphonic version be ready?
  2. Well done CyberSlug. I'll grab this now and make use of it. Used sparingly, sound is a great way to add character, humour and personality to a script. Many thanks, DW
  3. Thanks Jon. That will help consolidate my interpretation of the DLLCall info in the AutoIt Help examples. DW
  4. Thank you for this reply and all this info. Your method does return a handle and it may well be useful to move ahead with the anti-flashing problem I posted yesterday. BTW did my dllcall not work because of an error on my part or something else? Thanks again for this. DW
  5. I think this would be useful for all the girls too! Please advise on how to fix this dllcall to return a handle to the desktop window. Func GetDeskTopWindowHWND() ;Get a window handle for the Desktop window ;WINAPI describes as HWND GetDesktopWindow(void) ;The GetDesktopWindow function retrieves the handle of the desktop window. ;The desktop window covers the entire screen and is the area on top of which all icons and other windows are painted. $DskTp = DllCall("user32.dll", "none", "GetDesktopWindow", "hwnd", 0) Return $DskTp EndFunc I am familiar with using dlls in other languages. At first, that appears to be a handicap while trying to do the same in AutoIt! Please advise how to knock this function into shape. Many thanks, DW PS No offence to Sandra, I just need some TLC from the Wise Ones too!
  6. Taking this further, perhaps some of you will help with my coding. In user32.dll we can use GetDeskTopWindow to get a handle for the entire desktop window. The Windows API says: The GetDesktopWindow function retrieves the handle of the desktop window. The desktop window covers the entire screen and is the area on top of which all icons and other windows are painted. Then we can use LockWindowUpdate(hwnd) Here is my effort so far. [Warning to all: run at your own risk, bugs in this code can require a reboot.] Func GetDeskTopWindowHWND() ;I thought I should declare an array but it causes an error, so next line remmed out. ;Dim $DskTp[1] ;Get a window handle for the Desktop window ;WINAPI = HWND GetDesktopWindow(void) ;The GetDesktopWindow function retrieves the handle of the desktop window. ;The desktop window covers the entire screen and is the area on top of which all icons and other windows are painted. $DskTp = DllCall("user32.dll", "", "GetDesktopWindow", "hwnd", 0) Return $DskTp EndFunc Func LockDeskTopWindow($Dsk) ;Lock the HWND of the Desktop ;WINAPI = BOOL LockWindowUpdate(hwndLock) $LckDskTp = DllCall("user32.dll", "int", "lockwindowupdate($Dsk)", "int", 0) ;return val = 0 = failure | nonzero = success Return $LckDskTp EndFunc ;Elsewhere in my code I have this function which uses the above two functions. Func RemoveAllWindows(); This removes three windows by sending keys to menu items in an open application $DskHwnd = GetDeskTopWindowHWND() MsgBox(0,"RetVal", $DskHwnd & @CRLF&@error); Just checking all is well LockDeskTopWindow($DskHwnd); I believe this works as a toggle and is repeated below to unlock the desktop window again, or else we must reboot! However, not working IMO MsgBox(0,"RetVal", $DskHwnd & @CRLF&@error); Just checking all is well WinWait("Harmonise! -- ","") If Not WinActive("Harmonise! -- ","") Then WinActivate("Harmonise! -- ","") WinWaitActive("Harmonise! -- ","") WinMove("Harmonise! -- ","",$HarmWinPos[0],$HarmWinPos[1]); these have been set previously and help reset the open app. to its default position. Send("!w2"); keys to close window 2 Send("!w3"); and 3 Send("!w4"); and 4 LockDeskTopWindow($DskHwnd); to unlock the desktop again. MsgBox(0,"RetVal", $DskHwnd & @CRLF&@error); Just checking all is well EndFunc Can any of you see how to improve this? DW
  7. Hi all, Any suggestions on how to lock the screen temporarily to avoid rapid flashing and then unlock the screen when required? Is this a feature of AutoIt or an API call? TIA DW
×
×
  • Create New...