im having problems with making the window maximized and uncloseable... basically, im wanting the window to maximize and be uncloseable unless requirements are met. (example -- passwords in a screensavers) any help or a site i can go to?
This is a discussion on window properties within the C++ Programming forums, part of the General Programming Boards category; im having problems with making the window maximized and uncloseable... basically, im wanting the window to maximize and be uncloseable ...
im having problems with making the window maximized and uncloseable... basically, im wanting the window to maximize and be uncloseable unless requirements are met. (example -- passwords in a screensavers) any help or a site i can go to?
To do this just make the window style: WS_POPUP. (And that style only.)
Then make you'r window position: x = -5, y - =5.
And make your windows size: x = GetSystemMetrics(SM_CXSCREEN) + 10, y = GetSystemMetrics(SM_CYSCREEN) + 10.
Then make declare your windows WM_DESTROY statement, but leave it blank.
ok, i need some help with that explanation, im more visual, maybe a website? I'm looking for it, but most of the stuff coming up is for VC++, and MSDN isnt helping...
Last edited by Warhawk; 09-13-2005 at 04:11 PM. Reason: oops
heres some code i picked up, but im having a problem with it:
the code in red is what is bringing up the error message...Code:#include <iostream> #define WINDOW_WIDTH 640 //sets window width #define WINDOW_HEIGHT 480 //sets window height CreateWindow(CLASSNAME, "Basic Window", WS_POPUP| WS_VISIBLE, (GetSystemMetrics(SM_CXSCREEN)>>1) - (WINDOW_WIDTH>>1), (GetSystemMetrics(SM_CYSCREEN)>>1) - (WINDOW_HEIGHT>>1), WINDOW_WIDTH,WINDOW_HEIGHT,NULL,NULL,hinstance,NULL);
it says: expected constructor, destructor, or type conversion before '(' token.
expected `,' or `;' before '(' token
Last edited by Warhawk; 09-13-2005 at 04:57 PM.
Is this for a Win32 program or a console program? If you post your code that'll help.
basic C++ program using dev-C++
this is just a demo... that is where the code is supposed to go, right?
Last edited by Warhawk; 09-13-2005 at 05:04 PM.
no help... gosh i feel loved
I've never used dev-C++ so I'm not sure how possible if it can be used to create window programs. I suggest you post this question in the Windows Programming board here (or have a mod move this one) and make sure you post all of your code.
Unfortunately windows programming is very difficult and if you are just starting out I doubt you'll find it understandable. Its possible to maximize a console window for a simple program but I don't think you can make it uncloseable.
Look in this thread for ideas to make the window maximized:
C++ Full Screen
Yes, it can. But I haven't used it either....I'm not sure how possible if it can be used to create window programs.
I don't think it's possible either... since you are not writing the code that creates the "DOS box"Its possible to maximize a console window for a simple program but I don't think you can make it uncloseable.
I'm not sure how much "support code" you need for CreateWindow().... It may only work as part of a full Windows GUI application. (?)
Did you include <windows.h> ?
Is there a main() or WinMain() function ?
CreateWindow() seems to require two strings, a class name and a window name. I think CLASSNAME is wrong here, unless it's a pointer to a string.
And, you've messed-up the last "NULL" with an extra space: ...WINDOW_WIDTH,WINDOW_HEIGHT,NULL,NULL,hinstance,NUL L);
Right! Here's the famous Forger's Tutorial which shows how a window is normally closed:Then make declare your windows WM_DESTROY statement, but leave it blank.
You click on the X
Windows sends a WM_DESTROY message to your window
Your program (WinProc) responds with PostQuitMessage, which shuts-down your program.
thanks alot, that clears up alot of stuff! the explanation in the first link was great!