2

Can anyone give me an example code for a tool window (with pixel dimensions) for the Win32 API?

Thanks

1
  • 2
    you can find this on msdn easily, search first, ask later :) Commented May 1, 2011 at 11:17

1 Answer 1

2

Tool windows are just windows with the WS_EX_TOOLWINDOW extended style:

hWnd = CreateWindowEx(WS_EX_TOOLWINDOW, szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, 100, 100, 500, 400, NULL, NULL, hInstance, NULL);

Note you need to use CreateWindow*Ex* to use extended styles. The above is a 500x400 window at 100,100 on the screen.

Sign up to request clarification or add additional context in comments.

9 Comments

If you want a full example then here is the full visual studio solution. Completely overkill as it is essentially the basic template with one line changed (as shown above).
I had this, but how do I know what szWindowClass is.
that's the window class that you registered before calling CreateWindow.
Ok, it doesn't get any more simple than this. Making windows using the winapi is not a one line thing unfortunately,
@Midas If you aren't familiar with how to create a window in low-level Win32 then you really need to spend a bit of time doing some background reading. Otherwise you'll have a lot of problems. This kind of stuff is much easier with a framework (e.g. WinForms, VCL etc.)
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.