possible to link an activecontrol on dialog to objectname ?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

possible to link an activecontrol on dialog to objectname ?

Post by Djek » Fri Oct 26, 2012 7:03 am

hi all,

if there is a Dialog, and a Button on that Dialog is activated, ik can detect that with the getdialogproperty activecontrol.

However, the result is a value such as 39900003
And that value differs each time. Gues Windows assign that value to the Button.

So now the question is: is there a way to translate that value back to the Button name?

Thanks,

kind regard,
Djek

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Oct 26, 2012 1:51 pm

Not sure what you're wanting to accomplish. Something like this maybe?

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  ClientHeight = 100
  ClientWidth = 400
  object MSButton1: tMSButton
    Left = 50
    Top = 50
    Width = 75
    Height = 25
    Caption = 'MSButton1'
  end
  object MSButton2: tMSButton
    Left = 250
    Top = 50
    Width = 75
    Height = 25
    Caption = 'MSButton2'
  end
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,msButton1,OnEnter,Button(msButton1)
AddDialogHandler>Dialog1,msButton2,OnEnter,Button(msButton2)

Show>Dialog1,

SRT>Button
  GetDialogProperty>Dialog1,,ActiveControl,res
  MDL>%res%  %button_var_1%
END>Button

User avatar
Djek
Pro Scripter
Posts: 148
Joined: Sat Feb 05, 2005 11:35 pm
Location: Holland
Contact:

Post by Djek » Fri Oct 26, 2012 2:08 pm

Thanks !
not exactly what i wanted, but with this method i can do what i want.
You nailed it.
Thanks again,
kind regards
Djek

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts