Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dialog box icons Posted by docbruff on 27 Dec 2004 at 8:51 PM
Hi Everyone.
I have seen some windows applications in which the push button controls are icons or bitmaps. How is this done.
I am using Borland C++ ver. 5

TKU
Doc.
Report
Re: Dialog box icons Posted by AsmGuru62 on 29 Dec 2004 at 7:27 PM
: Hi Everyone.
: I have seen some windows applications in which the push button controls are icons or bitmaps. How is this done.
: I am using Borland C++ ver. 5
:
: TKU
: Doc.
:
You can find button reference here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttons.asp

There is a style BS_BITMAP and message BM_SETIMAGE:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/aboutbuttons.asp

Report
Re: Dialog box icons Posted by docbruff on 29 Dec 2004 at 10:56 PM
: : Hi Everyone.
: : I have seen some windows applications in which the push button controls are icons or bitmaps. How is this done.
: : I am using Borland C++ ver. 5
: :
: : TKU
: : Doc.
: :
: You can find button reference here:
:
: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttons.asp
:
: There is a style BS_BITMAP and message BM_SETIMAGE:
:
: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/aboutbuttons.asp
:

:

asmguru: Thank you, I will try it out.

Report
Re: Dialog box icons Posted by docbruff on 30 Dec 2004 at 10:44 PM
: : Hi Everyone.
: : I have seen some windows applications in which the push button controls are icons or bitmaps. How is this done.
: : I am using Borland C++ ver. 5
: :
: : TKU
: : Doc.
: :
: You can find button reference here:
:
: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttons.asp
:
: There is a style BS_BITMAP and message BM_SETIMAGE:
:
: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/aboutbuttons.asp
:

:

Asmguru62:
I tried using the information you provided, but can't get it work.

here's what I did: I created a PUSHBUTTON control in the Dialog.
In the Properties Dialog I set this Push Button to
"Icon".
Then in my program I have the following lines:

Dwnd= GetDlgItem(hDlg,140);

SendMessage(Dwnd,(UINT) BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM) Edit);

In my .h file I have:
#define Edit 2002
In my .rc file I have:
Edit BITMAP "edit.bmp"

Am I missing something ?
Report
Re: Dialog box icons Posted by Johnny13 on 4 Jan 2005 at 12:39 PM
: Asmguru62:
: I tried using the information you provided, but can't get it work.
:
: here's what I did: I created a PUSHBUTTON control in the Dialog.
: In the Properties Dialog I set this Push Button to
: "Icon".
: Then in my program I have the following lines:
: Am I missing something ?
:
lParam is the handle of the loaded image.
SendDlgItemMessageA(hDlg,BUTTON_ID,0xF7,1,LoadImageA(hinstance,ICON_ID,1,16,16,0));


Report
Re: Dialog box icons Posted by docbruff on 7 Jan 2005 at 8:36 PM
: : Asmguru62:
: : I tried using the information you provided, but can't get it work.
: :
: : here's what I did: I created a PUSHBUTTON control in the Dialog.
: : In the Properties Dialog I set this Push Button to
: : "Icon".
: : Then in my program I have the following lines:
: : Am I missing something ?
: :
: lParam is the handle of the loaded image.
SendDlgItemMessageA(hDlg,BUTTON_ID,0xF7,1,LoadImageA(hinstance,ICON_ID,1,16,16,0));

:

:

johnny13: Thank you, It worked.
TKU.
doc.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.