Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » acces help chm files (windows)
acces help chm files (windows) [message #55050] Wed, 07 October 2020 13:24 Go to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
how do you access to an application made in u ++ help chm files and their topics.
Is there a component / class?
Re: acces help chm files (windows) [message #55071 is a reply to message #55050] Thu, 08 October 2020 14:47 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
how do I use the AProcess (or LocalProcess) class?
could you put an example? (I didn't really find in the examples how to use it to load the process or the documentation I don't know about)

(I tried to use the routine:

#include <cstdlib>
...
system("C:\\Windows\\System32\\notepad.exe");

but it opens the dos prompt and this is not recommended/or viable)

Re: acces help chm files (windows) [message #55079 is a reply to message #55071] Fri, 09 October 2020 08:23 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3372
Registered: August 2008
Senior Veteran
Dear BetoValle

If you want to open a GUI application like notepad, you do not need to use LocalProcess.

If you want to open a file named "C:\MyFolder\Myfile.txt", just call:
LaunchWebBrowser("C:\\MyFolder\\Myfile.txt")
The software assigned to that file extension will open your file.


Best regards
IƱaki
Re: acces help chm files (windows) [message #55082 is a reply to message #55079] Fri, 09 October 2020 14:51 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,

there are 2 situations that involve parameters:

1- a chm file with the topic

2-how i execute jar file?

I tested it directly but it doesn't work LaunchWebBrowser. Is there any way?

C:\\Program Files\\Java\\jre1.8.0_261\\bin\\java.exe
-jar
C:\\Program Files\\spath\\file.jar
Re: acces help chm files (windows) [message #55083 is a reply to message #55082] Fri, 09 October 2020 16:10 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
See, here is just an idea to include a launchwebbrowser extension in ui sources. I tested it for jar files and it worked now and it's up to you experts to better evaluate this issue.

1) App.cpp line
void LaunchMy(const String& url, const String& p, const String& d)
{
WString wurl = ToSystemCharsetW(url);
WString wp = ToSystemCharsetW(p);
WString wd = ToSystemCharsetW(d); // file.jar directory <---
if ((int64)(ShellExecuteW(NULL, L"open", wurl, wp, wd, SW_HIDE)) <= 32) {
int l = sizeof(wchar) * wurl.GetLength() + 1;
char *curl = (char *)malloc(l);
memcpy(curl, wurl, l);
StartAuxThread(sShellExecuteOpen, curl);
}
}

2) App.h / line 87
void LaunchMy(const String& url, const String& p, const String& d);

3) this work!

LaunchMy("C:\\Program Files\\Java\\jre1.8.0_261\\bin\\java.exe",
"-jar file.jar",
"C:\\Program Files\\pathA\\pathB");
Re: acces help chm files (windows) [message #55084 is a reply to message #55083] Fri, 09 October 2020 17:11 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
ok, now i also solved the help chm load:

I changed the function to

void LaunchMy(const String& url, const String& p, const String& d, int howshow)
{
WString wurl = ToSystemCharsetW(url);
WString wp = ToSystemCharsetW(p);
WString wd = ToSystemCharsetW(d);
if ((int64)(ShellExecuteW(NULL, L"open", wurl, wp, wd, howshow)) <= 32) {
int l = sizeof(wchar) * wurl.GetLength() + 1;
char *curl = (char *)malloc(l);
memcpy(curl, wurl, l);
StartAuxThread(sShellExecuteOpen, curl);
}
} //howshow: SW_HIDE (0) SW_SHOW (5) SW_SHOWDEFAULT (10)

to work:

LaunchMy("hh.EXE",
"ms-its:FinestFI.chm::/IDH_Topic20.htm",
//or "mk:@MSITStore:file.chm::/IDH_Topic20.htm"
"path of file.chm ie C:\\abc\\def\\ghi",SW_SHOW);

if you want you can close this topic. Thankful.



Re: acces help chm files (windows) [message #55085 is a reply to message #55084] Fri, 09 October 2020 17:15 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
correction in the last example: FinestFI.chm = file.chm
Re: acces help chm files (windows) [message #55092 is a reply to message #55085] Sat, 10 October 2020 12:20 Go to previous message
omari is currently offline  omari
Messages: 266
Registered: March 2010
Experienced Member
Hi,
try this :

Upp::Sys("C:/path_to_hh/hh.EXE  ...");


look at Sys() code source for others overloads, and for how to use LocalProcess.


regards
omari.

[Updated on: Sat, 10 October 2020 12:30]

Report message to a moderator

Previous Topic: Create exe from Windows to Linux
Next Topic: operation involving "\\" x "\" characters in directories and files
Goto Forum:
  


Current Time: Sun Jun 16 21:35:57 CEST 2024

Total time taken to generate the page: 0.01247 seconds