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++ dlg item id

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

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Apr 05, 2008 1:12 am    Post subject: C++ dlg item id Reply with quote

could anyone tell me how to assign an id to a control, im using win32 and im using createwindow to create edit controls, but i dont know how to set the id without creating a whole new class

i need to use GetDlgItemInt to read the value of the box, and i dont know any other way

_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sat Apr 05, 2008 1:22 am    Post subject: Reply with quote

Quote:
Code:
   HWND CreateWindowEx(     
        DWORD dwExStyle,
        LPCTSTR lpClassName,
        LPCTSTR lpWindowName,
        DWORD dwStyle,
        int x,
        int y,
        int nWidth,
        int nHeight,
        HWND hWndParent,
        HMENU hMenu,
        HINSTANCE hInstance,
        LPVOID lpParam
    );


Parameters

...

hMenu
[in] Handle to a menu, or specifies a child-window identifier, depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window.
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Apr 05, 2008 1:40 am    Post subject: Reply with quote

yes i've read it

but how do i set hMenu as an integer

i've defined my integers and created my hMenu, even got the command to read from the dlgitem working, but my hMenu or control doesn't have that integer value related to it in any way

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Apr 05, 2008 3:10 am    Post subject: Reply with quote

hMenu is the ID of the control in this case.

Say you used 123 for it. GetDlgItemInt wants a handle to the parent and the child ID.

Example being

Code:
unsigned int boners = 0;
boners = GetDlgItemInt(hwnd, 100, NULL, FALSE);


easy as 123 (hurr)
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Sat Apr 05, 2008 4:15 am    Post subject: Reply with quote

Code:
#define WINDOW2 666

CreateWindowEx( dwExStyle,
        LPCTSTR lpClassName,
        LPCTSTR lpWindowName,
        DWORD dwStyle,
        int x,
        int y,
        int nWidth,
        int nHeight,
        HWND hWndParent,

        (HMENU)WINDOW2,

        HINSTANCE hInstance,
        LPVOID lpParam  );


Hehe Confused
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 3:16 pm    Post subject: Reply with quote

Just a side note, if you are using CreateWindowEx to create your window and controls, then you aren't using dialogs. Instead, you are using pure Win32 API to create your programs interface.
_________________
- Retired.
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