Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

Using WinLib in Windows NT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using WinLib in Windows NT

    This is a repost of an earlier question:

    Before I use any of the routines of WinLib, I check whether they
    are available, using the following routine:
    Code:
    FUNCTION WindowsActive () PUBLIC AS INTEGER
        IF UCASE$(ENVIRON$("OS")) = "WINDOWS_NT" THEN
            FUNCTION = -1
            EXIT FUNCTION
        END IF
        ! mov   ax, &H1600
        ! int   &H2F
        ! cmp   al, 4
        ! jnz   NotWin95
        FUNCTION = -1
        EXIT FUNCTION
    NotWin95:
        FUNCTION = 0
    END FUNCTION
    The detection for WinNT was added by Lance, but now I wonder if
    this makes sense.

    My question is: are the functions of WinLib (LFN support,
    gain focus, etc) available when running under WinNT (or Win2K)?
    Could anyone test if they can retrieve a long filename under
    WinNT? (so just skip the WindowsActive check)

    Thanks in advance!

    ------------------
    Sebastian Groeneveld
    mailto:[email protected][email protected]</A>
    Sebastian Groeneveld
    mailto:[email protected][email protected]</A>

  • #2
    You are quoting my code slightly out of context (I only suggested a simple solution to detect NT/2000's presence), but your questions are still quite valid.

    How about posting the link to WinLib (and possibly some test code to try out), so folks can answer your questions without having to write a mass of code... Thanks!

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Lance, you're right, let me put it more clear:
      Your code was for detecting Windows NT, and it makes sense! It's
      the fact that I included it in my WindowsActive function (to see
      if I can use WinLib) that might be wrong...

      WinLib can be found at the Powerbasic download section:
      http://www.powerbasic.com/files/pub/...y/WINLIB12.ZIP

      And the code shouldn't be too hard to write:
      Code:
      $LINK "WINLIB.PBU"
      PRINT LFN("C:\PROGRA~1", 0)
      This tries to detect the "Program Files" folder, dunno whether it
      exists in Windows NT...

      ------------------
      Sebastian Groeneveld
      mailto:[email protected][email protected]</A>

      [This message has been edited by Sebastian Groeneveld (edited March 28, 2001).]
      Sebastian Groeneveld
      mailto:[email protected][email protected]</A>

      Comment


      • #4
        Ok, it works fine in Win2K, returning "C:\Program Files".

        I'll test under NT4 later on when I reboot my NT4 box...



        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment

        Working...
        X