• find out if TLC is running on 64 bit Windows (to call on screen keyboar

    From Harald Oehlmann@21:1/5 to All on Tue Jul 5 19:36:23 2022
    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only application. The 64 bit version at an obscure path must be called on 64
    bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp

    Wiki entry for this will follow on solution...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Tue Jul 5 20:34:47 2022
    Am 05.07.22 um 19:36 schrieb Harald Oehlmann:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?


    This is IMHO not guaranteed to exist. But you can look for the WOW64
    folder. My Windows is not running currently, but IIRC then you look into C:\Windows (there is some %% magic thing for the correct path) and then
    you'll see if the WOW-Folder exists

    https://en.wikipedia.org/wiki/WoW64

    If that doesn't work, you could compile a small program for 64bit (hello
    World) and try to execute it.

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Harald Oehlmann on Tue Jul 5 14:17:56 2022
    On 7/5/22 1:36 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.


    Hello,

    Check out tcl_platform(wordSize). I believe it is 4 for 32-bit and
    higher for 64-bit platforms.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et4@21:1/5 to All on Tue Jul 5 13:31:55 2022
    On 7/5/2022 1:19 PM, et4 wrote:
    On 7/5/2022 10:36 AM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only application. The 64 bit version at an obscure path must be called on 64 bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp

    Wiki entry for this will follow on solution...

    # 64 bit os
    % package require registry
    1.3.4
    % catch [registry get {HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node} {}] val
    0
    % set val
    %


    # 32 bit os
    % package require registry
    1.3.3
    % catch {registry get {HKEY_LOCAL_MACHINE\SOFTWARE} WOW6432Node} val
    1
    % set val
    unable to get value "WOW6432Node" from key "HKEY_LOCAL_MACHINE\SOFTWARE": The system cannot find the file specified.
    %



    Opps, should be this on either system:

    %catch {registry get {HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node} {}} val
    1
    % set val
    unable to open key: The system cannot find the file specified.
    %


    %catch {registry get {HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node} {}} val
    0
    % set val
    %

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et4@21:1/5 to Harald Oehlmann on Tue Jul 5 13:19:14 2022
    On 7/5/2022 10:36 AM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only application. The 64 bit version at an obscure path must be called on 64 bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp

    Wiki entry for this will follow on solution...

    # 64 bit os
    % package require registry
    1.3.4
    % catch [registry get {HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node} {}] val
    0
    % set val
    %


    # 32 bit os
    % package require registry
    1.3.3
    % catch {registry get {HKEY_LOCAL_MACHINE\SOFTWARE} WOW6432Node} val
    1
    % set val
    unable to get value "WOW6432Node" from key "HKEY_LOCAL_MACHINE\SOFTWARE": The system cannot find the file specified.
    %

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ashok@21:1/5 to Harald Oehlmann on Wed Jul 6 07:51:22 2022
    twapi::wow64_process - https://twapi.magicsplat.com/v4.7/process.html#wow64_process

    On 7/5/2022 11:06 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only application. The 64 bit version at an obscure path must be called on 64
    bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp


    Wiki entry for this will follow on solution...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave@21:1/5 to Harald Oehlmann on Tue Jul 5 22:30:04 2022
    # For 32- vs. 64-bit
    # Technique from https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/
    if { [string equal $env(PROCESSOR_ARCHITECTURE) "x86"] && ! [info exists env(PROCESSOR_ARCHITEW6432)] } {
    set bitness 32
    } else {
    set bitness 64
    }

    On 7/5/2022 12:36 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only application. The 64 bit version at an obscure path must be called on 64
    bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp


    Wiki entry for this will follow on solution...


    --
    computerjock AT mail DOT com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Wed Jul 6 09:11:07 2022
    Am 06.07.2022 um 05:30 schrieb Dave:
    # For 32- vs. 64-bit
    # Technique from https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/

    if { [string equal $env(PROCESSOR_ARCHITECTURE) "x86"] && ! [info exists env(PROCESSOR_ARCHITEW6432)] } {
      set bitness 32
    } else {
      set bitness 64
    }

    On 7/5/2022 12:36 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only
    application. The 64 bit version at an obscure path must be called on 64
    bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp



    Wiki entry for this will follow on solution...



    Dear all,

    thank you for all great propositions.

    Yes, tcl_platform and ::platform::identify was my first point.
    Unfortunately, they are identical for a 32bit wish running on 32 and 64
    bit windows.

    But thank you for all the other propositions.
    I prefer the twapi solution, as twapi is anyway present.

    And I was surprised that even magic Cristian Gollwitzer is caring about
    Windows ;-).

    Thank you and take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Wed Jul 6 15:25:36 2022
    Am 06.07.2022 um 09:11 schrieb Harald Oehlmann:

    Am 06.07.2022 um 05:30 schrieb Dave:
    # For 32- vs. 64-bit
    # Technique from
    https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/

    if { [string equal $env(PROCESSOR_ARCHITECTURE) "x86"] && ! [info
    exists env(PROCESSOR_ARCHITEW6432)] } {
       set bitness 32
    } else {
       set bitness 64
    }

    On 7/5/2022 12:36 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only
    application. The 64 bit version at an obscure path must be called on 64
    bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp



    Wiki entry for this will follow on solution...



    Dear all,

    thank you for all great propositions.

    Yes, tcl_platform and ::platform::identify was my first point.
    Unfortunately, they are identical for a 32bit wish running on 32 and 64
    bit windows.

    But thank you for all the other propositions.
    I prefer the twapi solution, as twapi is anyway present.

    And I was surprised that even magic Cristian Gollwitzer is caring about Windows ;-).

    Thank you and take care,
    Harald

    Thanks for all the help. Here is the final quite complex solution:

    https://wiki.tcl-lang.org/page/Keyboard+widget?V=14

    Thanks,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Griffiths@21:1/5 to Harald Oehlmann on Wed Jul 6 13:50:39 2022
    On Wednesday, 6 July 2022 at 14:25:41 UTC+1, Harald Oehlmann wrote:
    Am 06.07.2022 um 09:11 schrieb Harald Oehlmann:

    Am 06.07.2022 um 05:30 schrieb Dave:
    # For 32- vs. 64-bit
    # Technique from
    https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/

    if { [string equal $env(PROCESSOR_ARCHITECTURE) "x86"] && ! [info
    exists env(PROCESSOR_ARCHITEW6432)] } {
    set bitness 32
    } else {
    set bitness 64
    }

    On 7/5/2022 12:36 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit
    system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only >>> application. The 64 bit version at an obscure path must be called on 64 >>> bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp



    Wiki entry for this will follow on solution...



    Dear all,

    thank you for all great propositions.

    Yes, tcl_platform and ::platform::identify was my first point. Unfortunately, they are identical for a 32bit wish running on 32 and 64
    bit windows.

    But thank you for all the other propositions.
    I prefer the twapi solution, as twapi is anyway present.

    And I was surprised that even magic Cristian Gollwitzer is caring about Windows ;-).

    Thank you and take care,
    Harald
    Thanks for all the help. Here is the final quite complex solution:

    https://wiki.tcl-lang.org/page/Keyboard+widget?V=14

    Thanks,
    Harald

    Not an answer to your question, but potentially to your end goal - have you tried just using [auto_execok osk.exe] ? Not extensively tested by any means but returns a suitable result on my current (64-bit Win 7) system.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Thu Jul 7 08:52:29 2022
    Am 06.07.2022 um 22:50 schrieb Mike Griffiths:
    On Wednesday, 6 July 2022 at 14:25:41 UTC+1, Harald Oehlmann wrote:
    Am 06.07.2022 um 09:11 schrieb Harald Oehlmann:

    Am 06.07.2022 um 05:30 schrieb Dave:
    # For 32- vs. 64-bit
    # Technique from
    https://blogs.msdn.microsoft.com/david.wang/2006/03/27/howto-detect-process-bitness/

    if { [string equal $env(PROCESSOR_ARCHITECTURE) "x86"] && ! [info
    exists env(PROCESSOR_ARCHITEW6432)] } {
    set bitness 32
    } else {
    set bitness 64
    }

    On 7/5/2022 12:36 PM, Harald Oehlmann wrote:

    Dear TCL'ers,

    how may I find out, if my 32 bit wish is running on a 64 or 32 bit
    Windows OS?

    What I found by tcl_platform and platform::identify is, that a 32 bit >>>>> system is presented.

    Is there any trick ? TWAPI ?

    If "C:\Program Files (x86)" exists -> 64 bit ?

    Thanks for any idea, I feel quite dump.

    Harald

    P.S. The background is to open the on screen keyboard from a touch-only >>>>> application. The 64 bit version at an obscure path must be called on 64 >>>>> bit versions. The 32 bit version exists but shows an error box:

    https://stackoverflow.com/questions/8508935/getting-osk-exe-to-run-from-c-sharp



    Wiki entry for this will follow on solution...



    Dear all,

    thank you for all great propositions.

    Yes, tcl_platform and ::platform::identify was my first point.
    Unfortunately, they are identical for a 32bit wish running on 32 and 64
    bit windows.

    But thank you for all the other propositions.
    I prefer the twapi solution, as twapi is anyway present.

    And I was surprised that even magic Cristian Gollwitzer is caring about
    Windows ;-).

    Thank you and take care,
    Harald
    Thanks for all the help. Here is the final quite complex solution:

    https://wiki.tcl-lang.org/page/Keyboard+widget?V=14

    Thanks,
    Harald

    Not an answer to your question, but potentially to your end goal - have you tried just using [auto_execok osk.exe] ? Not extensively tested by any means but returns a suitable result on my current (64-bit Win 7) system.

    Mike,
    thank you for the suggestion.
    Yes, this file is present. If you execute it, you get an error box. "[autoexec_ok start] osk" does not find it and "file exist" returns 0,
    even as I can see it in the file explorer.

    This experience was the root of the my question.

    Thank you all for caring,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Thu Jul 7 11:18:03 2022
    * Mike Griffiths <[email protected]>
    | Not an answer to your question, but potentially to your end goal -
    | have you tried just using [auto_execok osk.exe] ? Not extensively
    | tested by any means but returns a suitable result on my current
    | (64-bit Win 7) system.

    As Harald pointed out, this doesn't work on Windows-10 64bit:

    $ cat t.tcl
    puts [auto_execok osk.exe]
    exec [auto_execok osk.exe]

    $ tclsh t.tcl
    C:/Windows/system32/osk.exe
    couldn't execute "C:\Windows\system32\osk.exe": invalid argument
    while executing
    "exec [auto_execok osk.exe]"
    (file "t.tcl" line 2)

    $ uname -a
    MINGW64_NT-10.0-19044 serval 3.2.0-340.x86_64 2021-08-02 16:30 UTC x86_64 Msys

    Typing 'osk' in a windows cmd shell however works, and

    exec cmd /c osk

    works, too from tclsh. However, I would bet this does not work on a
    32-bit system :-)))

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)