Visual C++ :: Forcing App Icon To Be Always Shown On Tray In Windows 7 / 8
Sep 24, 2012
Where in registry the Explorer stores tray icons visibility settings? (Always show, show only notifications, or always hide.)
I know that Microsoft doesn't want us to change these from a program, which may be OK for a home computer, but it becomes a major pain in the ___ for an enterprise environment (as there seems to be no GPO to do this either.) I've seen couple commercial products that were able to do this, so I'm sure there's a "hack" somewhere...
tell me the EASIEST way to create a button with an image on it.
I am not interested in using the owner draw property with CBitmapButton and then have to create a whole lot of bitmaps for all the different button states.
There must be a way to simply create an ordinary button which displays an image rather than or as well as a caption....?
I have a MFC dialog project, I move all the icons including the IDR_MAINFRAME icon into a resource-only DLL, so there is no icon embedded in the executable file. In the dialog initialization, the dialog loads the icons using LoadIcon(hResdll, MAKEINTRESOURCE(IDI_MYICON))). The icons shows correctly on the dialog.
But in the Windows Explorer, the icon of the .exe file is not the icon of IDR_MAINFRAME, I check the resource file in the resource-only dll project, the ID number of the IDR_MAINFRAME is the lowest one of all icon ID numbers. I also try
I'm developing a software for Windows using MSVC 2010. My employer sent me 2 png files: 16x16 and 32x32 for the icons.
What I would like to do is to use them as a MSVC icon resource and don't use any code hacks. In the past all I had was an ico file and I just included it in the resource (rc) file for Visual Studio and that was it.
Now my question is: how do I make one ico file out of those 2 png files that will be accepted by MSVC? Is there a tool (preferably free) for it or some online service?
how to change the mouse tracking icon during runtime. I wish to emulate the Microsoft Paint app behavior with respect, for example, to click on a toolbar button such as the 'Fill With Color' bucket and have the mouse pointer icon change to a little bucket. I wish to do this in an MFC SDI app.
Here's a bit of code that does nothing that I can tell, although it compiles and runs. (m_hIcon2 is a member HANDLE, IDI_FLOODFILL is an existing icon in the app resources). I have come across numerous other examples that do not work and/or will not compile using VS 2010 Win7(64).
I made a dialog to have a customizable msgbox. (custom icon, custom caption on buttons). This is how I try to display an icon on the dialog but it is not working.
If I don't assign the icon to my executable file (f.e. it's a DOS application), or I have some unknown extension in the file, Windows Explorer assigns the icon to this file.
Is there a way to somehow get this icon? Either from the registry or by any other means.
When the user gives no input, they have to press enter twice before "Done." is printed.
cout << "What do you want the name of your page to be? "; std::getline(cin, pageTitle); if (cin.get() == ' ') pageTitle = "Welcome to Website."; cout << "Done. ";
Is there a way to print "Done." after pressing enter once?
The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).
On line 128 I'm attempting to delete an image file that was previously shown in an ItemsControl, but was removed by line 126. So the image is not being shown in the program at the time I'm wanting to delete the file.
Error:Additional information: The process cannot access the file 'c:StudioExit PopupKeith Sketch.png' because it is being used by another process.
My Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data;
I've just integrated the Windows SDK V7.0A into my VS2005 application, and I'm getting the dreaded "Application configuration error" when I try to run it on an XP machine.
It runs fine on the development machine, and some customer machines (Win7 and Win8), but will not run on XP due to missing/incorrect version dlls.
I've rebuilt all my libraries, but still no joy.
So, my first question is - If I upgrade the Windows SDK to V7.0A, do I also need to use MFC 10 and msvcrt10, or can I stick with MFC 8?
The next question is, how do I find out which dlls are missing, and which libraries or other dlls are requesting the missing versions?
In my application I have some type of windows showed in an instance of time, and an action shows a new one that i want have the focus all the time , in the way that i can't works with no one of the others. They all are windows, child windows an modeless dialogs, but i don't know how to do. I try use EnableWindow(FALSE) that all the others windows and dialogs, but not works.
I'm having trouble reading my data from a .txt file into a structure of the format shown in my code. I've made my student database in the program below based on user input and I didn't have a problem with that, but now it's come to input from a file it's making it difficult.
My three tasks are:
(1) A table containing 1 row per student, containing the student ID number and all of the student's marks.
(2) Another table, containing 1 row per student, containing the student ID number and the average mark obtained by that student.
(3) The average mark for each subject.
The assumptions to be made are: The student ID can begin with a zero, and should therefore be read in as a string.The test data will contain 20 students but the program should be able to deal with up to 100 students.Assume there are no more than 4 different subjects.
So based on the first assumption I've arranged the data in the file in an order in which the student ID begins with a zero:
...for twenty students, 80 lines of data. Now, on the assumption they must be read in as strings, this is what's making it tricky to store in the structure because, I've got 80 ID numbers but 20 repeat themselves 4 times. Once I've got this data in the structure below the tasks I won't have a problem with because I can just base it on a user input program but the data's already stored instead.
Below is my code for user input associated with task (1). In this example the IDs are stored as ints but for the file they will be strings. It compiles fine, displays the data as shown in the assignment sheet, but I don't know how to get the data into my structure. I can store the data in a structure of three arrays using fscanf() no problem, but it's not very "workable" for what I need to do with it.
I used to retrieve IP and NIC information by querying windows registry. Now I'm trying to use GetAdapterAddresses() API. Using GetAdapterAddresses() to get IP is not that easy, I need to dig a long deep as I check some examples so far, anyways my question is: Calling this API will return success on all versions of Windows ie: 32bits & 64bits ?
Though Microsoft has not opened any source, where this API is actually retrieving Windows IP information.?. Is it reading Registry or some windows file.
I am new in Visual C++ and I have to make an MFC application with "child" windows. Here is what i need to achieve - [URL] ..... As you can observe when you click on the cross of popup window or child window 2 both are closing.
I designed an app for work that lets you enter data in a much more efficient way, then it needs to paste this data into the very curmudgeonly interface we use for work. I designed this app a long time ago while at a different company, and I used VC++ 6. I'm still using VC++ 6, but in a vbox with windows XP.
The code is being called as part of a bigger function that determines what exactly needs to be pasted into the work app spreadsheet. I have to call each item separately because the work app does not take copied tabs the way Excel would or whatever, it just ignores them. And it also pops up boxes and such that need to be handled in other ways.
The result works just fine under Windows XP, but when I do it under my regular Win7 box or on the Win7 boxes at work, it does not work properly.
This sets the data up, Text being the data to be pasted:
Code: while (1) { if (OpenClipboard() == FALSE) { ::Sleep(1); continue; } HGLOBAL clipbuffer; char * buffer; EmptyClipboard();
[Code] ....
No infinite loops yet, again was just testing if it was OpenClipboard failing because it was being called again too quickly or something (and it did happen occasionally).
Then testing that the clipboard data is correct (this is always true), and pasting with keybd_event. SendInput is not available with VC++ 6.
If the ::Sleeps are commented out, it will paste the wrong data almost every time under win7. It seems like it pretty much uses the last thing to be copied in the function and pastes it over and over (but not *always*). If I uncomment them, it will work as expected, but it obviously takes longer. With ::Sleep(50), it works about 80-90% of the time. Obviously I can't have the wrong data being pasted, and I'd prefer not to have to wait like this--and perhaps on a slower system or a system that is doing other things it may take longer and paste the wrong thing. It works fine on XP even without the sleeps.
Did keybd_event become a separate thread or something? Am I doing something wrong with the buffers? (I've tried using CSharedFile too with GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT settings, exact same thing.) Why does it work fine under XP but not under 7?