Jump to content
  • Advertisement

Archived

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

paymonh

cannot see window

This topic is 5905 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

hi this is what i have : i am using :http://www.gamedev.net/reference/articles/article1607.asp #define WIN32_LEAN_AND_MEAN #include "stdafx.h" #include "CInput8.h" #include <iostream.h> #include <fstream.h> #include <windows.h> #include <dinput.h> ofstream fout("general.txt", ios::out);// | ios::app); // renders the program void Render(void) { Read_Keyboard(); Read_Mouse(); // stuff if (KeyDown(DIK_SPACE)) { } if (KeyUp(DIK_SPACE)) { } if (KeyPress(DIK_RETURN)) { } // stuff float mx, my; Get_Movement(mx, my); //cursor_x += mx; //cursor_y += my; if (Button_Down(LEFT_BUTTON)) { } } // de-initiates the program void Destroy(void) { Release_Mouse(); Release_Keyboard(); Shutdown_CInput8(); } int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hWnd = CreateWindowEx( 0, "window1", "window1", WS_VISIBLE|WS_POPUP|WS_CAPTION|WS_SYSMENU, 200, 200, 400, 200, NULL, NULL, hInstance, NULL ); Init_CInput8(hInstance); // takes handle to the window as parameter Init_Keyboard(hWnd); // takes instance handle as parameter Init_Mouse(hWnd); // takes instance handle as parameter Render(); Destroy(); return 0; } /////////////// how come i do not see the window that i created? how do i look at the results? ie. mouse_righ, mouse_left .. thanks

Share this post


Link to post
Share on other sites
Advertisement
My win32 init code has UpdateWindow(hWnd); right after CreateWindowEx(....). I don''t know what this function does, look it up in MSDN.

Proceeding on a brutal rampage is the obvious choice.

Share this post


Link to post
Share on other sites
HWND hWnd = CreateWindowEx(
0, "window1", "window1",
WS_VISIBLE|WS_POPUP|WS_CAPTION|WS_SYSMENU,
CW_USEDEFAULT, SW_SHOW, 0, 0, NULL, NULL, hInstance, NULL );
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

this does not work either

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You need to define a window class using the WNDCLASSEX structure and then reigster the class using RegisterClassEx. Then use this window class to create the window.

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!