forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


windows send question

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Feb 17, 2003 12:17 am    Post subject: windows send question Reply with quote

hello all

i'am try to make vds type some txt into notepad, problem is when i run it all works fine intill it trys to wite some txt. meaning the title bar changes to the txt i'am writing it don't put it on the page Sad what i'am doing worng?

Code:

%W = @winexists(Notepad)
  window send,perform.ini - Notepad,@CR()
  wait 2
WINDOW SETTEXT,perform.ini - Notepad, [perform]
end


thanks
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Feb 17, 2003 12:42 am    Post subject: Reply with quote

You are using WINDOW SETTEXT. This sets the title bar command.
You should use WINDOW SEND, as the below example illustrates.

Code:
REM -- Put your title bar below --
%W = Untitled - Notepad
shell open,@windir(S)\notepad.exe
wait 1
WINDOW SEND, %W, @CR()
WINDOW SEND, %W, [perform]
end

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Feb 17, 2003 12:50 am    Post subject: ahhhh Reply with quote

ahhhh yup and i even read the help file AND still didn't see that Sad




WINDOW SETTEXT sends the contents of <string> to the specified window using a Windows message. Text sent to a main window using this command will replace whatever is in the title bar.



thanks for helping me
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Feb 17, 2003 4:58 am    Post subject: Reply with quote

Just a note:

If you use the window "handle" (also known as the identifier)
of a notepad instance for WINDOW SEND (or whatever), the
"handle" for that instance of notepad doesn't change, even if
ya open another file with it (which changes the title bar text)... Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Feb 17, 2003 12:05 pm    Post subject: Reply with quote

But... If there's already an instance of the file open, then a new instance
is started, how do you differentiate between the two windows? Confused

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Feb 17, 2003 12:14 pm    Post subject: Reply with quote

Use @winactive(I) as soon as notepad (or whatever) is opened
to retrieve it's handle (you may have to use a WAIT to make
sure it's fully open):

%%hwnd = @winactive(I)

OR ya can use LIST WINLIST and search for the window name
(or a partial name), then use @winexists(@item(1)) etc. to get
the handle. In the case of notepad, you could search for the
filename in the window titles if ya wanted... Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Feb 17, 2003 12:26 pm    Post subject: Reply with quote

The second approach is definately to be recommended because you never know how long it takes
to open a new window (all depends on system load, size of file etc.). Inbetween the user just may
click another window for instance, and then you'll find your prog sending commands to the false
window.

But using window titles is also a bit tricky. Because titles, associated programs etc. may
change from user to user, from OS to OS, and language to language.

I've been struggling a bit with this. I so far I haven't found a method to be 100% reliable..

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Feb 17, 2003 12:33 pm    Post subject: Reply with quote

I agree Dread, Wink

But if your program opens a file with notepad or wordpad, the
filename will always be in the title - or will it... (XP, etc.)? Confused

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Feb 17, 2003 12:41 pm    Post subject: Reply with quote

Yeah, normally the filename will be in the title. But if you use something like SHELL to open
a txt file then you'll never know which program is associated with .txt files.

And users may customize their system. I, for instance, have replaced NOTEPAD with
another program by renaming a couple of EXE files. And Notepad will not necessarily be
called Notepad in non-English language versions of Windows. Confused

And so everything may change all the time, making life difficult for us Wink

Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Feb 17, 2003 12:52 pm    Post subject: Reply with quote

Actually... if notepad is sufficient for the task, ya could use your
own multi-line edit control in a child window (or ship your own
text editor) - it'd have approx the same capacity as notepad... Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Feb 17, 2003 5:00 pm    Post subject: kk Reply with quote

ok thanks guy for the help..i like mac's last idea this would avoid any problems..

thanks

again
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group