Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 7, 2021 5:34:12 GMT -5
Hi
I had to quickly connect existing helpfiles to the programs I had converted from a previous Basic to LB. The previous Basic had ample "hooks" for help support both for a complete helpfile as well as context-sensitive help.
Other than perhaps using an API, I could not find anything in LB4 to allow me to do the same. Since I had to quickly provide a connection to a help facility, I used the following "not too elegant" but working solution using the RUN command.
The idea works for a complete helpfile but not for a "context sensitive" approach.
Almost all latest versions of Windows have a "built-in" viewer for .chm files - hh.exe so, assuming that you have your help in .chm format, you can issue the following command whenever you need to display the helpfile.
run "hh.exe "+DefaultDir$+"\helpfiles\QPMain.chm"
This opens the helpfile which then stays open irrespective of what you do thereafter. Use a switch system of sorts to prevent the helpfile from being opened more than once.
Once opened, the helpfile stays displayed so to close it at any point, issue the following command (provided it is still open).
run "taskkill /IM hh.exe /F", hide
Not elegant, but it works!!
Thanks to xxgeek for the "kill" suggestion.
Regards
|
|
|
Post by xxgeek on Nov 7, 2021 13:46:02 GMT -5
Dennis, if you look into the command line options for tasklist you will see options to list the non-responding apps, then you can tell taskkill to kill the non responders "only" with one line similar to your above code. Good homework project for you, cause I need that code for a project I'm working on, and have enough to do lol Have fun, post it when you have it working jk around, but it might be another option for you. Keep in mind too, that you can use Liberty to run all the Windows built in exe's with (if supported from cmd to xcopy etc) command line options in about the same way. Just look up the command line options and RUN them using Liberty code.
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 7, 2021 16:57:50 GMT -5
Hi Thanks. I will experiment further but I am also under some pressure to produce product for the market so little time to play at the moment.... I make a lot of use of the RUN command to fire up Windows functions but I had never used the "tasklist" and "taskkill" commands before Incidently, the "old".bat function also still exists.... I create a .bat file inside LB and then RUN it. You just need to be careful as LB sometimes executes faster than Windows can execute the .bat or some of the Windows commands. Regards Dennis
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 7, 2021 17:07:02 GMT -5
Hi xxgeek
Further to my post above, refer to my post of 5t September under the thread "Any experience using copy protection software"
Regards Dennis
|
|
|
Post by xxgeek on Nov 8, 2021 18:26:05 GMT -5
Hi xxgeek Further to my post above, refer to my post of 5t September under the thread "Any experience using copy protection software" Regards Dennis I did read that thread a while ago, but I'm no expert on copy protection. I do know there is a cipher command in c:\Windows\system32 dir that "may" help you. It will encrypt a file, and can be done from command line. cipher /e file.ext and cipher /u file.ext to unencrypt Also, you can add a few lines at the beginning of your app Prompt ing for a password, and if it is given incorrect the app won't start. Other than that, I'd have to read another book to help you. Maybe someday Kinda busy for a while on a project.
|
|
Dennis
Full Member
Old but still active
Posts: 147
|
Post by Dennis on Nov 9, 2021 0:36:55 GMT -5
Thanks!! I will definitely explore it... I have to copyprotect a converted commercial app. It was previously protected using a DLL available for the BASIC I originally used.
|
|