Questions tagged [createwindowex]
43 questions
43
votes
1 answer
WinAPI: Create a window with a specified client area size
I was wondering how can I create a window using Win32 API with a specific client area size.
When trying to create a window using the following piece of code, the entire window is 640x480, with the window's chrome taking some of the client area:
HWND…

GeReV
- 3,195
- 7
- 32
- 44
6
votes
2 answers
Specifying a Window Procedure for child Windows
I would like to know if its possible to specify a WndProc for a Child Window created by CreateWindowEx.
I have created a Window Class, the Main Window, the Window Procedure and a Message Loop already. The code works and I decided to keep it out for…

Vinz
- 3,030
- 4
- 31
- 52
6
votes
3 answers
How do you get CreateWindowEx() to create the window on a specific monitor?
I've determined that I can use GetSystemMetrics(SM_CMONITORS) to query the number of attached monitors, but is there any way to control what monitor CreateWindowEx() uses for the window?

dicroce
- 45,396
- 28
- 101
- 140
5
votes
2 answers
Creating a window using CreateWindowEx without an icon
With C#, I was easily able to get the effect I wanted:
However, I'm having trouble doing the same thing using the Win32 API in C. I don't know how to create a window that has no icon (at all), but still has a caption, a minimize button, and a…

Neal P
- 599
- 1
- 8
- 16
4
votes
1 answer
Why I don't see a question mark when I use WS_EX_CONTEXTHELP?
I am learning WinAPI. MSDN:
WS_EX_CONTEXTHELP
The title bar of the window includes a question
mark. When the user clicks the question mark, the cursor changes to a
question mark with a pointer. If the user then clicks a child window,
the…

Andrey Bushman
- 11,712
- 17
- 87
- 182
4
votes
1 answer
How do I obtain the HINSTANCE for the CreateWindowEX function when using it outside of WinMain?
I am trying to create a popup window when I click a button on my main window, and I am using the CreateWindowEX function for that purpose. However, the CreateWindowEx function recieves the HINSTANCE type variable as its second last parameter. Given…

rsthegreat12
- 159
- 2
- 2
- 8
4
votes
1 answer
CreateWindowEx failing
I'm following the NeHe gamedev tutorials (while altering them to be OO) and I've run into a problem with the CreateWindowEx demo (http://nehe.gamedev.net/tutorial/creating_an_opengl_window_(win32)/13001/).
I'm trying to pass the WndProc a pointer to…

Alex Jeffrey
- 523
- 6
- 17
2
votes
1 answer
CreateWindowEx creates old (Windows 7) style border on Windows 10
Whenever I create a window with CreateWindowEx(...) (exact parameters can be found in the code below), it shows up like an old style window:
Only when I start it on a remote desktop, close the connection and reconnect, it changes to the desired…

T. J. Evers
- 391
- 1
- 13
2
votes
0 answers
Why does CreateWindowEx not work as expected?
I followed the tutorial at:
http://www.winprog.org/tutorial/simple_window.html
I have a reasonable understanding of what everything in the tutorial is doing and my test program works. I have tried to create a plugin for winamp using the hInstance of…

diolemo
- 2,621
- 2
- 21
- 28
2
votes
1 answer
CreateWindowEx returns NULL
The following is a portion of my code. Every time I run the program, CreateWindowEx of the SPanel returns NULL, triggering an error. Can anyone see what is wrong with this piece of code?
SPanelProc and MainWndProc are declared already, and is of…

GILGAMESH
- 1,816
- 3
- 23
- 33
2
votes
1 answer
How to call CreateWindowEx from Ruby?
I have the following code which is fine if I give invalid parameters (though, obviously doesn't work), but whenever I give accurate parameters, ruby segfaults. I'm inclined to believe that this is a problem with my code and/or the ability of ruby to…

Matthew Scharley
- 127,823
- 52
- 194
- 222
1
vote
1 answer
'BeginDraw' in conjunction with D2D1 causes an error
I'm trying to clear the background of a window created with CreateWindowEx with the code separated into separate classes, with the use of D2D1. Here's the code.
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
switch…

Charlie
- 77
- 1
- 2
- 13
1
vote
1 answer
Win32 API - HWND "{unused = ???} Unable to read memory" error
My project is C++ Windows Desktop Wizard AKA Win32 API project.
In function WinMain(...) I'm creating my window:
hWnd = CreateWindowEx(NULL, _T("DesktopApp"), _T("Hi, I'm window"), WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 640, 480,…

Vanes
- 41
- 3
1
vote
0 answers
In WinAPI, how to make a stretchable OpenGL window with correct mouse, trapped properly for games?
I have read a lot of Stack Overflow over the years when struggling with making sense of Microsoft Windows' strange world of CreateWindowEx() .. etc. This question, when originally asked was "What is the best way to create a fluidly resizable OpenGL…

Head Wizard Locke
- 129
- 1
- 9
1
vote
1 answer
WinAPI CreateWindow WS_POPUP resize flickering
I'm creating a window with no borders (WS_POPUP in CreateWindow) and need to resize it when mouse is over and change back when mouse is out of the application. It works OK, but it flickers when I change the position using SetWindowPos. I need to…

Andrei
- 367
- 5
- 18