Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Windows - Command Line w/ files


  • Please log in to reply
4 replies to this topic

#1 zyrolasting

zyrolasting

  • Members
  • 45 posts
  • OFFLINE
  •  
  • Local time:12:59 PM

Posted 15 January 2009 - 07:58 PM

I'm writing a c++ class to associate a file extension with an external icon. The c++ part is irrelevant, really.
My question is that I'm seeing some command line strings in the registry, the most familiar being "NOTEPAD.EXE %1"

What is the %1, exactly? Are parameters like that unique to each app or are there some that belong to every app?
Before I go associating anything I'd like to know if there are options like that available to me.

BC AdBot (Login to Remove)

 


#2 haun

haun

  • Members
  • 156 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Denver, CO
  • Local time:10:59 AM

Posted 15 January 2009 - 09:03 PM

i believe that it means 'to be opened by' or 'open'
Annnnd you're, asking, me...

#3 Guest_Jay-P VIP_*

Guest_Jay-P VIP_*

  • Guests
  • OFFLINE
  •  

Posted 15 January 2009 - 09:14 PM

%1
is a command line code extension to secure one file as temporary or subject to change.

This is best used with applications when referenced for hidden directories.

#4 Keithuk

Keithuk

  • Members
  • 951 posts
  • OFFLINE
  •  
  • Gender:Male

Posted 16 January 2009 - 09:06 PM

I'm writing a c++ class to associate a file extension with an external icon. The c++ part is irrelevant, really.
My question is that I'm seeing some command line strings in the registry, the most familiar being "NOTEPAD.EXE %1"


Well does C++ use API calls? In VB we can open any file that is registered in Windows e.g txt - NotePad, doc - WinWord, pdf - AcroRd32 etc :thumbsup:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Const SW_SHOW = 5

Private Sub Command1_Click() 'a button

ShellExecute Me.hwnd, "open", "location + filename of what ever you want to open", vbNullString, vbNullString, SW_SHOW

End Sub

Keith

Windows ME (spare computer)
Windows XP 2002 Professional SP3 (desktop computer)
Windows 7 Professional SP1 32bit (laptop computer)

Windows 8 64bit spare drive for laptop computer


#5 Guest_Jay-P VIP_*

Guest_Jay-P VIP_*

  • Guests
  • OFFLINE
  •  

Posted 16 January 2009 - 10:33 PM

BeginUpdateResource()
--Resource calls in Updating, like the one shown, I do know that you can't modify EXE/DLL resources through API Calls.--


Some, and more new Windows API calls expect a the calling application to have an original message queue and a window some place.

Reason for edit: typo

Edited by Jay-P VIP, 16 January 2009 - 10:34 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users