Jump to content
Sign in to follow this  
Puck

Autoupdated Preview Pane

Recommended Posts

Puck

Hello all. I am trying to simulatate what is beening done in this .HTA script here.

http://community.spiceworks.com/scripts/show/673-psexec-command-builder-hta

In that I want a preview pane that will autoupdate as the users changes options on the main form, specifically with the 'command' and 'variables' input fields. The lower pane autoupdates as the user is typing. I trying to search a bit but I may not be using the correct search term to do what I want. Any push in the right direction would be appreciated.

dtp

Share this post


Link to post
Share on other sites
Puck

Sorry to reply to my own post but it looks like I needed GUIRegisterMsg.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
GUICreate("Preview Test")
$hInput1 = GUICtrlCreateInput("", 20, 20, 100, 21)
$hInput2 = GUICtrlCreateInput("", 200, 20, 100, 21)
$preview = GUICtrlCreateLabel("", 20, 100, 268, 33)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd
Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Local $text1 , $text2
    Local $iIDFrom = BitAND($wParam, 0xFFFF)
    Local $iCode = BitShift($wParam, 16)
    If $iCode = $EN_CHANGE Then
        $text1 = GUICtrlRead($hInput1, 1)
  $text2 = GUICtrlRead($hInput2, 1)
  GUICtrlSetData($preview, $text1 & " " & $text2 )
    EndIf
EndFunc
Edited by Puck

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  

×