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 


Can some1 tells me what's wrong with that code? (C++)
Goto page Previous  1, 2, 3, 4, 5
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Jun 08, 2008 4:04 am    Post subject: Reply with quote

Ok.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Jun 08, 2008 8:01 am    Post subject: Reply with quote

hey i added scrollbar for my auto potions and i'd like to know how can i set maximum value minimum value get the value and stuff like that
oh and when i want to scroll it left or right i cant it stucks to the left side of the scrollbar
here's how i created the scrollbar:
Code:

hHpScroll = CreateWindowEx(NULL,L"SCROLLBAR",NULL,WS_CHILD | WS_VISIBLE,15,215,136,20,hWnd,(HMENU)IDC_SCROLLBAR_HP,GetModuleHandle(NULL),NULL);

btw i tried using msdn but i could understand what they say :X

_________________
Stylo
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Jun 08, 2008 8:10 am    Post subject: Reply with quote

Not quite sure what you mean, give me the msdn stuff and I'll "translate" it for you.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Jun 08, 2008 8:19 am    Post subject: Reply with quote

SetScrollRange
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Jun 08, 2008 8:56 am    Post subject: Reply with quote

Symbol wrote:
SetScrollRange

thx but how come i cant move it from side to side?
Code:

SetScrollRange(hHpScroll,SB_HORZ,1,100,FALSE);
hHpScroll = CreateWindowEx(NULL,L"SCROLLBAR",NULL,WS_CHILD | WS_VISIBLE,15,215,136,20,hWnd,(HMENU)IDC_SCROLLBAR_HP,GetModuleHandle(NULL),NULL);

edit: maybe i dont need to create the scrollbar window?
maybe i can use ShowScrollBar function?

_________________
Stylo


Last edited by Stylo on Sun Jun 08, 2008 8:58 am; edited 1 time in total
Back to top
View user's profile Send private message
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Sun Jun 08, 2008 8:57 am    Post subject: Reply with quote

1qaz wrote:
Symbol wrote:
SetScrollRange

thx but how come i cant move it from side to side?
Code:

SetScrollRange(hHpScroll,SB_HORZ,1,100,FALSE);
hHpScroll = CreateWindowEx(NULL,L"SCROLLBAR",NULL,WS_CHILD | WS_VISIBLE,15,215,136,20,hWnd,(HMENU)IDC_SCROLLBAR_HP,GetModuleHandle(NULL),NULL);
Before you do anything else, I recommend realizing a mistake with that. You do know, you're trying to call SetScrollRange on a handle that is created afterwards, right?
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Jun 08, 2008 8:59 am    Post subject: Reply with quote

Renkokuken wrote:
1qaz wrote:
Symbol wrote:
SetScrollRange

thx but how come i cant move it from side to side?
Code:

SetScrollRange(hHpScroll,SB_HORZ,1,100,FALSE);
hHpScroll = CreateWindowEx(NULL,L"SCROLLBAR",NULL,WS_CHILD | WS_VISIBLE,15,215,136,20,hWnd,(HMENU)IDC_SCROLLBAR_HP,GetModuleHandle(NULL),NULL);
Before you do anything else, I recommend realizing a mistake with that. You do know, you're trying to call SetScrollRange on a handle that is created afterwards, right?

is it really matter if it's before or afterwards?
if it is so lets say before

_________________
Stylo
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Jun 08, 2008 9:02 am    Post subject: Reply with quote

Yes it does fucking matter... Your sending SetScrollRange to a null handle, it doesn't have a value when your sending the message so it won't do anything -_-
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Jun 08, 2008 9:02 am    Post subject: Reply with quote

Yes it is. Because your trying to use it on a NULL handle. You have to call it afterwards like this.

Code:

hHpScroll = CreateWindowEx(NULL,L"SCROLLBAR",NULL,WS_CHILD | WS_VISIBLE,15,215,136,20,hWnd,(HMENU)IDC_SCROLLBAR_HP,GetModuleHandle(NULL),NULL);
SetScrollRange(hHpScroll,SB_HORZ,1,100,FALSE);


EDIT:

Beaten to it by lurc...

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing


Last edited by oib111 on Sun Jun 08, 2008 9:02 am; edited 1 time in total
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Sun Jun 08, 2008 9:02 am    Post subject: Reply with quote

1qaz wrote:
Renkokuken wrote:
1qaz wrote:
Symbol wrote:
SetScrollRange

thx but how come i cant move it from side to side?
Code:

SetScrollRange(hHpScroll,SB_HORZ,1,100,FALSE);
hHpScroll = CreateWindowEx(NULL,L"SCROLLBAR",NULL,WS_CHILD | WS_VISIBLE,15,215,136,20,hWnd,(HMENU)IDC_SCROLLBAR_HP,GetModuleHandle(NULL),NULL);
Before you do anything else, I recommend realizing a mistake with that. You do know, you're trying to call SetScrollRange on a handle that is created afterwards, right?

is it really matter if it's before or afterwards?
if it is so lets say before
Of course the handle has the be valid beforehand, otherwise the function will just fail. Passing an invalid parameter, what else would you expect?
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Jun 08, 2008 9:06 am    Post subject: Reply with quote

sry i think i missed it XD
but why cant i move the scrollbar what else do i need to add this?

_________________
Stylo
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Jun 08, 2008 9:14 am    Post subject: Reply with quote

Try initializing common controls?

Add this to your headers:
Code:
#include <commctrl.h>
#pragma comment ( lib, "comctl32.lib" )


Then this before you fill ur WNDCLASSEX struct.
Code:
INITCOMMONCONTROLSEX Init;
Init.dwSize = sizeof(INITCOMMONCONTROLSEX);
Init.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx( &Init );

_________________
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Jun 08, 2008 9:30 am    Post subject: Reply with quote

still stuck
anyway thanks for all your help guys i think i'll pass it for now
and continue with learning the language, still have lots of thing to learn i see
i'll just continue with this bot after i'll learn to control this language good enough Cool

_________________
Stylo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5
Page 5 of 5

 
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