16 posts in this topic
I would like to know if I can use the Excel UDF to manipulating a .csv file without having Office installed on the PC I'm going to work...
I read somewhere that it could be done, but I'm here to ask and be sure of what I remember...
I'd like to post another question...
How can I retrieve the handle of a windows from a PID of an .exe?
I have my script that does a ShellExecute ( which returns the PID of the .exe ), and then, switching a parameter read from a .ini file, adapt the Window on the screen ( Maximize, Minimize, On Top )...
I tried, but without having success with this:
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_x64=prova.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> #include <WinAPIEx.au3> #include <Array.au3> Local $sFileConfigurazione = @ScriptDir & "\configurazione_exe.ini" If(FileExists($sFileConfigurazione)) Then Local $aSezioniIni = IniReadSection($sFileConfigurazione, "CONFIGURAZIONE_EXE") If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'apertura del file: " & @CRLF & $sFileConfigurazione & @CRLF & "Errore: " & @error) Else ; Lancio dell'applicativo indicato nel file di configurazione Local $iPID = ShellExecute($aSezioniIni) Local $hWnd If($iPID <> 0) Then Local $aWinList = WinList() For $i = 1 To $aWinList If(WinGetProcess($aWinList[$i] = $iPID)) Then $hWnd = $aWinList[$i] EndIf Next Switch($aSezioniIni) Case $aSezioniIni = "MIN" WinSetState($hWnd, "", @SW_MINIMIZE) Case $aSezioniIni = "MAX" WinSetState($hWnd, "", @SW_MAXIMIZE) Case $aSezioniIni = "TOP" WinSetOnTop($hWnd, "", $WINDOWS_ONTOP) EndSwitch EndIf EndIf EndIf It just set on top the .exe I'm launching...
#include <IE.au3> _IECreate("www.google.com") Sleep(5000) WinSetState("Google - Internet Explorer","",@SW_MAXIMIZE) The browser window opens and it goes to google.com but it will not maximize. I have also tried:
#include <IE.au3> Local $Browser = _IECreate("www.google.com") Sleep(5000) WinSetState($Browser,"",@SW_MAXIMIZE) Also doesn't work. I'm running windows 8.1 x64 and internet explorer 11.0.9600.16384. Help!
I have a program that when minimised to task-bar an using WinGetState returns 37. Maximised, enabled and exists?
Using WinSetState ("[CLASS:TfrmDesktop]", "", @SW_MAXIMIZE) returns 39. Maximised, enabled and exists and visible?
But will not maximise the window.
However 39 is what it normally is when maximised and using the program
Just using @SW_RESTORE = 7 but does not open window (obviously)
and using @SW_RESTORE then @SW_MAXIMIZE = 39 but then cant minimize.
and using @SW_RESTORE then @SW_MAXIMIZE then @SW_ENABLE = 39 but then cant minimize.
Tried this and nothing WinMove("[CLASS:TfrmDesktop]",0,0,@Desktopwidth, @DesktopHeight)
Really strange as not sure what else to try.
I've written a little experimental program, using 2 shortcuts, to manage a relay.
The shortcuts are:
C:\USB-relæ\USBRelay\USBRelay.exe -c:8 -r:1#1 ( = 'ON')
C:\USB-relæ\USBRelay\USBRelay.exe -c:8 -r:1#0 ( = 'OFF')
The script (the compiled .exe) is doing what it is supposed to do, using the
Run ("C:\USB-relæ\USBRelay\USBRelay.exe -c:8 -r:1#1") to turn the relay on - but I keep getting a window, which I cannot "get a grip on", almost all over my monitor, which I find absolutely annoying..!
What can I do, in order to force this window to "disappear"..?
Any help will be greatly appreciated!