By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!How can my plugin command test whether it is on the right side of a pipe?
wchar_t shortbuf[shortbuflen] = L"%[_transient]%[_pipe]";
ExpandVariables( shortbuf, 1 );
if ( wcscmp( shortbuf, L"00" ) == 0 ) {
// do stuff ....
}
I do something like this:
Code:wchar_t shortbuf[shortbuflen] = L"%[_transient]%[_pipe]"; ExpandVariables( shortbuf, 1 ); if ( wcscmp( shortbuf, L"00" ) == 0 ) { // do stuff .... }
> ---Quote (Originally by Charles Dye)---
> I do something like this:
>
>
> Code:
> ---------
> wchar_t shortbuf[shortbuflen] = L"%[_transient]%[_pipe]";
> ExpandVariables( shortbuf, 1 );
>
> if ( wcscmp( shortbuf, L"00" ) == 0 ) {
> // do stuff ....
> }
> ---------
> ---End Quote---
> I knew that (but didn't think of it, thanks). I was asking how to do it
> with the API (Win32 or TCC/SDK). I test for the left side of a pipe or
> redirection by seeing if GetConsoleScreenBufferInfo() works.
>
> P.S. I use as little of the wcs stuff as possible; it keeps the DLL
> smaller. KERNEL32 exports several useful lstr... functions.
>
>
>
>
>