473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dialog Problem

dfound
52
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

Expand|Select|Wrap|Line Numbers
  1. #include<windows.h>
  2. #include"res.h"
  3.  
  4. BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
  5. {
  6.  
  7. switch(msg)
  8. {
  9.   case WM_INITDIALOG:SetDlgItemText(hwnd,IDC_TEXT,"333");
  10.   break;
  11.   case WM_COMMAND:switch(LOWORD(wParam))
  12.     {
  13.  
  14.   case IDC_ENCODE:MessageBox(hwnd,"WATER.BMP","TRAMSPARENT",NULL);
  15.                                break;
  16.      }
  17.   break;
  18.   case WM_CLOSE:EndDialog(hwnd,0);
  19.                 break;
  20.   default:return FALSE;
  21.  }
  22.  
  23.   return TRUE;
  24.  
  25. }
  26.  
  27. int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
  28. {
  29. //HICON hMyIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
  30.  return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
  31.  
  32.  }
  33.  
And the contents of the resource script is
Expand|Select|Wrap|Line Numbers
  1. #include"res.h"
  2. IDB_BITMAP1 BITMAP "water.bmp"
  3.  
  4.  
  5. 1 DIALOGEX 0, 0, 240, 120
  6. EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP
  7. STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_MINIMIZEBOX
  8. CAPTION "RAHUL"
  9. FONT 8, "MS Sans Serif"
  10. {
  11.  CONTROL "ENCODE", IDC_ENCODE, "BorBtn", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 136, 24, 87, 64
  12.  CONTROL "Edit1", IDC_TEXT, "edit", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 20, 39, 96, 12
  13. }
  14.  
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... :-)
Mar 3 '07 #1
1 2738
sicarie
4,677 Expert Mod 4TB
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

Expand|Select|Wrap|Line Numbers
  1. #include<windows.h>
  2. #include"res.h"
  3.  
  4. BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
  5. {
  6.  
  7. switch(msg)
  8. {
  9.   case WM_INITDIALOG:SetDlgItemText(hwnd,IDC_TEXT,"333");
  10.   break;
  11.   case WM_COMMAND:switch(LOWORD(wParam))
  12.     {
  13.  
  14.   case IDC_ENCODE:MessageBox(hwnd,"WATER.BMP","TRAMSPARENT",NULL);
  15.                                break;
  16.      }
  17.   break;
  18.   case WM_CLOSE:EndDialog(hwnd,0);
  19.                 break;
  20.   default:return FALSE;
  21.  }
  22.  
  23.   return TRUE;
  24.  
  25. }
  26.  
  27. int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
  28. {
  29. //HICON hMyIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
  30.  return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
  31.  
  32.  }
  33.  
And the contents of the resource script is
Expand|Select|Wrap|Line Numbers
  1. #include"res.h"
  2. IDB_BITMAP1 BITMAP "water.bmp"
  3.  
  4.  
  5. 1 DIALOGEX 0, 0, 240, 120
  6. EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP
  7. STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_MINIMIZEBOX
  8. CAPTION "RAHUL"
  9. FONT 8, "MS Sans Serif"
  10. {
  11.  CONTROL "ENCODE", IDC_ENCODE, "BorBtn", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 136, 24, 87, 64
  12.  CONTROL "Edit1", IDC_TEXT, "edit", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 20, 39, 96, 12
  13. }
  14.  
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?
Mar 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
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...
0
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...
6
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. ...
1
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...
3
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...
3
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...
12
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...
5
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)...
7
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();...
3
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.