15,906,463 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by drkwlf (Top 22 by date)
drkwlf
9-Dec-15 15:49pm
View
That makes sense to me, thank you.
drkwlf
9-Dec-15 15:45pm
View
Ok, now I am even more confused because RECT WeirdRect = { 0, 1, 2, 3}; is not only correct syntax but will compile and function without issue. It seems the problem only lies in using the block initialization after the variable has already been declared.
drkwlf
8-Dec-15 17:21pm
View
By background I mean it runs as a process without a gui
drkwlf
8-Dec-15 17:21pm
View
Yes the game runs in the background... It looks as though, as mentioned in the solution below, that the actual WinProc() function is not being called.
drkwlf
8-Dec-15 16:59pm
View
Yes, why does it run in the background instead of ending the program when closed.
drkwlf
17-Jun-15 15:09pm
View
You say hang the system, are you asking how to halt the system during shutdown so it can not continue? Are you asking how to run a task during shutdown. Halting the system during shutdown, just for fun, is unethical so I hope that's not what you intended. If so I doubt this is the proper forum. Irregardless people have no patience for a computer 9 times out of 10 they will hit the power switch or pull the cord if its taking to long to shutdown.
drkwlf
26-Jan-15 21:48pm
View
Interesting idea. I was contemplating all the error messages from MessageBox()s to Dialog's in order to provide more information about that specific error. Using WM_DISPLAYCHANGE:{CheckResolution();EndDialog(0);} would be much neater code although that still leaves the problem of the cleanest way to hang the program until the resolution is changed.
drkwlf
26-Jan-15 21:12pm
View
I see your point I think... After the Window has ran its course and is deleted there is no reason to clear the Window Handle as Windows has already forgotten about it.
drkwlf
26-Jan-15 14:18pm
View
Just for clarification destroying the window doesn't cause the instance to end. (If we are both using the word instance to refer to the program instance). The Window wrapper class is a simple wrapper class that registers, creates and destroys windows. There is an underlying message window that keeps the application active while the different windows perform different tasks. There are 20 ID's in the String Table set aside for Window Titles and Class Names. That the Message Window( Not a real message window, simply a window that is never shown ) can use to interact with the different Windows... For instance I have one window that tracks mouse movement while in the client area and draws the mouse path onto a different window. I don't know if this changes your opinion at all but after rereading the question I thought it important to be more specific
drkwlf
24-Jan-15 21:16pm
View
PS I am only a little strange... I think...
drkwlf
24-Jan-15 21:16pm
View
With the brackets... I taught myself programming and when I was figuring out statements they seemed to be opened with a function, member, loop etc... So my brain decided that logically thats where the bracket should be... I would assume your way would make it easier to find a missing bracket. Luckily that has not really been an issue for me. Like they say old habits die hard and I will try to remind myself to put the brackets on their own line... Thanks.
drkwlf
24-Jan-15 21:09pm
View
More than likely I will remove that code 'after' I find the best way of doing it. This is just a hobby so I can tell you the end-user, "me", doesn't mind being asked if I want to change resolution :). Asking to change the resolution and opening the control panel is a complicated feat which makes it worth doing. First you need to know what OS your running on ( Windows Vista +) uses the IOPENCONTROLPANEL while Windows XP doesn't have an exact procedure for doing it... After which you have to find a way to pause the program until the resolution is changed and then recheck before continueing. Its problem solving which I enjoy and it's why I am doing this in the first place.
I agree with checking for WM_DISPLAYCHANGE... From experimentation with PeekMessage it seems as though Windows passes that directly through the Window Procedure and not through the message loop? ie.. I can trap it through the window procedure but trying to trap it through PeekMessage hasn't worked... Perhaps I'm doing it wrong... I'll let you know how that works out.
I've liked your response the best. It seems everyone has an opinion on what I should or should not do, but failed to address the question that was asked. Though you don't agree with asking to change the resolution you offered suggestions on fixing the code and I appreciate that.
drkwlf
23-Jan-15 4:35am
View
Your probably right, but by not doing either I wouldn't learn anything. So I will try it both ways. As far as the code itself, any opinions?
drkwlf
23-Jan-15 4:16am
View
It's probably that it's 3 in the morning but I don't understand your comment. Get rid of the while loop? Which one? If I get rid of the first one how do I check if when they changed the resolution it now meets the minimum. If I get rid of the second then whats the best way to pause the program and wait for the display to change?
drkwlf
23-Jan-15 4:12am
View
Also is it better, in your opinion, to let them change it themselves or for the Application to adjust the resolution... I like the idea of changing it through the program because it sounds difficult querying display modes and picking the one closest to the current resolution that is greater than the minimum. At the same time I wonder if it's ok to have a program change a system setting itself.
drkwlf
23-Jan-15 4:08am
View
I agree completely, to a point. I learned by using my netbook a lot of programs simply cannot be used on their low resolution screens. So by having the program setting a minimum say 800 x 600, the application will always work. I read somewhere that you should design for the lowest resolution and then scale up. I was just now thinking that while(1)if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) {
if (msg.message != WM_DISPLAYCHANGE) { sleep(200);}break; would be better since technically the program wouldn't continue until the control panel was closed even if they applied the change.
drkwlf
12-Jan-15 17:10pm
View
The is usually my go too, that and commenting out new lines of code. Unfortunately, I didn't stop to fix the minor annoyance early on just kinda ignored it. So Hundreds of lines of code later it came difficult to find
drkwlf
17-Apr-11 2:27am
View
Sorry, work was hectic upvoted it today... Thanks for the help again and if you see any parts of the code that could be better feel free to email me at adams.stevenw@gmail.com I look forward to the feedback
drkwlf
13-Apr-11 15:20pm
View
That did it thanks sorry took me so long to get back to it... Thanks again for all the help
drkwlf
9-Apr-11 14:04pm
View
Thanks for the quick response I did switch the includes to
Collapse | Copy Code
#include "includes/main.h"but I am still getting the errors
Ok I removed the includes from directx.h and winapp.cpp since they were class declarations only but again still getting the errors. If anyone can help me with this it would be greatly appreciated.
Also I started this project converting the WINAPI C source which is the same code minus all the DX stuff... It worked perfectly so it has to do something with there being two classes
By moving the #include "Includes/DirectX.h" in the main.h to after the extern WinApp DXApp; I get the same error but for the DirectX Class instead of the WinApp class
Collapse | Copy Code
c:\practice\final\src\includes\main.h(22) : error C2146: syntax error : missing ';' before identifier 'DX3D'c:\practice\final\src\includes\main.h(22) : fatal error C1004: unexpected end of file foundInstead of:
Collapse | Copy Code
c:\practice\final\src\includes\main.h(20) : error C2146: syntax error : missing ';' before identifier 'DXApp'c:\practice\final\src\includes\main.h(20) : fatal error C1004: unexpected end of file found
drkwlf
27-Mar-11 5:27am
View
Your a genious I owe you one...
drkwlf
27-Mar-11 0:53am
View
Thank you both for the help... I was using the Express Edition which didnt have the Resource View Menu Item but I went back to Visual Studio 2005
Show More