Results 1 to 3 of 3

Thread: Interfacing ThinBasic with Windows

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Location
    France
    Posts
    11
    Rep Power
    6

    Interfacing ThinBasic with Windows

    Hello everybody.


    The TB project I'm working on today requires to open a Windows explorer by the script on certains conditions.

    The need has two cases :
    • Open explorer window and continue the script regarless of what is done in this window by the user.
    • Open explorer window and wait until user closes the window

    In the first case, the window may be closed by the user without interferring with TB script or stay active after the end of the creating script.
    Script and explorer window are completely independent.

    I used
    Pid = OS_Shell( command_exec_path & command_opt &  file_to_work_on  , %OS_WNDSTYLE_NORMAL, %OS_SHELL_ASYNC)
    
    to call a program (in this case :Acrobat_reader ) and continue execution of script.
    The script uses
     OS_ProcessKillById(PiD)
    
    to stop the program, sometimes it is unuseful as the users already closed the window.

    I also used
    %OS_SHELL_SYNC
    
    if waiting was necessary.


    NOTE:

    I noticed with 'Sysinternals-Process-explorer' that EXPLORER.EXE has only ONE instance, regardless of the number of explorer windows open.
    And when I bundle a script, at the end of succesful bundling, a popup message invites to browse the executable directory.
    If I click on 'YES' , a new process'EXPLORER.EXE' is created, independent of the explorer lauched at booting.
    Closing the window makes process die, and killing the process closes the window and nothing is done to other explorer windows

    The creator of BUNDLE could help.


    Many thanks for help.

    Justin
    Last edited by justin045; 22-11-2024 at 21:19.

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,816
    Rep Power
    10
    Hi Justin

    In thinBundle ... at the end of a successfully bundled operation ... if you press Yes to open Explorer window I just to something like that:
    OS_Shell("EXPLORER.EXE /n, /e, " + $Dq + gBundle_Application_ExePath + $Dq, %OS_WNDSTYLE_NORMAL)
    
    Next thinBasic will have some new functions working on Explorer, for example to execute Explorer in a specific folder and SELECT a specific file.

    If you need something else please let me know.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Junior Member
    Join Date
    Dec 2020
    Location
    France
    Posts
    12
    Rep Power
    5

    Infos onExplorer.exe

    Quote Originally Posted by ErosOlmi View Post
    Hi Justin

    In thinBundle ... at the end of a successfully bundled operation ... if you press Yes to open Explorer window I just to something like that:
    OS_Shell("EXPLORER.EXE /n, /e, " + $Dq + gBundle_Application_ExePath + $Dq, %OS_WNDSTYLE_NORMAL)
    
    Next thinBasic will have some new functions working on Explorer, for example to execute Explorer in a specific folder and SELECT a specific file.

    If you need something else please let me know.

    Ciao
    Eros
    Hi Justin, Eros

    The response from Eros is right, but sometime earlier I have to lauch 'explorer' from a C program and I seen then that I was unable
    to create an instance and wait until it is closed.
    It appears to me that the initial created process whose Pid is returned, opens a subprocess and dies.
    So the calling program/script goes on.

    As I see in your post, you use 'Sysinternals-Process-explorer' , I invite you to enable the column named 'command line' in the tab 'process image'.
    You will see that the parameter passed to the running explorer process has nothing to do with the ones you passed in your callin code !

    When I was trying to resolve the issue, I have some interesting infos on the followig web pages :


    https://superuser.com/questions/2139...-line-switches
    https://superuser.com/questions/1519...ws-10-with-one
    http://smallvoid.com/article/windows-explorer.html
    http://davesamuels.com/utils/Explore...%20Options.txt
    https://www.sevenforums.com/general-...mand-line.html

    Perhaps will you find something in these forum pages ??


    Best regards and good luck


    Chameau

Similar Threads

  1. ThinBASIC and Windows 10
    By ErosOlmi in forum thinBasic General
    Replies: 2
    Last Post: 25-01-2015, 14:31
  2. thinBasic under Windows 8
    By ErosOlmi in forum Announcements
    Replies: 2
    Last Post: 16-09-2011, 05:46
  3. thinBasic on Windows 7
    By ErosOlmi in forum Announcements
    Replies: 4
    Last Post: 12-01-2009, 16:07
  4. Interfacing Windows SDK HelloWin
    By Charles Pegge in forum Legacy
    Replies: 16
    Last Post: 04-07-2008, 15:41

Members who have read this thread: 6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •