Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

emileej

No win mouse+maximize win at creation time - how to?

This topic is 6175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am developing a full screen dx game, and two things keep on annoying me: 1) How do i maximize the main win at creation time? 2) How do i hide the std. win cursor? ------------- E-)mil http://eej.dk - Just another crazy dane

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
To hide the cursor call this after you have created your window:

ShowCursor(false);

And to make it visible again:

ShowCursor(true);

I usually use a WNDCLASSEX struct to describe my window. If that is what you are doing then to create your window you probably use CreateWindowEx(). So just set the dwstyle parameter to WS_MAXIMIZE. This flag will make sure that your window will be initially maximized upon creation. I think everything is the same for WNDCLASS and CreateWindow().

If you are trying to make a full screen DX application then having a maximized window is probably not what you want. Full screen is a different story, I''ll tell you if that''s what you''r asking.

Share this post


Link to post
Share on other sites
ShowWindow(hwnd, SW_SHOWMAXIMIZED);  


This should display your window maximized.

case WM_SETCURSOR:
SetCursor( NULL ); //Turn off windows cursor
return TRUE;


This disables the windows mouse cursor when it is within the bounds of your window. Place it in your WinProc and everything should be fine.

EDIT: Seems someone was faster than me

Edited by - cha Mithrandir on September 21, 2001 11:02:40 AM

Share this post


Link to post
Share on other sites
>>Annonymus

No no - i am just getting annoyed of the hidden windows task bar popping up, when i reach the edge of the screen - solution: Maximize the window

It works fine wut u described - except for that the window (created with CreateWindowEx) appears as maximized, but is given a position, and a size - i figure, that it is because of me giving it a 800x600 size, but how do i avoid doing that?
Creation of the window:


hwnd = CreateWindowEx(0,VindueNavn,"EEJInvader3000",WS_MAXIMIZE,CW_USEDEFAULT,CW_USEDEFAULT,800,600,HWND_DESKTOP,NULL,hInstance,NULL);


-------------
E-)mil
http://eej.dk

- Just another crazy dane

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This is what I would do:

hwnd = CreateWindowEx(NULL, "Main", // Class
"MAIN WINDOW TITLE", // Title
WS_MAXIMIZED, // style flags
0, // Left corner cordinate
0, // Top corner cordinate GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
NULL, // Handle to parent window
NULL, // Handle to menu
hinstance, // Instance
NULL); // Creation parms


GetSystemMetrics(SM_CXSCREEN) returns width of the desktop.
GetSystemMetrics(SM_CYSCREEN) returns the height of the desktop.
I''m still not exactly sure of the results you want. As I understand it a maximized window is not going to keep the taskbar from showing.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That code didn''t realy come out right...let me try again.

hwnd = CreateWindowEx(NULL,
"Main",
MAIN_WINDOW_TITLE,
WS_MAXIMIZED,
0,
0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL,
hinstance,
NULL);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
One more thing:

ShowCursor(false);

Just tells windows not to draw the cursor when it is in the bounds of your window. However, you can still do things with it like activate the dropdown menues ect you just can''t see it. The method cha Mithrandir told you about seems like a better solution (disables instead of hides). That is if you have things activated by the mouse on your window and you wan''t to keep the user from accessing those things through the mouse.

Share this post


Link to post
Share on other sites
It works fine, but i now discovered another - eaven more fustrating subject:
The mouse still works on the window as it does in windows = if u click the "right" spots, u can resize, move and close the window!!!

-------------
E-)mil
http://eej.dk

- Just another crazy dane

Share this post


Link to post
Share on other sites
>>infinitycool
If you read some of the other postings, you will see that i have posted my window creation call
The popup style is a window without a title line, unreziseable and stuff like that?

-------------
E-)mil
http://eej.dk

- Just another crazy dane

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!