Hi, I was just trying to make a glassy type button.ie, the one which are transparent
but gives a cool effect. So ,I made a transparent bmp image in Photoshop.
Then I added it as a resource. Now I have a dialog box having a button.
Well, when I looked at the resource editor, the button has that transparent image over it as I had followed the steps in the help file. Now the problem is the program compiles well but no dialog box is seen. My code is - #include<windows.h>
-
#include"res.h"
-
-
BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
-
{
-
-
switch(msg)
-
{
-
case WM_INITDIALOG:SetDlgItemText(hwnd,IDC_TEXT,"333");
-
break;
-
case WM_COMMAND:switch(LOWORD(wParam))
-
{
-
-
case IDC_ENCODE:MessageBox(hwnd,"WATER.BMP","TRAMSPARENT",NULL);
-
break;
-
}
-
break;
-
case WM_CLOSE:EndDialog(hwnd,0);
-
break;
-
default:return FALSE;
-
}
-
-
return TRUE;
-
-
}
-
-
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
-
{
-
//HICON hMyIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
-
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
-
-
}
-
And the contents of the resource script is - #include"res.h"
-
IDB_BITMAP1 BITMAP "water.bmp"
-
-
-
1 DIALOGEX 0, 0, 240, 120
-
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP
-
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_MINIMIZEBOX
-
CAPTION "RAHUL"
-
FONT 8, "MS Sans Serif"
-
{
-
CONTROL "ENCODE", IDC_ENCODE, "BorBtn", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 136, 24, 87, 64
-
CONTROL "Edit1", IDC_TEXT, "edit", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 20, 39, 96, 12
-
}
-
and contents of the res.h file is
#define IDC_TEXT 102
#define IDB_BITMAP1 1101
#define IDC_ENCODE 101
#define IDD_DIALOG1 1
Please help... :-)
1 2738
Hi, I was just trying to make a glassy type button.ie, the one which are transparent
but gives a cool effect. So ,I made a transparent bmp image in Photoshop.
Then I added it as a resource. Now I have a dialog box having a button.
Well, when I looked at the resource editor, the button has that transparent image over it as I had followed the steps in the help file. Now the problem is the program compiles well but no dialog box is seen. My code is - #include<windows.h>
-
#include"res.h"
-
-
BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
-
{
-
-
switch(msg)
-
{
-
case WM_INITDIALOG:SetDlgItemText(hwnd,IDC_TEXT,"333");
-
break;
-
case WM_COMMAND:switch(LOWORD(wParam))
-
{
-
-
case IDC_ENCODE:MessageBox(hwnd,"WATER.BMP","TRAMSPARENT",NULL);
-
break;
-
}
-
break;
-
case WM_CLOSE:EndDialog(hwnd,0);
-
break;
-
default:return FALSE;
-
}
-
-
return TRUE;
-
-
}
-
-
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
-
{
-
//HICON hMyIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
-
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
-
-
}
-
And the contents of the resource script is - #include"res.h"
-
IDB_BITMAP1 BITMAP "water.bmp"
-
-
-
1 DIALOGEX 0, 0, 240, 120
-
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP
-
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_MINIMIZEBOX
-
CAPTION "RAHUL"
-
FONT 8, "MS Sans Serif"
-
{
-
CONTROL "ENCODE", IDC_ENCODE, "BorBtn", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 136, 24, 87, 64
-
CONTROL "Edit1", IDC_TEXT, "edit", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 20, 39, 96, 12
-
}
-
and contents of the res.h file is
#define IDC_TEXT 102
#define IDB_BITMAP1 1101
#define IDC_ENCODE 101
#define IDD_DIALOG1 1
Please help... :-)
What is your question? Are you looking for a filter to add to the button type, or what?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: S.W. Rasmussen |
last post by:
With the risk of being accused of multi-posting I would like to draw the
attention to a serious visual basic/windows issue discussed in the
microsoft.public.vb.bugs newsgroup. As pointed out below...
|
by: Shark |
last post by:
Just a post for anyone else that is having this problem (as I've now
discovered the solution).
The problem is where when looking in the dialog resource view of an
MFC project in Visual Studio...
|
by: pradeep_TP |
last post by:
I am facing a strange problem with my web site. Afer reinstalling the web
application on the web server, I am getting a dialog box for each page. The
dialog box has the following information.
...
|
by: kmslick |
last post by:
Hello all. Not sure which group this problem best relates to, so I'm
posting to both with a follow up.
I started learning C# and .NET last august for a project for my
employer. The project...
|
by: drummond.ian |
last post by:
Hello Everyone,
This problem's been causing me a lot of trouble and I'm hoping
somebody can help me out!!
I have a dialog-based MFC application in visual studio 2003. I want to
call a...
|
by: deciacco |
last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview
control to redraw the preview I get the...
|
by: Les Caudle |
last post by:
I've got a .NET 2.0 app that works quite well on all of my test boxes.
However, at the client's site, it crashes with
'has encounted a problem' basic dialog. No useful info.
I've yet to see...
|
by: GraffixNYC |
last post by:
We have a model dialog box(well a bunch of them) and it seems that
when you cancel one of the in our application it will activate and
bring the focus to another open window (not in our application)...
|
by: Peter |
last post by:
ASP.NET 2.0
I am trying to open a Word document and Excel document from a dialog web
page, what's the best way to do that?
I have tried the following:
Response.Clear();...
|
by: Lawyno |
last post by:
Hi there :)
Here are some infos about my "project":
I have the "honor" to write some scripts (VBScript) for some application developed by another company. In this application there is limited...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |