Re: FindExecutable on Windows CE

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I'm simply saying that it's not a perfect way. Acrobat would probably
associate with PDF, but another program could easily replace that and a hard
reset would likely remove it entirely (unless Acrobat was in ROM). You
simply need to be aware that your ability to tell whether Acrobat is
installed is imperfect (unless Acrobat creates registry keys unique to
itself elsewhere).

Paul T.

<ajay.sonawane@xxxxxxxxx> wrote in message
news:1154323309.354783.147000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

So you meant to say that it will work great, but this is not the right
way to find whether acrobat is installed or not. So let me know what is
the best way to do so ,

Thanks !

-AJay

Paul G. Tobey [eMVP] wrote:
That's likely to work in most cases, but it certainly does *not* prove
that
a particular application is installed, just that something is associated
with .PDF files. If that's enough for you, go for it.

I'm not going to proof your code. If it works, great. If not, tell us
what
goes wrong.

Paul T.

<ajay.sonawane@xxxxxxxxx> wrote in message
news:1154000548.777634.59390@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here is my code , let me know your suggestions.

BOOL IsAcrobatInstalled()
{
// Open HKLM\.pdf
HKEY hKeyPdfFile;
if ( ERROR_SUCCESS !=
RegOpenKeyEx(HKEY_CLASSES_ROOT,PDFFILE_KEY,0,0,&hKeyPdfFile))
{
fwprintf(stderr,_T("\nError in opeing key:%S"),PDFFILE_KEY);
return FALSE;
}

// Get value of default ( i.e. pdffile)
DWORD dwLength = 1024;
DWORD dwType;
TCHAR szPdfFileKeyData[1024]={'\0'};
if(ERROR_SUCCESS !=
RegQueryValueEx(hKeyPdfFile,NULL,NULL,&dwType,(LPBYTE)szPdfFileKeyData,&dwLength))
{
fwprintf(stderr,_T("\nError in RegQueryValueEx :%S"),PDFFILE_KEY);
return FALSE;
}

// form key ( HKLM\pdffile\shell\open\command )
TCHAR szKey [1024] = {'\0'};
_tcscpy(szKey,szPdfFileKeyData);
_tcscat(szKey,PDFREADER_KEY);


dwLength = 1024;
dwType = 0;

HKEY hKeyPdfReader;

// Open key HKLM\pdffile\shell\open\command
if ( ERROR_SUCCESS !=
RegOpenKeyEx(HKEY_CLASSES_ROOT,szKey,0,0,&hKeyPdfReader))
{
fwprintf(stderr,_T("\nError in RegQueryValueEx :%S"),szKey);
return FALSE;
}

TCHAR szLauncher[1024]={'\0'};

// Get value of default ( It should be exe name of application that is
associated with .pdf file)
if(ERROR_SUCCESS !=
RegQueryValueEx(hKeyPdfReader,NULL,NULL,&dwType,(LPBYTE)szLauncher,&dwLength))
{
fwprintf(stderr,_T("\nError in RegQueryValueEx :%S"),szKey);
return FALSE;
}

fwprintf(stderr,_T("\nLauncher:%S"),szLauncher);

if(_tcslen(szLauncher) == 0)
return FALSE;

return TRUE;
}




ajay.sonawane@xxxxxxxxx wrote:
Paul G. Tobey [eMVP] wrote:
OK. Well, since I just wanted to see if *something* was associated
with
*.pdf, I'd just go looking for the entry in the registry associating
*.pdf
with something. That's going to be at:

[HKEY_CLASSES_ROOT\.pdf]
@="<something>"
[HKEY_CLASSES_ROOT\<something>\Shell\Open\Command]
@="\"<launchpath>" %1"

So, you could go looking for <launchpath> or just verify that some
association with .pdf is there. Note that <launchpath> needent be
there.
The EXE itself might just be listed and the path might be assumed to
contain
it. As I said, I'd just check for the association and not look for
the
path
itself.

Paul T.

<ajay.sonawane@xxxxxxxxx> wrote in message
news:1153912315.518699.258830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Paul G. Tobey [eMVP] wrote:
You want to decide what application is associated with a given
file
type?
I
suppose that you could parse the registry keys yourself to see
what's
associated, if anything. Why are you doing this? If it's just
to
decide
what program to run, just call ShellExecuteEx() to launch the
document
and
the system will choose the right application.

Paul T.

<ajay.sonawane@xxxxxxxxx> wrote in message
news:1153815846.937176.169970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello all,
I want to find executable of any type of file. On windows , we
do
the
same thing using FindExecutabel function, How can I do it on
Windows CE
? It seems that FindExecutable is not supported on Windows CE.
Thanks.

-AJay



I need the full path of the application that is associated with
the
file.
I will try to explain what I want to achieve, I need to check
whether
acrobat reader or pdfviewer is installed on the Windows CE device.
One
way to do this is create one temporary pdf file and find the
executable
associated with it ( using FindExecutable or . I am following the
same
approach.
Registry gives me the exe name ( pdfviewer.exe %1) and not the
full
path, Can you shed some more light on this ?


OK, So I need to check only association with .pdf file, If there is a
key .pdf under HKCR, it means acrobat or pdfviewer is installed there,
No need to go to find launchpad or no need to check value of
association. Correct me if I am wrong.




.



Relevant Pages

  • Configuring IE to Use Adobe Reader 6.0 or Acrobat as Helper Applica
    ... To configure Adobe Reader 6.0.1 Open Reader, ... UNCHECK the box for "DISPLAY PDF IN BROWSER". ... >IE to use the Acrobat product as a helper applications. ... >Downloading a PDF File to Your Hard Disk ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Configuring IE to Use Adobe Reader 6.0 or Acrobat as Helper Applica
    ... To configure Adobe Reader 6.0.1 Open Reader, ... UNCHECK the box for "DISPLAY PDF IN BROWSER". ... >IE to use the Acrobat product as a helper applications. ... >Downloading a PDF File to Your Hard Disk ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: WAY OT: How to make PDF files open faster?
    ... Your options also depend on whether you have access to full-version 'Acrobat' (or comparable PDF authoring software), specialized image viewers, and batch PDF-to-TIFF conversion utilities. ... However, as a generalization, a dedicated image browser like 'ACDSee' or 'Irfanview' will load a raster image faster than any PDF reader will load a PDF page containing the same raster image. ... Full-version 'Acrobat' has the ability to extract raster data directly from a PDF file, and to rasterize other data in the PDF file which is not already a raster image. ...
    (misc.transport.road)
  • Re: Just use acrobat, not Windows Journal Viewer for PDF files
    ... I double click a PDF file, or click on a web page PDF link and the Adobe ... Acrobat reader splash screen flashes onto the screen, ... > original link opens. ...
    (microsoft.public.windowsxp.basics)
  • Re: PsionFlexi PDFs
    ... >> Paul here from psionflexi.co.uk ... > may not display properly in your version of Acrobat". ... > pretty unlikely that a basic words and pictures PDF is going to need ... > Aidan Karley, ...
    (comp.sys.psion.misc)