Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help with Dialog
#4
Much better!

Kevin, thanks for pointing out the text.getwintext and text.setclip options. I always have a tendency to use Send Keys for this kind of thing but that clearly isn't the best solution. I've changed it to the following (for this, however I had to add Send Keys) so that it works in every active window:

Code:
Copy      Help
case 4 ;;TRANSFER
,str txt.getwintext(id(3 hDlg)) ;;editable text
,txt.setclip
,,,key AT          ;; Alt+Tab
,,,0.2
,,,key Cv          ;; Ctrl+V
,,,
;After performing the above actions the Dialog has to close.
,DT_Ok(hDlg)
,

But now for some reason the Cancel button doesn't respond anymore......


Gintaras, what a clean solution! Unbelievable that all of this can be done with so few lines of code.
This method apparently doesn't use the clipboard? As I noticed that original clipboard contents was maintained. This comes in very handy for a non-clipboard version.

Two additional questions:

I noticed that with some target applications (Chrome for instance) there can be misfiring with the box (target application loses focus). Is there any way of "locking" the box to the last window or control that had focus (without specifying any specific application or window because the box needs to work with any application)?

Also, I would like to assign the following part: 

Code:
Copy      Help
str txt.getwintext(id(3 hDlg)) ;;editable text
,txt.setclip
to the Cancel button as well as to the dialogue itself. So that the users input will always be stored in case of accidental closing or misfiring. But this code gets rejected if I try to attach it to the Cancel button ( or any other new button).
How do I attach it to the dialog itself (I've done it in Visual Studio a couple of times with OnFormClosing).


Messages In This Thread
Need some help with Dialog - by InterestedNewbie - 05-02-2018, 03:05 AM
RE: Need some help with Dialog - by Kevin - 05-02-2018, 04:04 AM
RE: Need some help with Dialog - by Gintaras - 05-02-2018, 06:27 AM
RE: Need some help with Dialog - by InterestedNewbie - 05-02-2018, 04:53 PM
RE: Need some help with Dialog - by Kevin - 05-02-2018, 06:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)