Click here to Skip to main content
15,916,945 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get the path of Acrobat Reader Exe by C++ Pin
Naveen17-Sep-09 0:37
Naveen17-Sep-09 0:37 
AnswerRe: How to get the path of Acrobat Reader Exe by C++ Pin
David Crow17-Sep-09 2:15
David Crow17-Sep-09 2:15 
QuestionHow to widen the drop down portion of combo box. Pin
Alex@9C16-Sep-09 23:15
Alex@9C16-Sep-09 23:15 
AnswerRe: How to widen the drop down portion of combo box. Pin
«_Superman_»16-Sep-09 23:33
professional«_Superman_»16-Sep-09 23:33 
GeneralRe: How to widen the drop down portion of combo box. Pin
Naveen17-Sep-09 0:24
Naveen17-Sep-09 0:24 
GeneralRe: How to widen the drop down portion of combo box. Pin
«_Superman_»17-Sep-09 0:25
professional«_Superman_»17-Sep-09 0:25 
GeneralRe: How to widen the drop down portion of combo box. Pin
Alex@9C17-Sep-09 1:04
Alex@9C17-Sep-09 1:04 
QuestionStopping windows shutdown in C++./MFC? Pin
Kushagra Tiwari16-Sep-09 22:50
Kushagra Tiwari16-Sep-09 22:50 
AnswerRe: Stopping windows shutdown in C++./MFC? Pin
«_Superman_»16-Sep-09 23:06
professional«_Superman_»16-Sep-09 23:06 
GeneralOT Pin
CPallini16-Sep-09 23:35
mveCPallini16-Sep-09 23:35 
GeneralRe: OT Pin
«_Superman_»16-Sep-09 23:37
professional«_Superman_»16-Sep-09 23:37 
GeneralRe: OT Pin
ThatsAlok16-Sep-09 23:48
ThatsAlok16-Sep-09 23:48 
AnswerRe: Stopping windows shutdown in C++./MFC? Pin
Randor 17-Sep-09 0:27
professional Randor 17-Sep-09 0:27 
GeneralRe: Stopping windows shutdown in C++./MFC? Pin
Kushagra Tiwari17-Sep-09 0:43
Kushagra Tiwari17-Sep-09 0:43 
GeneralRe: Stopping windows shutdown in C++./MFC? Pin
David Crow17-Sep-09 2:18
David Crow17-Sep-09 2:18 
GeneralRe: Stopping windows shutdown in C++./MFC? Pin
Kushagra Tiwari17-Sep-09 3:18
Kushagra Tiwari17-Sep-09 3:18 
GeneralRe: Stopping windows shutdown in C++./MFC? Pin
David Crow17-Sep-09 3:27
David Crow17-Sep-09 3:27 
QuestionRe: Stopping windows shutdown in C++./MFC? Pin
Kushagra Tiwari17-Sep-09 20:24
Kushagra Tiwari17-Sep-09 20:24 
QuestionRe: Stopping windows shutdown in C++./MFC? Pin
David Crow18-Sep-09 4:18
David Crow18-Sep-09 4:18 
QuestionHow to load PDF file on any button click in VC++? Pin
deadlyabbas16-Sep-09 22:32
deadlyabbas16-Sep-09 22:32 
AnswerRe: How to load PDF file on any button click in VC++? Pin
Nuri Ismail16-Sep-09 22:46
Nuri Ismail16-Sep-09 22:46 
GeneralRe: How to load PDF file on any button click in VC++? Pin
deadlyabbas16-Sep-09 23:12
deadlyabbas16-Sep-09 23:12 
GeneralRe: How to load PDF file on any button click in VC++? Pin
Nuri Ismail17-Sep-09 0:50
Nuri Ismail17-Sep-09 0:50 
AnswerRe: How to load PDF file on any button click in VC++? Pin
CPallini16-Sep-09 22:51
mveCPallini16-Sep-09 22:51 
GeneralRe: How to load PDF file on any button click in VC++? Pin
deadlyabbas16-Sep-09 23:36
deadlyabbas16-Sep-09 23:36 
Thanks Once again.
Actually I want to get the registry path where the .exe of Acrobat reader is.
So that I can pass the command line arguments to it ...........
Because to open a PDF with sppecific book mark I need the exe path and by command line argument I will pass the page number to it.
Like wise we do in Delphi

HelpFilePath : String;
DoesFileexists : Boolean;
CommandLine : String;
ExePath : String;
IsAcroExeLocated : Integer;
ButtonSelected : Boolean;
AcroVersion : String;
//Extracting Acrobat executable file path from Registry
// replace the double quotes and %1 from the string
ExePath := AnsiReplaceStr(GetRegistryValue('\AcroExch.Document\Shell\Open\Command'),'"','');
ExePath := AnsiReplaceStr(ExePath,'%1','');
// creating the help file path from WaterNET.exe path and file name
helpfilepath := extractfilepath(application.exename) + 'help\WaterNET_user_manual.pdf';
DoesFileexists := False;
DoesFileexists := Fileexists(ExePath);

if DoesFileexists then
begin
{ Display Alert message that Adobe Reader 5.0 Required }
//GetVersion finds the version information using the file properties

AcroVersion := GetVersion(ExePath);
if StrToIntDef(AcroVersion,0) < 6 then
begin
MessageBox(Application.Handle,
pchar(#13 + 'Adobe Acrobat PDF Reader version6.0 (or newer) is required.'),
pchar('Adobe Reader Version'),
mb_OK + mb_ICONWARNING + MB_APPLMODAL);
exit;

end; //if StrToIntDef(AcroVersion,0)

// Checking that specified file is existing
if Not FileExists(HelpFilePath) then
begin
MessageDlg(MSG_HELP_FILE_NOT_EXIST, mtWarning, [mbOK], 0);
Exit;

end;

// set command line parameters based from where the help file is opened
case BookmarkConstant of

WNET_HELP_USER_MANNUAL :
// when user clicks on help->user mannual
begin
// '/s' used for silently opening the acrobat reader instead of the splash screen
CommandLine := ('/s /n /A page=1 "'+ helpfilepath +'"');

end;

help_WaterNET :
// when user clicks help-> WaterNET Help or press F1
begin
// '/n' used for openning the file in same opened acrobat reader
CommandLine := ('/s /n /A zoom="100"&page=1&pagemode=bookmarks "'+ helpfilepath +'"');

end;
else
// when user click help button on a dialog
begin
// using '/A' all the parameters consider as a string
CommandLine := ('/s /n /A page='+ inttostr(BookmarkConstant) + '&View=FitBV "'+ helpfilepath +'"');

end;

end;

IsAcroExeLocated := 0;
//executing the Acrobat.exe with command line parameters

IsAcroExeLocated := ShellExecute(0, {Forms handle}
'open', {Operation}
PAnsiChar(ExePath), {EXE name with path}
PAnsiChar(CommandLine), {Commandline parameters}
nil, {Working directory}
SW_SHOWMAXIMIZED); {show
state}


end;

// checking if Acrobat reader is not available then go for download the Acrobat
if not (DoesFileexists) or (IsAcroExeLocated < 32) then
begin
buttonSelected := MessageBox(Application.Handle,
pchar(#13 + 'No Adobe Acrobat PDF Reader found. Press OK to download Adobe Acrobat Reader or press Cancel to abort.'),
pchar('Adobe Reader Required'),
mb_OKCANCEL + mb_ICONWARNING + MB_APPLMODAL) = IDOK;

// checking if OK button is pressed then open the link for download the Acrobat
if buttonSelected then
begin
ShellExecute(0, {Forms handle}
'open', {Operation}
PAnsiChar('http://get.adobe.com/reader/'), {EXE path}
nil, {Commandline parameters}
nil, {Working directory}
SW_SHOWMAXIMIZED); {show state}
end;

end;


But I want to do all in VC++

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.