how would i
-
= "WindowsApp"; int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ /* The Window structure */ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */ wincl.style = CS_DBLCLKS; /* Catch double-clicks */ wincl.cbSize = sizeof (WNDCLASSEX); /* Use default icon and mouse-pointer */ wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION); wincl.hCursor = LoadCursor (NULL, IDC_ARROW); wincl.lpszMenuName = NULL; /* No menu */ wincl.cbClsExtra = 0; /* No extra bytes after the window class */ wincl.cbWndExtra = 0; /* structure or the window instance */ /* Use Windows's default color as the background of the window */ wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; /* Register the window class, and if it fails quit the program */ if (!RegisterClassEx (&wincl)) return 0; /* The class is registered, let's create the program*/ hwnd = CreateWindowEx ( 0, /* Extended possibilites for variation */ szClassName, /* Classname */ "Windows App", /* Title Text */ WS_OVERLAPPEDWINDOW, /* default window */ CW_USEDEFAULT, /* Windows decides the position */ CW_USEDEFAULT, /* where the window ends up on the screen */ 544, /* The programs width */ 375, /* and height in pixels */ HWND_DESKTOP, /* The window is a child-window to desktop */ NULL, /* No menu */ hThisInstance, /* Program Instance handler */ NULL
-
= "WindowsApp"; int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ /* The Window structure */ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */ wincl.style = CS_DBLCLKS; /* Catch double-clicks */ wincl.cbSize = sizeof (WNDCLASSEX); /* Use default icon and mouse-pointer */ wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION); wincl.hCursor = LoadCursor (NULL, IDC_ARROW); wincl.lpszMenuName = NULL; /* No menu */ wincl.cbClsExtra = 0; /* No extra bytes after the window class */ wincl.cbWndExtra = 0; /* structure or the window instance */ /* Use Windows's default color as the background of the window */ wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; /* Register the window class, and if it fails quit the program */ if (!RegisterClassEx (&wincl)) return 0; /* The class is registered, let's create the program*/ hwnd = CreateWindowEx ( 0, /* Extended possibilites for variation */ szClassName, /* Classname */ "Windows App", /* Title Text */ WS_OVERLAPPEDWINDOW, /* default window */ CW_USEDEFAULT, /* Windows decides the position */ CW_USEDEFAULT, /* where the window ends up on the screen */ 544, /* The programs width */ 375, /* and height in pixels */ HWND_DESKTOP, /* The window is a child-window to desktop */ NULL, /* No menu */ hThisInstance, /* Program Instance handler */ NULL
You can add a bitmap to the EXE's resources or it can be in a stand-alone file. Which method are you interested in? Also, how is the code you posted relevant? Are you wondering where in the code to do the load? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
= "WindowsApp"; int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { HWND hwnd; /* This is the handle for our window */ MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ /* The Window structure */ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */ wincl.style = CS_DBLCLKS; /* Catch double-clicks */ wincl.cbSize = sizeof (WNDCLASSEX); /* Use default icon and mouse-pointer */ wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION); wincl.hCursor = LoadCursor (NULL, IDC_ARROW); wincl.lpszMenuName = NULL; /* No menu */ wincl.cbClsExtra = 0; /* No extra bytes after the window class */ wincl.cbWndExtra = 0; /* structure or the window instance */ /* Use Windows's default color as the background of the window */ wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; /* Register the window class, and if it fails quit the program */ if (!RegisterClassEx (&wincl)) return 0; /* The class is registered, let's create the program*/ hwnd = CreateWindowEx ( 0, /* Extended possibilites for variation */ szClassName, /* Classname */ "Windows App", /* Title Text */ WS_OVERLAPPEDWINDOW, /* default window */ CW_USEDEFAULT, /* Windows decides the position */ CW_USEDEFAULT, /* where the window ends up on the screen */ 544, /* The programs width */ 375, /* and height in pixels */ HWND_DESKTOP, /* The window is a child-window to desktop */ NULL, /* No menu */ hThisInstance, /* Program Instance handler */ NULL
I dont know is this your question you can enter code of bitamp on the source code of your project.
-
You can add a bitmap to the EXE's resources or it can be in a stand-alone file. Which method are you interested in? Also, how is the code you posted relevant? Are you wondering where in the code to do the load? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
I think if he used of dll file for enter bitmap is better than exe file(for size of exe file).
-
I think if he used of dll file for enter bitmap is better than exe file(for size of exe file).
Yeah. IMO that's a matter of implementation need/choice. Pretty much the same amount of data gets added to the overall solution. The DLL will need to be loaded eventually but I suppose if startup performance was a real issue... :) Cheers, Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
You can add a bitmap to the EXE's resources or it can be in a stand-alone file. Which method are you interested in? Also, how is the code you posted relevant? Are you wondering where in the code to do the load? Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Yes where in the code to load it, and how would i phrase if for my C++ compiler to pull it up in the app window?
Michael (Up and coming Game programmer) EST
-
Yes where in the code to load it, and how would i phrase if for my C++ compiler to pull it up in the app window?
Michael (Up and coming Game programmer) EST
If you want to eneter bitmap on the resource then you can use of
CBitmap::Load
for load it. -
Yes where in the code to load it, and how would i phrase if for my C++ compiler to pull it up in the app window?
Michael (Up and coming Game programmer) EST
So you want to load it and display it? Loading can be done any time, usually before whe window that will display the bitmap gets its first WM_PAINT message. Displaying should be done in response to WM_PAINT. How you load the bitmap depends on where it's stored and what format it's in. Displaying the bitmap depends on what format you load it in.
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I dont know is this your question you can enter code of bitamp on the source code of your project.
Really i need the starting of the script to add the bitmap and to know where to add it to the exe file format. But the information given already give me and idea. < might be a bad idea but worth a try>
Hamid. wrote:
I dont know is this your question you can enter code of bitamp on the source code of your project
Michael (Up and coming Game programmer) EST
-
Really i need the starting of the script to add the bitmap and to know where to add it to the exe file format. But the information given already give me and idea. < might be a bad idea but worth a try>
Hamid. wrote:
I dont know is this your question you can enter code of bitamp on the source code of your project
Michael (Up and coming Game programmer) EST
You can import bitmap file to resource of exe file but here a problem that it increase size of exe file but you can load bmp of a foreign file but it depends to your program after select way if you have any question you can ask of me.;)(but I dont know why I got vote 1 on previous reply)