Visual C++ :: Setting Icon Of Exe File?

Oct 9, 2013

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

Code:
SetClassLongPtr(m_hWnd, GCLP_HICON, (LONG)LoadIcon(hResdll, MAKEINTRESOURCE(IDR_MAINFRAME)));

But it doesn't work. The IDR_MAINFRAME icon doesn't show in the Explorer window, the system provides a default icon for the .exe file.

View 4 Replies


ADVERTISEMENT

Visual C++ :: Default File Icon - Unknown Extension

Apr 1, 2013

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.

View 3 Replies View Related

Visual C++ :: MFC Button With Icon Or Image?

Jul 30, 2014

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....?

View 3 Replies View Related

Visual C++ :: How To Make Icon For MSVC Project

Oct 22, 2013

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?

View 3 Replies View Related

Visual C++ :: How To Change Client Area Icon During Runtime

Feb 23, 2015

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).

Code:
void CMainFrame::SetNewIcon() {
m_hIcon2 = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_FLOODFILL));
SetIcon(m_hIcon2, FALSE);

[Code].....

View 8 Replies View Related

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...

View 2 Replies View Related

Visual C++ :: Displaying Icon In A Simple Dialog With WinAPI

Feb 27, 2013

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.

HICON hIcon = LoadIcon(NULL, IDI_QUESTION);
HWND hImageCtl = GetDlgItem(hDlg, IDC_STATIC);
::SendMessage(hImageCtl, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
//SendDlgItemMessage(hDlg, IDC_STATIC, STM_SETICON, (WPARAM) hIcon, 0);

View 5 Replies View Related

Visual C++ :: How To Use CListCtrl For Show Multiple DialogBoxs Like Items In Icon View

Jan 15, 2014

i can write a mfc program to make a Thumbnail view with image but can not this when change image with CDialogBox.

Thumbnail view with image(chart) like this:

for (int i=0;i<10;i++) {
CChartContainer *cc = new CChartContainer();
if(cc->m_frmWin->Create(_T(""),
WS_CHILD|WS_VISIBLE|SS_BITMAP, rc,
this,idDyn)) {
}
}

how can i write mfc program to make a Thumbnail view of CDialogBoxs?

do i can use CListCtrl for show multiple DialogBoxs?

View 13 Replies View Related

Visual C++ :: Setting Slider Position Programmatically?

Jan 31, 2014

I have a problem to set sliderposition programmatically. This is my try:

//pointer to my slider control:
// On the begining the range ist 1 to 10
// and the position is on 5
// change the range:
pSliderCtrl->SetRange(1, 100); // ok no problems

Now, how to "move" btw. how to redraw the position of the slider thumb programmaticaliy with c++? Need to send some message, if yes what message i need to send to slider control to move (reposition) the slider thumb?

I try with
// first:
::SendMessage(pSlider->m_hWnd, WM_NOTIFY, TRBN_THUMBPOSCHANGING, 0);
// then with:
::SendMessage(pSlider->m_hWnd, WM_NOTIFY, NM_RELEASEDCAPTURE, 0);

but nothing happens?

View 2 Replies View Related

C/C++ :: Setting Up GLFW In Visual Studio 2013 Correctly?

Feb 27, 2015

I believe I set up everything correctly. I linked the library folder, the includes, and included the libraries needed. It still comes up with an error that it can't find the functions or something like that.

The error:

Do I need to include the DLL some way? I tried adding it to the build directory and the EXE directory, but it did not work. My code is just a small test.

#include <GLFW/glfw3.h>
#include <cstdio>
#include <cstdlib>
int main() {
if (glfwInit() == false) {

[Code] ....

View 6 Replies View Related

Visual C++ :: Unable To Find Setting For Exception Handling In MFC

Jan 24, 2013

My MDI Project(VC++2010 Professional) is unable to catch errors ,though I return ,try catch block. So I developed simple dialog based application .Placed one button on Dialog and on its click written following code

Collapse | Copy Code
void CMFCExecDlg::OnBnClickedButton1() {
try {
int j = 0;
int i = 10/j;
}
catch(CException * e) {
MessageBox(_T("Hello"),_T(""),MB_OK);
}
}

But still program control does not come in catch block it simply gives error. I tried all child classes of CException but no use.I think there will be some setting in Visual Studio. How to handle exceptions

View 1 Replies View Related

Visual C++ :: PDF Creator Printer - Setting Print Options

Apr 12, 2014

I am using PDF Creator printer to print my files. I have set it as default printer. It displays two dialogs .. "Printer Setup Dialog" and "Dialog asking filename and other details to save to file".

I want to avoid these two dialogs. But EndDoc calls the other dialog by default. How to do this ?

View 13 Replies View Related

Visual C++ :: MFC GUI-setting COMPort And Read Hex Data From Pic (ASCII)

May 22, 2014

I want to setup my MFC-based dialogue "IDD_LOADCELL" with serial communication so that when that dialogue is pop up, the data from PIC (external device) which is in hex file format is display on the edit control box on the dialogue. The variable name of the edit control box is "m_loadP "and "m_loadT1". type of variable for both are string. I want to get the code for the COMPort setting and reading the data from pic and finally display it on the edit control box created on the dialogue.

View 11 Replies View Related

C++ :: Setting Values Using A Text File?

May 19, 2014

in the following code how would i set a txt file up to where i can have say name = whatever in it and the program will find it and set it to the corresponding global value.

#include <fstream>
#include <iostream>
#include <string>

[Code]....

View 1 Replies View Related

C++ :: Win32 API Icon Loading Error (VS2010)

Jul 9, 2013

I am trying to load an icon I created for my program. Relevant code is below:

Code:
//resource.h
#define IDR_MYMENU 103
#define IDR_MYICON 201
#define ID_HELP_NOTICE 40001
#define ID_HELP_ERROR 40002
#define ID_FILE_EXIT 40003

[Code] ....

For some reason, the icon fails to load. I ran a breakpoint at the line for the hIconSm and got this error for the variable:

Code: CXX0030: Error: expression cannot be evaluated

The icon image is in the source folder and was compiled via ImageMagick. Google is not giving me any info regarding the error and the icon combined.

View 2 Replies View Related

C# :: Why Is Node Click Event Changing The Node Icon

Jul 26, 2014

I'm having a hard time figuring how to get my imagelist index 3 icon to display in the nodes "N1" and "V Speeds" below? So, as you can see in the attachment, the closed folder icon is currently shown which is index 0 in the imagelist. But I want index icon 2 to show in these two nodes.

treeView.BeginUpdate();
treeView.Nodes.Clear();
treeView.Nodes.Add(new TreeNode("Checklist"));

[Code].....

View 12 Replies View Related

C++ :: Setting Array To Int With Value

Mar 1, 2013

Lets say i have an array with the values 1, 5, 9, and 3. is there anyway to make this so i can have an int with the value 1593 based on those numbers in the array?

View 8 Replies View Related

C++ :: Setting Limit On Cin?

Feb 22, 2013

I want to set limit on cin for example

int i;
cout<<"Please enter 4 digits id: ";
cin>>i

If user enter more then 4 digits it must give an error

View 5 Replies View Related

C :: Setting Values To Pointers

Apr 5, 2014

This function below takes a pointer as an argument. What I expect to happen is, since expr++ has higher precedence than *expr, that is, the primary expression operators have higher precedence than the unary operators, pointer arithmetic should occur where we increment to the second address pointed to by dbuf, and then we should dereference the value at that address. Given that logiv, when i print dbuf[3] it should print the value pointed to at the 4th address in dbuf. However, the value it returns is 0x0 not 0x3. Why doesn't it dereference the value 0x3?

Code: void dfill(unsigned char *dbuf)
{
dbuf = (unsigned char*)malloc(4);
memset(dbuf, 0, 4);
*dbuf = 0x0;
*dbuf++ = 0x1;
*dbuf++ = 0x2;
*dbuf++ = 0x3;
printf("dbuf val: 0x%x
", dbuf[3]);
}

View 1 Replies View Related

C :: Setting Flags In 32-bit Integer?

Oct 18, 2013

I am trying to create the lparam for the WM_KEYDOWN message. I know this is the C programming forum, but my code is standard enough to apply here. According to Microsoft, the lparam must be formatted like this : lParam The repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown following. Bits Meaning 0-15 The repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent.

However, the repeat count is not cumulative. 16-23 The scan code. The value depends on the OEM. 24 Indicates whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0. 25-28 Reserved; do not use. 29 The context code. The value is always 0 for a WM_KEYDOWN message. 30 The previous key state.

The value is 1 if the key is down before the message is sent, or it is zero if the key is up. 31 The transition state. The value is always 0 for a WM_KEYDOWN message. ( WM_KEYDOWN message (Windows) )^ I'm troubled by setting it into the 32-bit value, and I get confused about what exactly happens when the logical or and the bitshift operators are used. I tried to use them below in my code by looking at Stack Overflow for setting a bit. I also don't know how to test for the endianess of my system, and how to handle it if it's big endian or little endian. Here is my code so far :

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

[Code].....

View 2 Replies View Related

C :: Setting 1D Pointer To Array

Oct 27, 2013

I have the following situation:

Code:
void myFun(float *pfMyPtr) {
float Val[] = {0.234, 0,432, 0.322, 0762, 0.984};
pfMyPtr = Val;
}
int main() {
float *pfPtr;
pfPtr = (float*) calloc (5,sizeof(float));
myFun(pfPtr);
}

I would like pfPtr to contain the values of array Val. What am I missing here?

View 5 Replies View Related

C++ ::  Setting A Function To A Variable?

Oct 29, 2014

I need to set a function to a variable of some kind. Then later in the program it needs to run the function that is set to the variable. The variable doesn't need to change after it is set to a function, it just needs to be able to be set to a function. So maybe I don't need a variable? What do I do? :3 Is this even possible? :o

Example:
if (PosRampYes == 0)
{
SomeVariableOrSomething = FirstFunction();
}
else
{
SomeVariableOrSomething = SecondFunction();
}
//later:
SomeVariableOrSomething; //so if PosRampYes is set to 0 then this line would run FirstFunction()

View 2 Replies View Related

C++ :: Setting Variables For Text

Oct 8, 2013

I am trying to find a quicker way of setting the variables for text. here is my code:

sf::Text set_text_values(sf::Text text, sf::Font font) {
text.setFont(font);
text.setCharacterSize(50);
text.setColor(sf::Color::White);
return text;

[Code] ....

And I have tried it like this

void set_text_values(sf::Text text, sf::Font font) {
text.setFont(font);
text.setCharacterSize(50);
text.setColor(sf::Color::White);

[Code] ....

The code compiles and runs but it won't show the text on the screen like it did when i did it manually like this:

int main() {
Hull.setFont(font);
Hull.setCharacterSize(50);
Hull.setColor(sf::Color::White);
}

What is wrong with it?

View 2 Replies View Related

C++ :: Setting All Elements Of Array To 0

Sep 18, 2013

I'm trying to set all the elements of my array to 0 but nothing seems to be working.

.h
#ifndef ServerGroup_h
#define ServerGroup_h
class ServerGroup {
public:
ServerGroup(const int&);

[Code] .....

I want to set each element of the array in servers to 0 based on what is passed into size by numArray.

View 9 Replies View Related

C++ :: Setting The Value Of A Pointer From Function

Feb 20, 2013

I declared a pointer in main with value 0, so I want to change its value so that it points to other variable from a function, I guess the function creates a copy of my pointer that's why whatever I do within function doesn't change the real direction of the pointer in main. I've been trying something like this:

#include <stdio.h>
void redirectionate(char *str, char *ptrCopy);
int main()
{

[Code]....

View 7 Replies View Related

C/C++ :: Setting Constants As Attribute?

Apr 3, 2015

I would like to know how can i set a constant attribute in the constructor. This attribute is an int value that cannot be changed.

For instance:

class Test {
public:
const int x;
public:
Test(const int val);

[code].....

With this code i get compile error!

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved