Author Topic: Explore current path  (Read 3714 times)

jcfuller

  • Member
  • **
  • Posts: 172
Explore current path
« on: February 21, 2015, 09:14:36 PM »
I am curious how RadAsm3 performs the Explore Current path feature.
I have perused the source but I can not find where it takes place.

The reason I ask: Other editors that have this feature (many don't) appear to just do a ShellExecute using "explore". This creates a new window every time even though one may already exist for that path, where RadAsm3 will activate a current window if it exists.

I am language agnostic on this as I'd like to implement it in a number of different languages.

James

ragdog

  • Member
  • ****
  • Posts: 578
Re: Explore current path
« Reply #1 on: February 21, 2015, 09:19:25 PM »
Hi

You try to add a function to explore the current Project path?

Radasm has this function

Go to project explorer,click on File tab , Right click on the path

Code: [Select]
.elseif eax==IDCM_FILE_EXPLORE
invoke SendMessage,ha.hFileBrowser,FBM_GETSELECTED,0,addr buffer
invoke GetFileAttributes,addr buffer
.if eax!=INVALID_HANDLE_VALUE
test eax,FILE_ATTRIBUTE_DIRECTORY
.if ZERO?
invoke strlen,addr buffer
.while buffer[eax]!='\' && eax
dec eax
.endw
mov buffer[eax],0
.endif
invoke ShellExecute,hWin,addr szIniOpen,addr buffer,0,0,SW_SHOWDEFAULT
.endif

jcfuller

  • Member
  • **
  • Posts: 172
Re: Explore current path
« Reply #2 on: February 21, 2015, 09:49:46 PM »
I don't think that's  it.

Menu -> Tools -> Explore Current path.

If you open Menu -> Option -> Tools  the Explore Current Path item is blank??

James

ragdog

  • Member
  • ****
  • Posts: 578
Re: Explore current path
« Reply #3 on: February 21, 2015, 11:07:52 PM »
It open the current project folder also

what you mean Menu -> Tools -> Explore Current path. is here

Code: [Select]
.elseif eax>=IDM_TOOLS_START && eax<IDM_TOOLS_START+20
;Help
mov edx,eax
sub edx,IDM_TOOLS_START
invoke BinToDec,edx,addr buffer
invoke GetPrivateProfileString,addr szIniTool,addr buffer,addr szNULL,addr tmpbuff,sizeof tmpbuff,addr da.szAssemblerIni
.if eax
invoke GetItemStr,addr tmpbuff,addr szNULL,addr buffer,sizeof buffer
invoke FixPath,addr tmpbuff,addr da.szAppPath,addr szDollarA
invoke ParseCmnd,addr tmpbuff,addr buffer,addr buffer1
invoke ShellExecute,hWin,NULL,addr buffer,addr buffer1,NULL,SW_SHOWNORMAL;SW_SHOWDEFAULT
.endi

But try you add a function to add a button or what ever get the project path
can you code it

1.get the project path  for an addin use this struct ( ADDINDATA .szProjectPath) for directly code in radasm (da.szProjectPath)
2. ShellExecute it

jcfuller

  • Member
  • **
  • Posts: 172
Re: Explore current path
« Reply #4 on: February 22, 2015, 04:01:17 AM »
Never mind .
You are either bustin my chops or don't have a clue either :)

James

ragdog

  • Member
  • ****
  • Posts: 578
Re: Explore current path
« Reply #5 on: February 22, 2015, 05:55:49 AM »
Why?

Your search in Radasm source the part for Menu -> Tools -> Explore Current path?

and this is this part ,but search self

good luck  make what do you want, or make nothing lol:

jcfuller

  • Member
  • **
  • Posts: 172
Re: Explore current path
« Reply #6 on: February 22, 2015, 07:09:11 AM »
Well ok I take your word for it.
Thanks for the info anyway. I may give it a closer look but my old brain gets slower every day   :(

I think I have found another way to do it.

James
 

jcfuller

  • Member
  • **
  • Posts: 172
Re: Explore current path
« Reply #7 on: February 24, 2015, 10:17:50 PM »
ragdog,
Thank you for your correct information.
I apologize for my shortsightedness.

The secret it seems is to pass empty strings to ShellExecute for both the lpOperation and the lpFile.
You will then get an explorer window of the current directory. If there is one already, it will pop up;
If not a new one is created.
I searched and searched but never found this info anywhere or if I did it just went over my head??

Thanks again,
James

ragdog

  • Member
  • ****
  • Posts: 578
Re: Explore current path
« Reply #8 on: February 24, 2015, 10:47:02 PM »

Quote
Thank you for your correct information.
I apologize for my shortsightedness.

No problem but Please do not these statements next time
Ok i have forgot it  :biggrin:

Quote
Never mind .
You are either bustin my chops or don't have a clue either :)