Loading ...
Sorry, an error occurred while loading the content.
 

AW: Re: [libertybasic] dll call

Expand Messages
  • pendl2megabit
    The messages are all available in the group on the web. You would just have needed to copy it again.  Von Samsung Mobile gesendet ... Von: Marc Rossi
    Message 1 of 1 , Jun 20, 2013
      The messages are all available in the group on the web. You would just have needed to copy it again. 


      Von Samsung Mobile gesendet

      -------- Ursprüngliche Nachricht --------
      Von: Marc Rossi <mrossi8888@...>
      Datum:
      An: libertybasic@yahoogroups.com
      Betreff: Re: [libertybasic] dll call

      Thanks.  I got it from you before but saved it accidentally to my   USB drive and that erased what you had already done.
      Thanks again and thanks to Richard too.
      Marc


      ________________________________
      From: Stefan Pendl <pendl2megabit@...>
      To: libertybasic@yahoogroups.com
      Sent: Thursday, June 20, 2013 2:59 PM
      Subject: Re: [libertybasic] dll call
       
        

      Am 20.06.2013 07:35, schrieb Marc:
      > Good Morning,
      > I have been working on this for 2 days now.  If anyone can help me I would appreciate it.  I can't get the path to the file I am looing for.

      Here is the not complicated solution.

      '---code start (watch for line wraps)

      print

      ModuleHandle = GetModuleHandle("kernel32.dll")
      print "ModuleHandle = "; ModuleHandle

      print

      FileName$ = GetModuleFileName$(ModuleHandle)
      print "FileName$ = " ; FileName$

      print
      end

      function GetModuleHandle(ModuleName$)
      calldll #kernel32, "GetModuleHandleA" , _
      ModuleName$     as ptr, _
      GetModuleHandle as ulong
      end function

      function GetModuleFileName$(hModule)
      nSize = _MAX_PATH + 1
      lpFilename$ = space$(nSize); CHR$(0)

      calldll #kernel32, "GetModuleFileNameA",_
      hModule     as uLong,_
      lpFilename$ as ptr,_
      nSize       as uLong,_
      result      as uLong

      if result > 0 then GetModuleFileName$ = trim$(lpFilename$)
      end function

      '---code end

      --
      Stefan Pendl
      http://stefanpendl.runbasichosting.com/

      LB 4.04 Pro ... http://www.libertybasic.com/assist.html
      LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

      LB Community Wiki .............. http://basic.wikispaces.com/
      LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
      LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

      Books at http://www.lulu.com/ and http://www.amazon.com/
      Alyce Watson ... APIs for Liberty BASIC
      Carl Gundel .... Beginning Programming with Liberty BASIC

      Windows 7 Home Premium 64-bit SP1
      AMD Turion X2 RM-70 2GHz, 4GB RAM

        
              

      [Non-text portions of this message have been removed]



      ------------------------------------

      Yahoo! Groups Links





      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.