Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-07-2008, 12:38 PM   #1 (permalink)
Sawman3
The Fist of Odin
 
Sawman3's Avatar
 
Join Date: Feb 2008
Posts: 1
Sawman3 is on a distinguished road
Send a message via AIM to Sawman3 Send a message via MSN to Sawman3 Send a message via Yahoo to Sawman3
Exclamation Importing Images/Using the Mouse (Visual C++)

Hey everyone, Sawman3 here. I'm relatively new to C++, and am currently taking a course at my high school to help solidify the basics. At the moment I am working on a pretty large project, and I have two questions (sorry if I sound like a total n00b).

1) How do I import images into Visual C++? For example, if I have two buttons that I'd like to make available in my software, how do I get them to appear?

2) This stems from question one. Once I have the icons included, how do I get C++ to take input based on a mouse click? I'd like to be able to have a menu system that is navigated with the mouse rather than with arrow keys and the enter key.

Thanks in advance
Sawman3 is offline   Reply With Quote
Old 02-13-2008, 01:44 PM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 651
DJMaze is on a distinguished road
1. create an resource file (.rc) and write in there
Code:
ID_IMG  BITMAP "image.bmp"
Then use
Code:
HBITMAP img = (HBITMAP)LoadImage(HInstance, "ID_IMG", IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR|LR_SHARED);
2. read about WNDCLASSEX, lpfnWndProc and RegisterClassEx() in the MSDN Windows SDK
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DU command adapted in C Deliverance Standard C, C++ 3 12-03-2006 08:56 PM
Kaat a talking bot in c nvictor Platform/API C++ 10 05-19-2005 01:16 PM
getting C# projects to run on Visual Studio .NET 2003 Apodysophilia MS Technologies ( ASP, VB, C#, .NET ) 3 02-21-2005 08:24 PM
edit? anon Lounge 10 11-21-2002 03:02 PM


All times are GMT -8. The time now is 11:37 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting