It is currently Mon Sep 23, 2019 9:20 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 4:30 pm 
Offline
User
User
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 70
Hi everybody, :)

I need your knowledge!
My encryption software makes ".mkey2" files
So I said windows it launches my encryptor when we double click on a .mkey2 file
What I would like is that my cryptor opens on the path of the double clicked file (ExplorerTreeGadget)!

Here is a short code that can be considered as my software:

Code:
OpenWindow(0, 0, 0, 749, 515, "SPH", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

Global Repertoire$
calcul=0

ExplorerTreeGadget(1, 11, 73, 230, 280, Repertoire$, #PB_Explorer_NoFiles)
ExplorerListGadget(2, 247,73,490,280, "*.*", #PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder)
SendMessage_(GadgetID(2),#LVM_SETCOLUMNWIDTH,0,188) ; largeur colonne
SendMessage_(GadgetID(2),#LVM_SETCOLUMNWIDTH,1,80) ; largeur colonne

FrameGadget(3, 11,  360, 726,33, "", #PB_Frame_Single)

;titre
TextGadget(4, 20, 370,90,20,"Password :")
;password
StringGadget(5, 80,  366, 570, 20, ""  )

;invisible
ButtonGadget(6, 656,  366, 30, 20, "Hide", #PB_Button_Toggle)


;cls
ButtonGadget(7, 693,  366, 40, 20, "Clear")

Procedure Afficher_fichiers()
  SetGadgetText(2, "")                    ; Vider la liste des fichiers
  Repertoire$ = GetGadgetText(1)          ; Voir quel est le répertoire sélectionné
  SetGadgetText(2, Repertoire$)           ; Remplir la liste avec le répertoire
EndProcedure

BindGadgetEvent(1, @Afficher_fichiers(), #PB_EventType_Change) ; #PB_EventType_LeftClick)


Repeat
  Evenement = WindowEvent()
  If Evenement = #PB_Event_Gadget
    If EventGadget()=6 ; hide button
      If GetGadgetState(6)=1         
        StringGadget(5, 80,  366, 570, 20, GetGadgetText(5),#PB_String_Password)
      Else
        StringGadget(5, 80,  366, 570, 20, GetGadgetText(5))
      EndIf
     
     
    EndIf
   
   
    window_event = WaitWindowEvent(5) ;changing the progressbar's will always cause this to catch an event
    While window_event <> 0
      If window_event = #PB_Event_CloseWindow : Break 2: EndIf
      window_event = WindowEvent()
    Wend
   
  EndIf
Delay(5)
Until Evenement = #PB_Event_CloseWindow
End

;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;


Thx a lot 8)

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.70LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 4:34 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 216
Location: Germany
Code:
path.s = GetPathPart( ProgramFilename() )


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 4:44 pm 
Offline
User
User
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 70
... no, I do not think that's it.
Basically, my encryptor (a compiled .PB) is closed. When I double click on a ".mkey2" file in the windows browser, my software opens on the path (ExplorerTreeGadget) of the double clicked file!

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.70LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 5:07 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 193
Code:
; ENSURE WE CD TO PROGRAM DIR IN CASE OF INVOKATION FROM SHELL/OPEN WITH...
SetCurrentDirectory(GetPathPart(ProgramFilename()))


no?

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Last edited by oreopa on Thu Aug 15, 2019 5:08 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 5:08 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 216
Location: Germany
Sorry, misunderstood.

Try
Code:
GetPathPart(Programparameter())


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 5:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 5:10 pm
Posts: 487
Location: Doubs - France
SPH,

you want to open your app from windows shell when you click on your file ?

I don't know how to do but may be a key into the register base which associate your extension file and a parameter key to launche your app with the correct name.

Your app have to read parameter to separate file from folder.
You have to use an installer to write the right key to register base.

May be there are register base gurus here.

_________________
A+
Denis


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 6:45 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3655
Location: Berlin, Germany
SPH wrote:
My encryption software makes ".mkey2" files
So I said windows it launches my encryptor when we double click on a .mkey2 file
What I would like is that my cryptor opens on the path of the double clicked file (ExplorerTreeGadget)!

Your encryptor program can open the mkey2 file on which you clicked, because the path and name of that file is passed to your program as parameter (provided everything is configured correctly on your Windows system).

So I think this should work:
Derren wrote:
Try
Code:
GetPathPart(Programparameter())

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 7:27 pm 
Offline
User
User
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 70
Everyone is talking about "GetPathPart (Program Parameter ())" but have you tried to include it in my post 1 code?
Try and see if it works ... (I do not believe it)

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.70LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 8:03 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 635
Location: France
Quote:
So I said windows it launches my encryptor when we double click on a .mkey2 file
What I would like is that my cryptor opens on the path of the double clicked file (ExplorerTreeGadget)!

Code:
...
Repertoire$ = GetPathPart( ProgramParameter( 0 ) ) )
ExplorerTreeGadget(1, 11, 73, 230, 280, Repertoire$, #PB_Explorer_NoFiles)
...

_________________
English is not my native language, I use an online translator


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 8:08 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3655
Location: Berlin, Germany
SPH wrote:
but have you tried to include it in my post 1 code?
Try and see if it works ... (I do not believe it)
:lol: :lol: :lol:

A better question is: Have you tried to include it in your code :?:

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 9:11 pm 
Offline
User
User
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 70
resolved by the french team :
https://www.purebasic.fr/french/viewtopic.php?f=1&t=17784

:twisted: :P 8)

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.70LTS - 32 bits


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Thu Aug 15, 2019 10:36 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 216
Location: Germany
Speechless. :shock:


Top
 Profile  
Reply with quote  
 Post subject: Re: Open an exe (compiled .pb) with the right path ...
PostPosted: Fri Aug 16, 2019 7:33 am 
Offline
User
User
User avatar

Joined: Tue Jan 04, 2011 6:21 pm
Posts: 70
Derren wrote:
Speechless. :shock:

Excuse me, but I think you gave me the answer. It's my fault if I did not know how to use it ... :oops: :oops: :oops:

_________________
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 5.70LTS - 32 bits


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye