Jump to content

MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc.


Recommended Posts

  • 2 months later...
  • Replies 280
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support fo

I know I disappointed some of you guys with this version as you were waiting for the requested features like Sliders, InputBox, Support for tabbing through controls and other stuff. I spent a lot of t

Version 4.3 - Changelog - 13.07.2016 Bugfixes: Fixed a bug where the fullscreen button was misplaced on different DPI sizes. Fixed a bug where the maximized window was not properly o

Posted Images

is there any way to make GetCurrentGUI() not to flick gui ? 

(it's difficult to give you an example code right now) 

when i use the _metro_enablebutton it instantly redraws gui (i tried sw lock with no success) 

the only solution that i found is to give directly the gui parameter to enablebutton func

 

edit -> am not sure (because i must remove the previous "fix", but if i change the (from getcurrentgui func)

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 0, 0)

to 

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 1, 1)

 

it seems ok

Edited by radienergos
Link to post
Share on other sites
  • 2 weeks later...

Any help is appreciated?

 

-#############################################################################################

-#### Au3Stripper Found   5 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- 2.50 Iteration 1 Strip and Rename Functions result: Output  5321 lines and stripped 7253 lines
- 5.38 Iteration 2 Strip Variables result: Output  3013 lines and stripped 2308 lines
- 6.00 Iteration 3 Strip Variables result: Output  2926 lines and stripped 87 lines
- 6.63 Iteration 4 Strip Variables result: Output  2923 lines and stripped 3 lines
- 7.25 Iteration 5 Strip and Rename Variables result: Output  2923 lines and stripped 0 lines
+> Source    22107 lines 1083820 Characters.
+> Stripped  9651 Func/Var lines and  9210 comment lines, Total 998836 Characters.
+> Saved     85% lines 92% Characters.
+> 0 Au3Stripper v15.920.938.0 finished created:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
+>11:12:39 Au3Stripper ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1028,26) : warning: $5g: possibly used before declaration.
For $5f = 0 To UBound($5g)
~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1067,54) : error: INTERNAL_INTERCEPT_FRAMEDRAW(): undefined function.
GUIRegisterMsg(0x0083, "INTERNAL_INTERCEPT_FRAMEDRAW")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3 - 1 error(s), 1 warning(s)
!>11:12:39 AU3Check ended. Press F4 to jump to next error.rc:2
+>11:12:39 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 9.544

 

Link to post
Share on other sites
On 4.1.2017 at 11:37 AM, radienergos said:

is there any way to make GetCurrentGUI() not to flick gui ? 

(it's difficult to give you an example code right now) 

when i use the _metro_enablebutton it instantly redraws gui (i tried sw lock with no success) 

the only solution that i found is to give directly the gui parameter to enablebutton func

 

edit -> am not sure (because i must remove the previous "fix", but if i change the (from getcurrentgui func)

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 0, 0)

to 

Local $idCtrlDummy = GUICtrlCreateLabel("", 0, 0, 1, 1)

 

it seems ok

Hmm not sure what you mean. I can't see any flickering. Can you post an example?

 

On 17.1.2017 at 11:16 AM, RyukShini said:

Any help is appreciated?

 

-#############################################################################################

-#### Au3Stripper Found   5 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- 2.50 Iteration 1 Strip and Rename Functions result: Output  5321 lines and stripped 7253 lines
- 5.38 Iteration 2 Strip Variables result: Output  3013 lines and stripped 2308 lines
- 6.00 Iteration 3 Strip Variables result: Output  2926 lines and stripped 87 lines
- 6.63 Iteration 4 Strip Variables result: Output  2923 lines and stripped 3 lines
- 7.25 Iteration 5 Strip and Rename Variables result: Output  2923 lines and stripped 0 lines
+> Source    22107 lines 1083820 Characters.
+> Stripped  9651 Func/Var lines and  9210 comment lines, Total 998836 Characters.
+> Saved     85% lines 92% Characters.
+> 0 Au3Stripper v15.920.938.0 finished created:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
+>11:12:39 Au3Stripper ended.rc:0
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1028,26) : warning: $5g: possibly used before declaration.
For $5f = 0 To UBound($5g)
~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3"(1067,54) : error: INTERNAL_INTERCEPT_FRAMEDRAW(): undefined function.
GUIRegisterMsg(0x0083, "INTERNAL_INTERCEPT_FRAMEDRAW")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Gr3ndel\AppData\Local\Temp\7zOC6E49E77\Example_stripped.au3 - 1 error(s), 1 warning(s)
!>11:12:39 AU3Check ended. Press F4 to jump to next error.rc:2
+>11:12:39 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 9.544

 

Try installing the newest version of Autoit and the Scite Editor. The Au3Stripper seems outdated. I have (16.306.1237.0) running and it doesn't return any errors.

Link to post
Share on other sites
  • 2 weeks later...

Hi everyone,

I have a problem displaying this GUI on different systems. On my laptop (windows 7) it looks like this:

:good.PNG

However, when displayed on my friends laptop (windows 10) the controls are not properly aligned and don't even fit on the screen. Here's a screenshot:

bad.PNG

 

I have no idea how to fix this. Anybody have some advice?

My script:

ExcelTools_V1.au3

Link to post
Share on other sites

Are you sure, you used exactly the same script?

 

When I look at this for example:

$b = 66 + $t        ; Begin pos Toggles
$b1 = 105 + $t      ; Begin pos Inputs

...

Global $Checkbox2 = _Metro_CreateToggle("To UPPERCASE", $l + 40, $b, 180, 30)
    Global $Hotbut2 = _GUICtrlCreateInput("", $l + 320, $b1, 30, 25, $SS_CENTER)

I don't understand why the controls should have the same Top position under Win7..

Link to post
Share on other sites

@ludocus

I use Win 10 and it looked as bad as your Win 10 screenshot. But.. Do I miss something?  In the example that I looked at., the Inputfield next to the toggle UPPERCASE should have the same (or nearly the same) Top position. But $b1 is always 39 bigger then $b, what the variables for your Top position is. So the positions I can see with Win 10 seem for me exactly that, what your code says... I don't understand it.

Edited by nobbitry
Link to post
Share on other sites

@nobbitry

You are absolutely right and I now this is confusing. I had to enter different heights because they were displayed at different heights if I entered the same height for both (still following me? :p).

@KarlosTHG

Well if that's the problem, then that solution won't work for me as this program will be installed on a lot of different systems. It should just work for everyone without having to change any settings in windows. So I might just add an If statement that will change the GUI when it is displayed on windows 10 versus windows 7.

Thank you both!

Link to post
Share on other sites
6 hours ago, ludocus said:

@nobbitry

You are absolutely right and I now this is confusing. I had to enter different heights because they were displayed at different heights if I entered the same height for both (still following me? :p).

@KarlosTHG

Well if that's the problem, then that solution won't work for me as this program will be installed on a lot of different systems. It should just work for everyone without having to change any settings in windows. So I might just add an If statement that will change the GUI when it is displayed on windows 10 versus windows 7.

Thank you both!

Did you tried changing:

;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling())
;#AutoIt3Wrapper_Res_HiDpi=Y

to:

;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling())
#AutoIt3Wrapper_Res_HiDpi=Y


maybe that can help

Link to post
Share on other sites

I managed to fix it by adding custom positions when operating system is windows 10.

Btw, when I try to compile the script, I get a message saying "Incorrect Wrapper Directive '#Autoit3Wrapper_REs_HiDpi=Y' "

Am I compiling it wrong or something?

 

Link to post
Share on other sites
On 31.1.2017 at 9:56 AM, ludocus said:

Hi everyone,

I have a problem displaying this GUI on different systems. On my laptop (windows 7) it looks like this:

:good.PNG

However, when displayed on my friends laptop (windows 10) the controls are not properly aligned and don't even fit on the screen. Here's a screenshot:

bad.PNG

 

I have no idea how to fix this. Anybody have some advice?

My script:

ExcelTools_V1.au3

 

Hi,

This UDF is already optimized for high resolution screens, meaning all buttons, toggles and even the main GUI will be created with a dynamic size so that everything looks very sharp no matter that DPI size the user is using. Unfortunately many modern programs lack this feature which causes them to look very small, blurred or the controls are completely out of size and position on 4k Displays which mostly require higher DPI sizes. That why I had to add this feature.

If you use _Metro_EnableHighDPIScaling() and #AutoIt3Wrapper_Res_HiDpi=Y, then this feature will be enabled and you will require to calculate the pos+size of all controls that are created using Autoits GUICtrlCreate... functions. All functions like _Metro_CreateButton already do this by default, so no need to change anything for them.

It is actually pretty easy but might take some time if you have many controls. There is already a global variable declared in the UDF, that can be used to calculate the position/size. You can use ( x * $gDPI) for every position and size parameter.

Global $titlelabel = GUICtrlCreateLabel ("ExcelTools", 80*$gdpi, 6*$gdpi, 200*$gdpi, 28*$gdpi)

While creating the GUI, you should disable _Metro_EnableHighDPIScaling() and #AutoIt3Wrapper_Res_HiDpi=Y and create your GUI like you would usually do. After that you can enable them again and add *$gDPI to all the Autoit GUICtrlCreate... functions. This way your program will look the same on all computers when it is compiled.

 

On 2.2.2017 at 5:12 PM, ludocus said:

I managed to fix it by adding custom positions when operating system is windows 10.

Btw, when I try to compile the script, I get a message saying "Incorrect Wrapper Directive '#Autoit3Wrapper_REs_HiDpi=Y' "

Am I compiling it wrong or something?

 

Check if you have the latest Autoit and Scite Tools version installed. It should work like provided in the example GUI.

Edited by BBs19
Link to post
Share on other sites

@BBs19: I've read up on the DPI issues and tried a few tests ... but uncertainties creep back in.  Since you seem well-versed in DPI, can you clarify you last statement:

Quote

While creating the GUI, you should disable _Metro_EnableHighDPIScaling() and #AutoIt3Wrapper_Res_HiDpi=Y and create your GUI like you would usually do.

If I apply the multipliers to the X, Y positions of all my GUI elements, which way should the Wrapper setting be? ... Y or N?

And if I decide not to use multipliers (and just let the OS scale everything in the blurry manner), what is the proper Wrapper setting?

I hope you don't mind responding to this.  From the AutoIt standpoint, it appears that your MetroGUI UDF is leading the way in this "frontier" of technology.

 

 

Link to post
Share on other sites
5 hours ago, qwert said:

@BBs19: I've read up on the DPI issues and tried a few tests ... but uncertainties creep back in.  Since you seem well-versed in DPI, can you clarify you last statement:

If I apply the multipliers to the X, Y positions of all my GUI elements, which way should the Wrapper setting be? ... Y or N?

And if I decide not to use multipliers (and just let the OS scale everything in the blurry manner), what is the proper Wrapper setting?

I hope you don't mind responding to this.  From the AutoIt standpoint, it appears that your MetroGUI UDF is leading the way in this "frontier" of technology.

If you apply the multipliers, then you have to set #AutoIt3Wrapper_Res_HiDpi to "Y" and add _Metro_EnableHighDPIScaling()  to the script so that Windows doesn't try to rescale the program as you would be doing that yourself.

If you want to let Windows scale everything, then you just remove _Metro_EnableHighDPIScaling()  and #AutoIt3Wrapper_Res_HiDpi=Y (or put it to N) from your code.

Link to post
Share on other sites
  • 2 weeks later...
On 5/8/2014 at 11:04 AM, BBs19 said:

Love what you did with this Metro UDF! I'm seeing a lot of ways to improve my code.

Are you able to include GUICtrlSetResizing for labels?

I would be interested too in working some transparency levels into the interface as well on Windows 7 machines and above?

Also, this tvshowcountdown app is amazing!  Would love to learn from the code behind this, if possible? If not, it's okay. Figure I'd ask anyway.

Thank you for all of your work!

(and U2 UEZ!)

Edited by coffeeturtle
Link to post
Share on other sites
13 hours ago, coffeeturtle said:

Love what you did with this Metro UDF! I'm seeing a lot of ways to improve my code.

Are you able to include GUICtrlSetResizing for labels?

I would be interested too in working some transparency levels into the interface as well on Windows 7 machines and above?

Also, this tvshowcountdown app is amazing!  Would love to learn from the code behind this, if possible? If not, it's okay. Figure I'd ask anyway.

Thank you for all of your work!

(and U2 UEZ!)

Thanks :)

What do you mean with include GUICtrlSetResizing for labels?

TV-Show-Manager is opensource, so you can check out the code any time. But I would suggest you wait, as the code was written very bad back then, I am rewriting the program from scratch to look similar to Netflix. Here is a small demo: Picture It will take some time to finish, as I am not really motivated to work on it at the moment :) 

 

Link to post
Share on other sites
13 hours ago, BBs19 said:

Thanks :)

What do you mean with include GUICtrlSetResizing for labels?

TV-Show-Manager is opensource, so you can check out the code any time. But I would suggest you wait, as the code was written very bad back then, I am rewriting the program from scratch to look similar to Netflix. Here is a small demo: Picture It will take some time to finish, as I am not really motivated to work on it at the moment :) 
 

Your Netflix-like program looks great so far! Nicely done!

And badly written or not, TVShowManager is not only good looking, not only have key functions that could easily be implemented in other functions, but it itself is very useful for keeping track of shows! (So many shows barely last one season so I like to keep track of some to see if they survive the cut and if I should binge watch or not). And I huge TV Show list is like having the TV Guide. Beautiful!

I'll look for the source code!

Now, I noticed that with your controls they automatically change to the right positions whether the window is normal size or maximized (like the OK button). Beautiful. So I was putting labels in the gui, but they didn't move where I wanted them. I thought it was because of not having GUICtrlSetResizing (or creating) functions for Metro styled labels. Of course, I could have done something wrong myself.

How far were you planning on taking the Metro Design? Tray Menu's? Calendar gui?  Just was wondering.

 

Thank you for everything you did so far.

Link to post
Share on other sites
10 hours ago, coffeeturtle said:

Your Netflix-like program looks great so far! Nicely done!

And badly written or not, TVShowManager is not only good looking, not only have key functions that could easily be implemented in other functions, but it itself is very useful for keeping track of shows! (So many shows barely last one season so I like to keep track of some to see if they survive the cut and if I should binge watch or not). And I huge TV Show list is like having the TV Guide. Beautiful!

I'll look for the source code!

Now, I noticed that with your controls they automatically change to the right positions whether the window is normal size or maximized (like the OK button). Beautiful. So I was putting labels in the gui, but they didn't move where I wanted them. I thought it was because of not having GUICtrlSetResizing (or creating) functions for Metro styled labels. Of course, I could have done something wrong myself.

How far were you planning on taking the Metro Design? Tray Menu's? Calendar gui?  Just was wondering.

 

Thank you for everything you did so far.

If you set GUICtrlSetResizing correctly, then the label should also move in the position you want.

Well there are a lot of requests at the moment like Scrollbars,Sliders etc. and I don't know which will work or not. Everything that goes beyond simple clicking like buttons, checkboxes etc. require a lot of workarounds in the background which in return create problems with big projects.. 

There will be new features, but I don't know when I will have the time to work on it again.

Link to post
Share on other sites
On 2/19/2017 at 4:50 AM, BBs19 said:

If you set GUICtrlSetResizing correctly, then the label should also move in the position you want.

Well there are a lot of requests at the moment like Scrollbars,Sliders etc. and I don't know which will work or not. Everything that goes beyond simple clicking like buttons, checkboxes etc. require a lot of workarounds in the background which in return create problems with big projects.. 

There will be new features, but I don't know when I will have the time to work on it again.

Understood. No worries. Everything seems to be working well.

Just was curious: What would be the best way to get Transparency to work with the Metro GUI?

On Windows 10, this works fine: _WinAPI_DwmEnableBlurBehindWindow10($Form1, True)/#include <_WinAPI_DwmEnableBlurBehindWindow10.au3>

However, this does not work with Windows 7. The old GUI Create does have a flag for transparent layers, but not sure if there is a Metro equivalent?

Thanks again!

Edited by coffeeturtle
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By WilliamasKumeliukas
      2021.07.15 News: Project is NOT dead! I am still very devoted into accomplishing this project, I am spending my every bit of energy that is left end of the day (when there is any) on this project and it really does challenge my knowledge in AutoIT language but I won't give up  
       
      Hi,
      I started this project alone in May 2020 as project in my spare time at work, I'm working for a IT company that started opening their services to residential customers few months ago and now my position in the company kind of drifted in the doom and gloom world of repetitive tasks like: Reinstallation + Configuration of Windows 10.
      The procedure is very repetitive and I started feeling like being a robot which is the main reason I started this project.
       
      ==============================FAQ==================================
      1. Q: Do you want this project to be accomplished with the usage of AutoIT ONLY or 3rd party tools / Scripts (BATCH / POWERSHELL / VB) ? A: No, if I cannot find a way using AutoIT to accomplish a task I will move to my Plan B which consist of automating an 3rd party tool to accomplish the affected task until a solution is found. 2. Q: What do I get from helping/collaborating in this project? A: I will personally take the responsability to mention you in the credits of this project. 3. Q: If I have more questions, can I ask? A: Certainly! feel free to ask any questions related to this project! 4. Q: What is the main goal of this project? A: Automating Windows 10 configuration without user interaction needed (as much as possible) ______________________________________________________________________________________________________________________________
      Current progression of the project (more will be added in future)
      « Blue = Info || Yellow = Unfinished/Untested || Purple = Could be better || Green = Done ||Red = Not Yet Started »
      ***Very early Stage ***
      Connect Network Attached Storage(NAS) (Work but missing configuration in GUI - AutoIT only)
      Download & Install up to 600+ softwares (Tested & Working - using 3rd party tool + Powershell)
       Auto prediction of Apps name of text typed inside input (Tested & Working - AutoIT Only)
      Change OEM Informations (Tested & Working -  AutoIT)
      Disable ScreenSaver (Work but require testing AutoIT only)
      Change Computer Name (Work but require testing AutoIT only) 
      Show Computer Information and Smart status on GUI (Tested & Working - AutoIT Only)
      Change .pdf / .pdfxml from Edge to Adobe Reader DC (Tested & Working - using 3rd party tool)
      Change Edge to Google Chrome as Default Browser (Tested & Working - using 3rd party tool)
      Windows Updater (Seems to work but require further testing - AutoIT only)
      Install Office 365 / 2013 + Activation (To Do)
      Add L2TP VPN Configuration in Windows Built-in VPN (To Do)
      Save / Load tasks configuration profile in (.ini file) to avoid repeating same configuration twice (In progress - AutoIT Only)
      (EXPERIMENTAL) Install Apps from Microsoft Store with UIAutomation UDF made by: @junkew(Tested on Lenovo Vantage & Working)
         P.S: Installing Apps from Microsoft Store will require usage of  UIA spy tool made by @LarsJ which you can download & learn how to use it on UIA Spy Tool thread.
      ***  If this project interest you, Reply here This will greatly help me to see if you'd like this project to become real  ***
       
      Download: W10-Configurator.zip  (2021-07-19) 
      Project Website: W10-Configurator on GitHub 
      ______________________________________________________________________________________________________________________________
      Best Regards,
      ~WilliamasKumeliukas
    • By beautifulsoup
      Hi All,
      I'm not sure if its possible that I'm trying to achieve, I've looked into https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/AutoIt3Wrapper.html and such resources for help, but I cant really find the answer to my question.
      So upon compiling the script in SciTE, the exe file is given a Description under file Properties>Details. I understand, that  one can enter info manually there and it can even implement the version automatically with each compilation.
       
      What I'm trying to achieve is to somehow include the "@ScriptName" in the Details>File Description Field. But as I see no variable can be taken after "#" in this case.
       
      Do You think its achievable? (Win 10)
       
      Much obliged for taking time on reading this.
       
      Kind Regards,
      Brave


    • By IndianSage
      Hi,
      I have a specific situation:
      Is it possible to run autoit script/.exe as a task which in turn is automating a desktop user interactive application on windows 10 where user will not be logged in - at best I can get user locked? 
      If so how will this work or is there any tool available to do this?
      I am trying z-cron task scheduler but it runs only some part also I tried windows 10 task schedule with option to allow task to run which is user interactive type but that too does not work.
      Looking forward to hear from you to help me out of this situation.
      Thanks,
       
    • By therks
      So I have no example code currently because I'm not sure where to even start.
      We're using the parental controls on the computer and the kids each have their own user profiles with limited time. The problem we're encountering is when their time runs out, or if they just hit Win+L and leave the computer, their games are still running in the background. I was hoping to write up a quick AutoIt script and throw it in a recurring scheduled task to just sign off any of the kid's profiles that's not currently active. I found some suggestions to use "query session" and then "logoff [user]" in the command line (which it seems I could easily automate with AutoIt) but that's only available on Win Pro and this system is running Home (and I even tried copying the query.exe from a Pro system but it errors out). Is there some AutoIt equivalent to the query and logoff functions or am I stuck?
      Edit: I'm adding some clarification to exactly what I'm hoping to get out of this script.
      I'd like to setup a scheduled task that runs outside of the current user (perhaps under the SYSTEM account?) in case NO user is currently active, that will detect which users are currently signed in. If users from a predefined list are not currently active, sign them off entirely.
      So let me give two examples:
      Example #1:
      - I am logged in, but not active (I left my browser open and locked the computer) - Nephew A is logged in, but not active (his time ran out while his game was running and the computer auto-locked) - Nephew B is logged in, and currently playing a game When script runs, ignore my profile (leave it signed in), log out Nephew A (closing his game), and ignore Nephew B because he's actively using the computer. Example #2:
      - I am logged in - Nephew A is logged in - Nephew B is logged in - No users are currently active (Windows is sitting on the choose user / sign in screen) When script runs, ignore my profile, log out Nephew A and Nephew B.  
      I would perceive pseudo code, going as such:
      $aChildUsers = [ 'NephewA', 'NephewB' ] $aUserList = GetSignedInUsers() For $i = 0 to UBound($aUserList)-1 If Not UserIsActive($aUserList[$i]) Then For $j = 0 to UBound($aChildUsers)-1 If $aUserList[$i] = $aChildUsers[$j] Then LogOffUser($aUserList[$i]) Next EndIf Next Obviously, GetSignedInUsers(), UserIsActive(), LogOffUser() are not real functions. What I'm searching for is something of their equivalent.
      Thanks for your time!
    • By paw
      I use SetSoundDevice to control my audio devices but the UI was either
       
      blurry like this:
      or unusable like this:

      so I made this horrible thing to add scaling to the GUI:
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_HiDpi=y #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/sf /sv /rm #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <File.au3> ;~ _convertGUI("") If $CmdLine[0] <> 0 Then _convertGUI($CmdLine[1]) Func _convertGUI($sFilePath) If $sFilePath <> "" Then Local $aArray = FileReadToArray($sFilePath) Else ;TEST DATA Local $aArray[6] = ['$H_Res_Language = GUICtrlCreateProgress(5, 120, 210 + 25, 480, 20, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) ; $CBS_DROPDOWNLIST)', _ 'Local $h_Ok = GUICtrlCreateButton("Ok", 72, 224, 81, 33, 0)', _ 'GUICreate($Warning_TiTle, 700, 310, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MINIMIZEBOX)', _ 'GUICtrlCreateLabel("Output type: ", 30, 130, 65, 20) ;, $SS_RIGHT)', _ '$H_FieldNameEdit = GUICtrlCreateEdit($INP_FieldNameEdit, 100,260+25, 500, 150 - 25) ;comment', 'Local $H_CANCEL = GUICtrlCreateGraphic("Cancel", 224, 224, 97, 33, 0)'] EndIf Local $hTimer = TimerInit(), $iGUIElementCount = 0, $sResult = "", $sFileName = "", $sDrive = "", $sDir = "", $sExtension = "" If @Compiled Then _PathSplit($sFilePath, $sDrive, $sDir, $sFileName, $sExtension) $sFileName = StringRegExpReplace($sFilePath, "^.*\\", "") EndIf For $i = 0 To (UBound($aArray) - 1) If StringRegExp($aArray[$i], "GUICtrlCreate|GUICreate") Then $sResult = _splitComma($aArray[$i]) If Not @error Then $aArray[$i] = $sResult $iGUIElementCount += 1 EndIf Next ConsoleWrite("t = " & TimerDiff($hTimer) & " GUI elements = " & $iGUIElementCount & " lines = " & (UBound($aArray) - 1) & @CRLF) If $sFileName <> "" Then Local $hFile = FileOpen("edited." & $sFileName, 2) _FileWriteFromArray("edited." & $sFileName, $aArray) FileClose($hFile) EndIf Exit EndFunc ;==>_convertGUI Func _splitComma($sString) Local $sSplitResult = "", $sTrimmedR = "", $sTrimmedL = "" Local $aSplit = StringSplit($sString, ',') If Not @error Then $sTrimmedR = "" $sTrimmedL = "" For $j = 1 To $aSplit[0] If StringRegExp($aSplit[1], "(?:.GUICtrlCreateGraphic|GUICtrlCreateProgress|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTreeView)") Then If $j = 1 Then While StringLeft($aSplit[$j], 1) <> '(' $sTrimmedL &= StringLeft($aSplit[$j], 1) $aSplit[$j] = StringTrimLeft($aSplit[$j], 1) WEnd $aSplit[$j] = StringTrimLeft($aSplit[$j], 1) EndIf EndIf If $j = $aSplit[0] Then While StringRight($aSplit[$j], 1) <> ')' $sTrimmedR &= StringRight($aSplit[$j], 1) $aSplit[$j] = StringTrimRight($aSplit[$j], 1) WEnd $aSplit[$j] = StringTrimRight($aSplit[$j], 1) EndIf If StringRegExp($aSplit[$j], "[0-9]") And $aSplit[$j] <> -1 And $aSplit[$j] <> 0 And $aSplit[$j] <> 1 And Not StringInStr($aSplit[$j], ')') Then If StringRegExp($aSplit[$j], "\-|\+") Then ;put parenthesis around + or - $aSplit[$j] = '(' & $aSplit[$j] & ")*$g_DPI" Else $aSplit[$j] = $aSplit[$j] & "*$g_DPI" EndIf EndIf If $j < $aSplit[0] Then $sSplitResult &= $aSplit[$j] & ',' ElseIf $j = $aSplit[0] Then $sSplitResult &= $aSplit[$j] & ')' Else $sSplitResult &= $aSplit[$j] EndIf Next If $sTrimmedR <> "" Then $sSplitResult &= StringReverse($sTrimmedR) If $sTrimmedL <> "" Then $sSplitResult = $sTrimmedL & '(' & $sSplitResult Else SetError(1) Return EndIf ConsoleWrite($sSplitResult & @CRLF) Return $sSplitResult EndFunc ;==>_splitComma
      And now it looks good: 
      but it doesn't work on everything, for example the "GUICtrlCreateLabel("Output type: ", 30, 130, 65, 20) ;, $SS_RIGHT)" (from the autoit3wrapper gui)
      because the comment contains a parenthesis and it would break completely if there were variables as parameters..
      Is there some kind of parser around that I could use instead or maybe someone who has already done something like this?
×
×
  • Create New...