Jump to content

Use @SW_LOCK And Keep a Control Enabled?


Recommended Posts

So, I was curious if it's possible to use @SW_LOCK to lock the main gui and enable a hidden child gui which holds a label with a counter count up while the main gui is locked. While reading the help file and searching the forums, I saw that I can use GUISwitch() to possibly do this, but I'm not too sure how.

Does anyone have a quick example available that can show this?

Thank you.

Link to comment
Share on other sites

Why do you want a hidden gui with a label, who's going to see it?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I have a main GUI that has listview and a label with a counter on it. When the listview is populated, the label is changed with the number of items. I want to lock the GUI while the listview is populated, but when I do that, the counter label can't display the count of items as it increments.

I figured if a child GUI is created that has topmost attributes, it can overlap the counter label (that's now locked) and can display a rolling counter just as the now locked on control would. Once all the items have been added to the listview, the child GUI can be hidden again.

I hope this makes sense...

EDIT: Here's a quick sample as to what I want to do

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $iItemCount = 0

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438)
$ListView1 = GUICtrlCreateListView("Item", 24, 16, 562, 398, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_CHECKBOXES, $LVS_EX_HEADERDRAGDROP))
$Label1 = GUICtrlCreateLabel("0 items", 24, 416, 100, 16, $SS_SUNKEN)
GUISetState(@SW_SHOW, $Form1)
#EndRegion ### END Koda GUI section ###

GUISetState(@SW_LOCK, $Form1)

For $i = 0 To 10000
    GUICtrlCreateListViewItem("Item " & $i, $ListView1)
    GUICtrlSetData($Label1, $i & " items "); I'd like this to keep counting while the GUI is locked
Next

GUISetState(@SW_UNLOCK, $Form1)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Edited by buymeapc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...