3 posts in this topic
Afternoon, I could very well be doing this wrong so feel free to totally advise otherwise - I'm wanting to use a GUI to first display a key from within an INI file, then secondly change the INI file by using a FileSelectFolder command but then I want to see the GUI change to reflect the change I've just made.
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Input1 = GUICtrlCreateInput(Iniread(@WorkingDir & "\test.ini","Path","FilePath",""), 64, 80, 121, 21) $Button1 = GUICtrlCreateButton("Change", 200, 80, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $selectedFolder = FileSelectFolder("Select Log Path Directory",@WorkingDir,0) If NOT $selectedFolder = "" Then $newLogPath = IniWrite(@WorkingDir & "\test.ini","Path","FilePath",$selectedFolder) EndIf EndSwitch WEnd So 2 part question really: (1) Should I be using GUICtrlCreateInput to display my INI read from within the GUI? (2) How can I refresh the GUI to update that to read the new information I've just written to the GUI?
I need to set value to a text box to a desktop application.
I am trying to do that with
ControlSetText($MartConfigWindow, "", "WindowsForms10.EDIT.app.0.378734a6", $dbserver)
where $MartConfigWindow has the window ID.
And the text box field is having class as WindowsForms10.EDIT.app.0.378734a6
THis code is working on one machine but on some machines, the last part of ID WindowsForms10.EDIT.app.0.378734a6, means 378734a6
Is there anyway to handle this?
I have a working script that changes the core affinity and process priority of multiples of a specific application I have running.
I have that part figured out.
I would like to make a little modification to it.
Windows10 introduced virtual desktops. I am trying to have different core affinity and priority of processes on the visible and non-visible desktops.
What I need is a bool function that could be described as IsWindowOnCurrentDesktop($hWnd). I have searched the winAPI.au3 but I do not believe anything like that exists built it.
I have searched multiple places before asking for help. I found a Microsoft supplied example of the function I need using C#, but I am unfamiliar with C# to a degree that I cannot port the system call over.
Help is appreciated but not expected. Thanks in advanced. In the meantime I will be learning C# syntax and class structure.
I recently upgraded my laptop to one with Windows 10 and higher screen resolution. In the process I found that some of my scripts did not work right when using Autoit's @DesktopWidth and @DesktopHeight macros. Insteat of 1920 x 1080 resolution Autoit detects 1536 x 864. Thus, GUIs designed to appear near the right edge of the screen displayed closer to the horizontal middle of the screen. I assume others may have the same problem.
A search on this forum and Microsoft Script Center helped me to write the following script that gets the true screen width and height from WMI.
MsgBox(0, '', _GetMonitorInfo())
Local $oWMI, $Listing, $sWidth = 0, $sHeight = 0
$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
If IsObj($oWMI) Then
$Listing = $oWMI.ExecQuery("SELECT * FROM Win32_DesktopMonitor")
If IsObj($Listing) Then
For $oItem In $Listing
$sHeight = $oItem.ScreenHeight
$sWidth = $oItem.ScreenWidth
Return "Width: " & $sWidth & @CRLF & "Height: " & $sHeight
Hopefully it will benefit others. I for sure am very happy with all the samples I been able to find here in the past.
I'm using this method to draw a transparent image inside my window. It works, but not as expected. With that example - without minimize button or anything else and the _GDIPlus_GraphicsDrawImageRect inside the main loop -, it works, but when you need to refresh the window, like restoring it after minimized or when you drag some window above your autoit window, the draw just gone. How can I refresh the image, for example, when I display one MsgBox and minimize and restore the window with the MsgBox opened?
Try the example below. Run the script and the image will show, then minimize and restore. Then click on the button, keep the MsgBox opened, minimize and restore... The image just disappears. How can I keep it?