How to change file icon in Turbo C++ and cc3270.dll - windows

I started to use Borland's Turbo C++ a few days ago. I actually have two questions.
1.: How can i change the file icon?? If i create a program (Console Application), it will always have this blue icon (buildings or something like that on it), and i can't find it anywhere, how to change it to the default "none" icon (which like in Dev-C++ is the default).
2.: If i create a console application, and i want to run on my virtual pc, then it says that the CC3270.DLL is missing. If i copy it to c:\windows\system32\ then it will working perfectly. But i want to avoid this way. So is it possible, to change a setting or something like that, that my application won't need this file? It's disturbing beacuse, if i want to use my program on a computer which hasn't this dll, than i have to copy it there, on every machine.
Thanks in advance!
kampi

1.you can see these links
How do I change the program icon for a console application?
How to Create a Custom Program Icon for a Console Mode Application
2.If you build using the dynamic Run-Time Library, you will also have to distribute one or more of the Run-Time Library DLLs CC3270.DLL or CC3270MT.DLL and the memory manager DLL.
you must uncheck the option "build with runtime packages" located in the project options.
Bye.

Related

How can I open a Microsoft Access Database file with an .exe?

I have been working on creating a pretty advanced GUI enabled database in Microsoft Access and am now in the implementation phase of my project.
My dream is to make an .exe file that will point to the actual .accdb database file (which will be hidden) as I cannot change the icon of the .accdb but will be able to modify the .exe's icon thus giving my implementation a more professional feel.
I'd prefer not to just create a shortcut to the .accdb and change that icon.
Through some quick digging, my plan was to create a .bat file that opens the .accdb and then use some online ".bat to .exe" converter to then add an icon to the .exe.
I can't figure out how to create a .bat file that opens my .accdb. I've tried a variety of different things like:
start "" C:\Program Files (x86)\CompassTrack "Science Department.accdb"
and other things that dont work.
It occurred to me that a .bat to .exe approach may not be the best way to do this. I don't particularily like the brief command prompt window appearance and would be open to any suggestions as to how to get a nice looking .exe file to open my .accdb.
If the best way really is a .bat file, I'd appreciate some help with the .bat file. The path to the file is C:\Program Files (x86)\CompassTrack\Science Department.accdb but for some reason every time, command prompt would return "Cannot find C:\Program "
Thanks in advance!
to change icon of an exe file using batch, look here
and to start your file use:
cd "C:\Program Files (x86)\CompassTrack"
start "" "Science Departement.accdb"
I believe you can just change the icon of your Access database. Go to Current Database (in recent versions under Office Button > Access Options) and the option is in there.
Here's a really simple C# program that you can compile into an exe very easily to if you have .NET 3.5 installed. it uses a utility called the command line compiler. You'll have to change the file path obviously.
using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
public class App
{
public static void Main(string[] args)
{
Process myProcess = new Process();
myProcess.StartInfo.FileName = #"c:/your_file_path_goes_here/YourDB.accdb";
myProcess.Start();
}
}
You'll write the above to a text file with the extension .cs. Then create a batch file (a text file with the extension .bat) with this code.
#echo OFF
echo Compiling A File . . .
C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe /win32icon:_.ico /target:winexe /recurse:*.cs
echo.
#pause
Put these in the same dir as whatever icon you want to use, but make sure the icon is an iso file named _, as seen in the batch program. When you run the bat file, it will create the exe with the icon of your choice and it will simply launch the access database.
The feature and ability is part of the Access development system. Attempting to modify some .exe file etc. will not work.
I do suggest that you set the icon under file->options current database. It not clear why this is not working (perhaps start a new question to resolve that issue).
Keep in mind that if you deploy or change the resulting location, then you have to change the above “options” setting (manually, or by code – this much explain why your icon is not displaying – the path name cannot be relative – must be absolute.
ALSO select the box that says to use the icon for all forms and reports (this will give your application a MUCH more polished look. Since the .exe that actually runs your file is msacces.exe, then you can’t really change the application icon any other way. You see icons for the application AND ALSO forms like this "when" you set the application icon as per above:
So you WILL want to set the application icon. You then create a shortcut on your desktop. And again set the icon for that windows shortcut (it will nicely show up in the task bar with that icon).
The actual shortcut will look much like this:
"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE"
"c:\RidesDev\SkiRides\ RidesXP.accde" /runtime
The above shortcut will be on a single line (space between the two lines). The above is for Access 2010, so for 2013, then the folder is office15, and for 2016, it is office16 in above.
Also NOTE very important is the /runtime. This will ensure that the access icon NEVER shows during start-up.
Also, during start-up you will often see the MS Access splash logo during start-up. E.g. this:
You can replace this splash screen by placing a .bmp (picture) file in the SAME folder as the accDE with the same name.
So in above, if I place a RidesXMP.bmp picture file, then during start-up in place of the access splash screen, you see this:
Since you likely want the forms + reports icon to be custom, then the above makes the most sense. Your approach would ONLY give you a desktop icon, not one for the task bar, forms etc.
The above will result in hiding the access splash logo during start-up, and also apply an icon to all forms etc. I don’t suggest some approach that attempts to modify some .exe or some such – that’s likely to cause issues on customers computers. And using some .exe will not give you the icon for forms and repots.

Configure launch command in Code::Blocks

I recently discovered Emscripten, and after downloading it, I decided to see if I could get it to work with Code::Blocks, so that I could easily test my applications to see how they performed when running as JavaScript.
I created a new compiler configuration, and set up all of the toolchain executables, except for the resource compiler (which doesn't seem to give me any problems), and the debugger. I wasn't really sure what to put in the debugger, because I remembered the debugger field as being a text-box. But when I looked, all that was there was a drop-down menu.
I managed to find a "Debugger" menu in the "Settings" menu, and when I opened it, there was a button called "Create config".
I created a new configuration, and pointed the executable path to "node.exe" (which runs .js files). I then went back to the compiler settings, and chose my new debugger in the drop-down.
I then tried to build and run a simple hello world application. But once it finished building, it gave me the message Execution of '[my file] ' in '[my project folder] 'failed. The actual build seemed to be successful, so I decided to manually run node.exe from the command line to see if I had configured the debugger incorrectly. And as I expected, it ran successfully.
While I was glad that I had successfully configured the compiler, I still was confused as to why the app didn't want to run. I also set Emscripten to create HTML files instead, to see if Code::Blocks would somehow recognize the appropriate program, and open it in the web browser instead. Of course that didn't work either.
What I am trying to figure out, is how I configure Code::Blocks' run command. Perhaps the debugger isn't even the right place to be looking. But I really need someone to help me figure out how I can configure this in Code::Blocks, as this is currently the only thing that is really giving me any trouble.
Thanks.
Possible but less ideal solution:
After some time, I was able to come up with a solution. However, I am sure that there are better alternatives.
To use this method:
Create a new build target called RunScript.
Set the compiler to No Compiler.
In the project properties, set the type to Console application.
Uncheck Auto-generate filename extension, and set the output filename to RunButton.bat.
Create a new file called RunButton.bat (or whatever you entered as the output filename).
Whatever you put in RunButton.bat will now be executed when you click the run button.
I also created a new virtual target that contained my RunScript target, and my main target, so that I don't have to switch targets whenever I want to test my application.
Problems with this method:
While this method does work, it is not ideal, as it requires you to have two extra targets (including the virtual target that I made for convenience). I would rather be able to just have everything contained in one target.
Slightly better solution:
A new solution that I decided to use, is to simply use the configure tools menu to create a tool that points to a batch file that runs my compiled programs.
To use this method:
Go to Tools>Configure Tools...>Add.
Fill in the name, and point the executable to the script that you want to run when this tool is used.
Fill in any needed parameters. You can use the built in ${TARGET_OUTPUT_FILE} macro to pass your output application as a parameter.
You can now use your tool by going to Tools>{My tool}, but you can set a hotkey by going to Settings>Editor...>Keyboard shortcuts.
Click the plus button by Tools, and click on your tool to set a shortcut for you tool.
Problems with this method:
While this method does eliminate the extra build targets, it doesn't let you run your script or run non-executable files by clicking the run button; which was the original intent. On top of this, you have to create a new tool anytime you want to add a new script.
I am hoping that someone else will be able to show me a better way of doing this, but for now this will work.
Might be a little late, but I was able to get the codeblocks run button to run any command by using a few post-build steps. The reason I need this is because my laptop has nvidia "optimus" and in order for my output program to see the discreet graphics card, I have to run it with the optirun prefix. So I added the following to the post-build steps in build options:
mv $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE)_bin
echo #!/bin/sh > $(TARGET_OUTPUT_FILE)
echo optirun $(TARGET_OUTPUT_FILE)_bin >> $(TARGET_OUTPUT_FILE)
chmod +x $(TARGET_OUTPUT_FILE)
It basically renames the output binary and creates a script replacing the original output binary name. When pressing the run button, the script is executed instead of the output.
On windows, you might have an issue running an exe extensioned file as a batch script so what if you generate the output file with a bat extension like in your first method, but with compilation and then rename it to exe in the post-build like this:
move $(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).bat $(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).exe
echo [WHATEVER YOU NEED TO RUN] > $(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).bat

Arbitrary .cmd script as screensaver in Windows 7 / XP

I have a fullscreen OpenGL application, written in Scala. It is supposed to being launched as .cmd file that sets up classpath (some .class files, some of them are third-party libraries and optionally in .jars) and runs JVM with the right parameters. I'm wondering, is there an easy way to use this .cmd file as Windows screensaver? (without usual screensaver preview and settings dialog, they are not needed there) I guess I need to register the application somewhere? Is there any restriction on what file type it must be?
You can install a screensaver by doing as #Kevin suggested and right click the file and install (provided that this is a .scr file). Or you can copy the file straight to C:\Windows or sometimes C:\Windows\system32.
However, unless the file is a valid screensaver then it won't show up in the list of screensavers when you choose which one you want, so I think you are out of luck.
Unless you created your own screensaver, and then you might be able to launch the file from one of the events it has.

Do an Event when the application is opened by a custom file? On C# .NET

The thing is, I created a file with custom information and a unique extension, let's say (.qwas). If I modified the Registry in HKEY_CLASSES_ROOT I can change its icon and choose which program will open it. What I want to do, is that when I double click it, it opens my .NET app and in the app have an event like FileOpenApp. So I can extract information from the file and do custom methods.
The kind of behavior I want to make is similar to the project files of an aplication, like the .fla of flash.
I don't know how to start with this idea, I hope anyone knows even the name of this type of procedure.
Thanks
Can't you pass the name of the file as an argument to your .Net App. Something like
[HKEY_CLASSES_ROOT\Applications[name of APP]\shell\open\command]
#="\"[path to app]\" \"%1\" %*"

Change the taskbar settings programmatically?

I want to change the settings of my taskbar with a small batch file or java programm or whatever.
So I want to know, if there is a registry key containg this information.
Does anybody knows, where Windows sets taskbar settings?
Edit: No, I don't want to annoy the users with changing taskbar settings on every boot.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
and 64 bit eqivalent?
TaskBarCmd seems to do the job. It includes C++ source code. It uses the IBandSite COM Interface. Haven't tried the source, but the compiled version seems to work.

Resources