Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++ help] Changing the image inside a picture box

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Sun Feb 08, 2009 5:10 pm    Post subject: [C++ help] Changing the image inside a picture box Reply with quote

I'm using a dialog box, made in ResEdit.

To change the text in a label/edit box/etc. you use SetDlgItemText().

How can I change the image inside a picture box? The bitmaps are already embedded into the resource file.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Feb 08, 2009 5:26 pm    Post subject: Reply with quote

you can send it a STM_SETIMAGE message, or just do the drawing yourself.
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Sun Feb 08, 2009 11:25 pm    Post subject: Reply with quote

Hmm, I tried that and it simply made the image disappear. When sending STM_SETIMAGE, what does the lParam have to be? The HINSTANCE that contains the loaded bitmap, or the HBITMAP that returns a handle to the bitmap?
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Feb 08, 2009 11:34 pm    Post subject: Reply with quote

lParam should be a handle to the image, so yes, the HBITMAP
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Sun Feb 08, 2009 11:40 pm    Post subject: Reply with quote

Okay, this is my code.
Code:
HINSTANCE hInstBItmap;
HBITMAP hOn = LoadBitmap(hInstBitmap, MAKEINTRESOURCE(IDB_BITMAP3));
SendDlgItemMessage(hWnd, IDC_STATUS, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hOn);

The image just disappears (or, I think maybe it's not "disappearing", it's loading a void image). Help?

Edit: solved my problem, hInstBitmap should have been the hInstance used to make my window. Close thread please.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites