Sign in to follow this  
Followers 0
Queener

Restore windows from systray

1 post in this topic

I'm not sure if I'm doing it right or there's a better way to restore windows from hidden in system tray, but if I remove the if statement then it's able to restore the program from system tray, but if I add the if statement then it doesn't restore it. Here's what I gotten so far and the reason why I use the if statement is because #32770 opens many other apps also.

WinSetState("[CLASS:#32770]", "", @SW_SHOW)
    
If WinExists($title_Pass_Entrance) Then
WinWaitActive(WinActivate($title_Pass_Entrance))
  ControlSend($title_Pass_Entrance, "", "[CLASS:Edit; INSTANCE:1]", "TempPassword")
  ControlClick($title_Pass_Entrance, "", "[CLASS:Button; INSTANCE:2]", "left", 1)
EndIf
     
    >>>> Window <<<<
Title:    Enter Safe Combination
Class:    #32770
Position:    728, 411
Size:    465, 218
Style:    0x94C800C4
ExStyle:    0x00010101
Handle:    0x0000000000050A7A
    >>>> Control <<<<
Class:    
Instance:    
ClassnameNN:    
Name:    
Advanced (Class):    
ID:    
Text:    
Position:    
Size:    
ControlClick Coords:    
Style:    
ExStyle:    
Handle:   


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Chimaera
      Make restore point issues
      By Chimaera
      Ive had a bit of code from a long time ago and its always worked perfectly until recently
      It creates a restore point of a given name that i choose and i use it when i finalize a customers pc to go back to them.
      the original code was from Venom 007
      Global $CuDate = _Date_Time_GetLocalTime() Global $sRestorePointName = 'Tech_Finish ' & StringTrimRight(_Date_Time_SystemTimeToDateTimeStr($CuDate), 9) Func _CreateRestorePoint($sRestorePointName) ; Author = Venom007 SplashTextOn('Restore Point', 'Creating Restore Point.' & @CRLF & @CRLF & _ 'Please Wait', 300, 90, -1, -1, 18) Local $objSystemRestore $objSystemRestore = ObjGet('winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore') If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1) SplashOff() If Not @error Then SplashTextOn('System Restore', 'System Restore Point Created Successfully.', 300, 45) Sleep(2000) SplashOff() Else SplashTextOn('System Restore Error', 'System Restore Point Was Not Created.', 300, 45) Sleep(2000) SplashOff() EndIf EndFunc ;==>_CreateRestorePoint Just recently now im seeing windows 10 machines it fails at this line im pretty sure
      $objSystemRestore = ObjGet('winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore') Does anyone know what has changed in win 10 to cause this?
    • zvvyt
      Dynamically created GUIs with simultaneous minimize/restore but only one "shown" window
      By zvvyt
      Hello ya'll!
      My problem is split in two, so I'll start with the first one:
      What I'm having is my script with dynamically created GUIs with similar / identical names. I would like to have that undepending on how many windows I have open to only have one "window" down at the taskbar.
      I guess all I need is the correct GUI style, but I can't find which one I need.
      Which brings me to problem part 2 (which I also find to be the easy part):
      Windows will open and close on random, so there's no set order in which they'll get closed. But I still need one "window" at the taskbar to work with as long as there's at least one window open.
      In the action of one of these windows getting minimized/restored all of the windows will act simultaneously.
      This will be solved with something similar: 

      case $GUI_EVENT_MINIMIZE          for $1 = 1 to Ubound($ActiveWindows) step +1                 WinSetState($ActiveWindows[$1], @SW_MINIMIZE)         Next And vice versa for restore.
      So .. Mainly prob #1 that I need some help with, and a thought about the "always one window at taskbar"-issue.
      Just point me in the right direction and I'll hopefully solve it myself ^__^'
      Thanks, and have a great weekend!
      zvvyt
    • Mbee
      What ctrl to ControlSend() to for app in System Tray?
      By Mbee
      I've got a third-party video recording app idling away in the system tray (as it should be), just waiting for a command sequence (e.g., "CTRL+ALT+R") to begin recording.  When I'm recording manually, I simply press the command sequence on the keyboard to get it going, without having to manually activate/raise the idling process/window.
      I'm writing a script to send that sequence programmatically, but I can't figure out where and how to send it!  I know I should use ControlSend(), and I can specify the third-party app's title as the first parameter, but I'm utterly baffled about what ControlID I need to use.  For a normal app, I would use Au3Info.exe to identify the control, but since the app is idling in the system tray, I can't figure out any way to use Au3Info on it.
      So, how do I determine what ControlID to use in the ControlSend() call?
      Thanks!
      [ETA: Or perhaps I should do it some other way, one that doesn't need a controlID?]
      (By the way, I found some code generously provided by poster war59312 (here), that will return the index number of the sys tray app I'm interested in, but I can't see how that would help me. I suppose that since pressing the sequence is all I need to do when doing this manually, maybe I could send it to Explorer, but I still don't know what ControlID to use.)
    • Beege
      Revision Tracker - Track all changes to all scripts
      By Beege
      Here is two apps I've been working on to track the changes I make to scripts as I create them. One is for monitoring your script changes, the other is view/restore all the changes that have been made.
       
      RevMonitor
      RevMonitor works by reciving shell change notifications from windows. For every .au3 file thats within a directory being monitored, 2 files will eventually be created ( as changes happen). One file is a dictionary file that holds all unique lines from the script. The second file is the revisons file that holds all revisons made to the script. A revison entry is a string of line numbers from the dictionary that make up the script. The entry also contains the Date and Time, plus weather it passed au3check at the time. (Date | Au3Check | Revision)
       
      For an example take the following script:
      #include <array.au3> Global $aArray1[1] Func _ShowArray(ByRef $aArray) If Not IsArray($aArray) Then Return SetError(1) _ArrayDisplay($aArray) If @error Then Return SetError(1) EndFunc Func _ShowArray2(ByRef $aArray) If Not IsArray($aArray) Then Return SetError(1) _ArrayDisplay($aArray) If @error Then Return SetError(2) EndFunc  
      The dictionary for the file would look like this:
      #include <array.au3> Global $aArray1[1] Func _ShowArray(ByRef $aArray) If Not IsArray($aArray) Then Return SetError(1) _ArrayDisplay($aArray) If @error Then Return SetError(1) EndFunc Func _ShowArray2(ByRef $aArray) If @error Then Return SetError(2) A entry from the revison file would look like this:
      11/29/2013 01:09:23 AM|0|0.1.2.1.1.3.4.5.6.7.1.8.4.5.9.7  
      RevRestore
      RevRestore is used for restoring a file. Each dictionary/revison file that gets created for a script being monitored will always get created in a "backup" directory located in the same directory as the script (same way tidy makes backups). To view a revison file, you select the script (not the actual revison file). I wrote it this way to make the revison file easy to open from scite. 
       
      To add to SciTE, simply open the users options file (Tools->"Open User Options File") and add something similar to the following lines:
      # 45 Open Revisions File command.45.$(au3)="C:\RevTracker\RevRestore.exe" "$(FilePath)" command.name.45.$(au3)=Restore Revision command.shortcut.45.$(au3)=Ctrl+Shift+R ScreenShots:




       
      Credits - Thank you to all:
      Melba23 - Toast, GuiFrame
      Ward - QuickLZ
      Yashied - Restart
       
      Download:
      Revision Tracker.html
      Note: The .html link is just to help me keep track of downloads. Open the .html file and a download dialog will display. 
       
    • shEiD
      C# - get info (tool-tips) of System Tray icons.
      By shEiD
      Hi, could anyone help me with a C# code to get info of icons in System Tray? I can accomplish this in AutoIt, but would very much prefer to be able to have this in c#. I use it daily, to fix some problems/bugs in another software to make it usable, which is in beta now, and until developers fix it, I need to resort to this thing. Crazy enough, there is no other way inbuilt to get the status of a program and what it's doing, except tray icon. No logging, anything at all. They say they are working on it, but until that time... Here's the AutoIt snippet: #include <GuiToolBar.au3> $hTray = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') $iconCount = _GUICtrlToolbar_ButtonCount($hTray) For $i = 0 To $iconCount - 1 $text = _GUICtrlToolbar_GetButtonText($hTray, $i) ConsoleWrite($text & @LF) Next The most important thing, is to get tray icon tool-tip. I would like to get more, if possible as well, but tool-tip is crucial.
      I'm a hobbyist and only learning programming (C#). I don't know c++, nor I know how to properly PInvoke in c#, and I'm not confident enough to mess with unmanaged code.   I even tried to accomplish this in C# using AutoItX3_x64.dll, but could not figure it out. Any help would be much appreciated. Maybe at least someone could tell me, where else I could ask for help on this, if not here?   Autoit is awesome, I use it daily, sadly this project is just too big and complicated to do it all in Autoit only. Main reason - I want to use WPF.