AutoHotkey Community

It is currently May 26th, 2012, 2:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 164 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 11  Next
Author Message
 Post subject: Wooo Hooo!
PostPosted: June 10th, 2005, 12:08 am 
Offline

Joined: February 26th, 2005, 5:36 am
Posts: 21
I know most others have already said, but just wanted to give the big

Wooo Hooo!

I got the DLL, got my tail.exe and mix em up in the same bowl and its LIKE BUTTER BABY!!!!

BCX looks cool too corrupt - thanks for introducing me to another programming platform as well.

V.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 10th, 2005, 6:06 pm 
JBensimon wrote:
Quote:
my program should also run in the command line environment, which does not separate stderr and stdout - they get mixed
If you're running the program in the command line environment of Windows NT/2000/XP/2003, you can use the "2>" syntax to redirect error output and separate it from standard output, as in
Code:
Program parameters >StdOut.txt 2>StdErr.txt

Jacques.


If you want both stdout and stderr to go to a single file, you can use:
Code:
Program parameters > Stdout-err.log 2>&1


Report this post
Top
  
Reply with quote  
 Post subject: Re: Wooo Hooo!
PostPosted: June 13th, 2005, 1:19 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
valenfor wrote:
I know most others have already said, but just wanted to give the big

Wooo Hooo!

I got the DLL, got my tail.exe and mix em up in the same bowl and its LIKE BUTTER BABY!!!!

BCX looks cool too corrupt - thanks for introducing me to another programming platform as well.

V.
Thanks & you're welcome :) .


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 13th, 2005, 2:01 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
BCX Source (version 3.1.2)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 13th, 2005, 11:21 am 
Online

Joined: March 16th, 2005, 10:33 pm
Posts: 968
Location: Frisia
Muy cool indeed! 8)

:D

Thank you! Working with AutoHotkey is getting better and better :)

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: cmdret usage problems
PostPosted: June 26th, 2005, 9:52 am 
Offline

Joined: May 14th, 2005, 4:40 pm
Posts: 3
Hi all,

basically, I have to agree that corrupt’s cmdret is extremely helpful. However, I’ve some problems with this tool and wonder if someone can point me in the right direction.

I’m trying to compile a C/C++ project using a PERL script (see CompileCmd below) and redirect its output to a GUI edit window within a tab control. Both versions (one using CMDret.exe and one using the cmdret.dll) basically work, that is, the output shows up in the edit control but with

version 1 (CMDret.exe)
- close to the end of the compile process the output just stops, no compiler output files are created - seems to me that the process just dies at some stage (the PERL script runs ok in a DOS box)

version 2 (cmdret.dll)
- everything works ok with regard to the compile process but the output window is not refreshed at some point - just the grey output window without the edit or tab control can be seen. Once the compile process completed, I can click on the output window to re-display the controls as well as the compiler output.
- one additional question: Is it somehow possible to get the PID of the CMD process as in the CMDret.exe version?

Version 1 using CMDret.exe:
Code:
GuiControl, 2:Choose, OutputTab, 2
SetTimer, SubOutputCompile, 250
RunWait, %RunCMD1% "p=" "%comspec% /c cd /d %vProjectFolder% && date/t &&  time /t && %CompileCmd% && date/t && time /t", , hide, CompilePID
SetTimer, RefOutputCompile, Off
Gosub, SubOutputCompile




Version 2 using cmdret.dll:
Code:
CMD = %comspec% /c cd /d %vProjectFolder% && %CompileCmd% && echo.
OutputWindow := WinExist("Output Window")
GuiControl, 2:Choose, OutputTab, 2    
StrOut := DllCall("cmdret.dll\RunInControl", "str", CMD, "Uint", OutputWindow, "str", "Edit", "int", "2")



Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 26th, 2005, 5:28 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
Hi zipzulu,

Thanks for the feedback :) .

If using CMDret.exe you could try using cmdstub.exe
Code:
RunWait, cmdstub.exe %RunCMD1% "p=" "%comspec% /c cd /d %vProjectFolder% && date/t &&  time /t && %CompileCmd% && date/t && time /t", , hide, CompilePID
Although I am planning to update CMDret.exe soon to fix a few issues, CMDret.dll is currently considered to be an updated version of CMDret.exe.

The refresh issue with the RunInControl function in CMDret.dll seems to happen because the thread in the script is put on hold until the function in the .dll returns. This seems to prevent the Window from refreshing until the function returns. You could maybe try calling the function in the .dll from a timed sub or by creating a small script that calls the function, then execute the script using the Run command (untested). Thanks for pointing this out. I'll try and post a few sample scripts using RunInControl a bit later.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 26th, 2005, 7:55 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
zipzulu wrote:
- one additional question: Is it somehow possible to get the PID of the CMD process as in the CMDret.exe version?
Out of curiosity, how would you like to use this info?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 26th, 2005, 8:41 pm 
Offline

Joined: May 14th, 2005, 4:40 pm
Posts: 3
corrupt,

first of all, thanks for the response. I haven't had the opportunity to test your suggestions but will try to do so sometime next week.

Quote:
Out of curiosity, how would you like to use this info?


The compilation process takes quite some time and sometimes I realize that my changes weren't that smart after all :wink: , so I'd like to be able to stop compiling ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 27th, 2005, 8:24 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
zipzulu wrote:
The compilation process takes quite some time and sometimes I realize that my changes weren't that smart after all :wink: , so I'd like to be able to stop compiling ...
Thanks for clarifying. That sounds like it would come in handy. I'll try and get the .exe version updated this week and look into adding the functionality to the .dll version. Thanks for the suggestion :) .


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 28th, 2005, 4:06 am 
Offline

Joined: November 1st, 2004, 1:57 am
Posts: 20
Without getting too much into the why I am trying to do the following, I am trying to create a custom GUI for the Windows FORMAT command line tool. This is for use on public computers and I cannot let our users be able to access the command line, and using "Rundll32.exe shell32.dll,SHFormatDrive" to make the Windows GUI for FORMAT has been probematic, plus the Windows GUI on XP does not pop up a dialog that shows if there were any bad sectors when the format is done.

So can CMDret be used to send keystrokes and strings to FORMAT while it is running? Can it grab all text output as it is actively displayed by the FORMAT command?

I have read through all the posts in this thread and tried using each of the functions of CMDret and before I try anymore, I'd like to know if it is possbile to do what I need to do.

Thanks much,

Jason


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 11:38 pm 
give users access to format isn't a good idea anyway, only floppies maybe


Report this post
Top
  
Reply with quote  
PostPosted: June 29th, 2005, 5:23 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2542
Jaysun wrote:
So can CMDret be used to send keystrokes and strings to FORMAT while it is running?
Nope. CMDret doesn't send keystrokes... but AutoHotkey does...
Jaysun wrote:
Can it grab all text output as it is actively displayed by the FORMAT command?
I haven't done any testing with the FORMAT command yet. I might be able to set up something to format in a few days to test... It wouldn't surprise me if it didn't work correctly though...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 6th, 2005, 8:41 am 
nice feature! but...
... i'm new to dll handling and i have a question: how to interact with a program?

The problem: i have a Linux server who provides a SSL console interface. To connect this interface i use PuTTY or its command line tool PLINK.
How can i "remote control" plink.exe from AHK to log in into the server, read the answer from server (then AHK should parse the answer strings, display messages or fill some of the data into a GUI) and then send other commands depending on the answer or user action? The ssh session has to keep open for longer time.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 7th, 2005, 6:36 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I'm not sure if CMDret can interact with a console SSH client in this manner. If it can't, you might have better luck setting the client to maintain a log file. You could have the script watch the log file and respond to what shows up in there.

Alternatively, you could periodically copy the window text (or parts of it) to the clipboard, and then parse the clipboard to determine what responses have occurred.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 164 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 11  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group