Topic: Re: Extending opencurs.vdm (1 of 2), Read 23 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Monday, January 10, 2011 04:01 PM

On 10.01.2011 17:22 vtech-keystroke Listmanager wrote:
> From: "peter rejto"
>
> Now I would like to identify the snippet of your
> Opencurs.vdm, which does this. In particular I
> would like to know, how does Opencurs.vdm
> call my 7-zip.exe program.

It's here:


if (Is_WinNT) { //In WinNT/2000/XP...
Reg_Set(106, "cmd /c ") // use cmd command to be able to avoid DOS option
} else { //In Win95,98
Reg_Set(106, 'start "" ') // use start with double quotes added to fill the parameter "title",
// (important since the filename is in double quotes when calling application below!)
}
Sys(`|@(106) "|@(121)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in application



In fact Windows itself determines the standard application when a known
file is "executed" by means of "cmd" or "start".

Christian

 


Topic: Re: Extending opencurs.vdm (2 of 2), Read 18 times
Conf: Keyboard, keystroke macros
From: Peter Rejto
Date: Monday, January 10, 2011 05:59 PM

On 1/10/2011 4:01:11 PM, Christian Ziemski wrote:
>On 10.01.2011 17:22 vtech-keystroke
>Listmanager wrote:
>> From: "peter rejto"
>>
>> Now I would like to identify the snippet of your
>> Opencurs.vdm, which does this. In particular I
>> would like to know, how does Opencurs.vdm
>> call my 7-zip.exe program.
>
>It's here:
>
>
>if (Is_WinNT) { //In
>WinNT/2000/XP...
>Reg_Set(106, "cmd /c ") // use cmd
>command to be able to avoid DOS option
> } else { //In Win95,98
>Reg_Set(106, 'start "" ') // use start
>with double quotes added to fill the
>parameter "title",
>// (important since the filename is in
>double quotes when calling application
>below!)
> }
>Sys(`|@(106)
>"|@(121)"`,SUPPRESS+SIMPLE+NOWAIT)
>//Open file in application
>
>
>
>In fact Windows itself determines the
>standard application when a known
>file is "executed" by means of "cmd" or
>"start".

Christian,

Great, you really helped me out !


This was only a model problem. My real problem was this.


Suppose, by mistake I have loaded a .zip file into Vedit. So,I would like to load it in its application.

To do this, all I need is a very simple adaptation of the code that you have just given me. Here it is:

:OPEN-CURRENT-ZIP:
Reg_Set(106, "cmd /c ") // use cmd command to be able to avoid DOS option
Reg_Set(110, PATHNAME)
Sys(`|@(106) "|@(110)"`,SUPPRESS+SIMPLE+NOWAIT) //Open file in application
Return

I did try to run this subroutine and it seems to work for me ! That is to say, it opens my current .zip file in its application.


In other words, now I can treat the case of a current .zip file, similarly to the way you treated the case of the current .html file with the {File, Open (More..), Preview current file in browser} command.

In fact, I have a hunch, that a Vedit Guru could enhance your Opencurs.vdm to treat each of these two cases with the
{Preview current file in browser}
Vedit command.


Thanks again,


-peter