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 


Dialog vs Standard Window?

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

Joined: 26 Nov 2007
Posts: 47

PostPosted: Fri Nov 30, 2007 9:35 pm    Post subject: Dialog vs Standard Window? Reply with quote

From the winprog win32 tutorial, I read that the system does additional processing for dialogs, and if you are using standard windows, you have to program those features manually. Now I am wondering what's the point of using standard windows if dialogs can be more easily created via resources?
Actually I was programming a simple application with C++ on the win32, and got stuck at a number of things such as tabstops, default push buttons...
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Nov 30, 2007 9:50 pm    Post subject: Reply with quote

Dialogs take up more resources and have to be loaded into memory alot more strenuously than windows.

Read Petzold

_________________
Back to top
View user's profile Send private message
Aikos
Cheater
Reputation: 0

Joined: 26 Nov 2007
Posts: 47

PostPosted: Fri Nov 30, 2007 10:20 pm    Post subject: Reply with quote

Understood. But are the overheads of using dialogs worth when the coding can be simplified to a certain extent?
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Nov 30, 2007 10:32 pm    Post subject: Reply with quote

win32 WNDCLASSX and CreateWindowEx works fine for me. I don't find the code sloppy at all. When it comes down to it, i'd go the dialogless way
_________________
Back to top
View user's profile Send private message
Aikos
Cheater
Reputation: 0

Joined: 26 Nov 2007
Posts: 47

PostPosted: Sat Dec 01, 2007 4:49 am    Post subject: Reply with quote

I still have problems implementing tab stops in a standard window. Can anyone enlighten me to an example?
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Dec 01, 2007 5:44 am    Post subject: Reply with quote

Aikos wrote:
Understood. But are the overheads of using dialogs worth when the coding can be simplified to a certain extent?


Not at all. Use main windows. Only use dialogs on small windows that don't have lots of user interaction or controls, like about boxes (but with Windows Vista, the TaskDialog function deprecates many uses for Dialogs).

Aikos wrote:
I still have problems implementing tab stops in a standard window. Can anyone enlighten me to an example?


Create a list of controls, then use the SetFocus function to set the focus on another control when tab is pressed.

_________________
Back to top
View user's profile Send private message
Aikos
Cheater
Reputation: 0

Joined: 26 Nov 2007
Posts: 47

PostPosted: Sat Dec 01, 2007 7:19 am    Post subject: Reply with quote

appalsap wrote:
Create a list of controls, then use the SetFocus function to set the focus on another control when tab is pressed.


I get the concept of this method. But when the focus is on another control, how do I capture the keypress? Since WM_KEYDOWN only works for the main window. Do I have to use GetAsyncKeyState on another thread to watch it? (seems like too complicated and not the simplest answer according to my intuition)
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Dec 01, 2007 7:20 am    Post subject: Reply with quote

Aikos wrote:
I get the concept of this method. But when the focus is on another control, how do I capture the keypress? Since WM_KEYDOWN only works for the main window. Do I have to use GetAsyncKeyState on another thread to watch it? (seems like too complicated and not the simplest answer according to my intuition)


Subclass the window. Each button, edit box etc is a window of its own, with its own WndProc (which you can check WM_KEYDOWN for). Another reason why you should use standard windows, this becomes clear and the abstractions don't confuse you.

_________________
Back to top
View user's profile Send private message
Aikos
Cheater
Reputation: 0

Joined: 26 Nov 2007
Posts: 47

PostPosted: Sat Dec 01, 2007 7:47 pm    Post subject: Reply with quote

Thanks appalsap. I had a thought that it would possibly window subclassing that does the trick.
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
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